Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Offload] Add framework for math conformance tests#149242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
leandrolcampos wants to merge7 commits intollvm:main
base:main
Choose a base branch
Loading
fromleandrolcampos:Conformance

Conversation

leandrolcampos
Copy link

@leandrolcamposleandrolcampos commentedJul 17, 2025
edited
Loading

This PR introduces the initial version of a C++ framework for the conformance testing of GPU math library functions, building upon the skeleton provided in#146391.

The main goal of this framework is to systematically measure the accuracy of math functions in the GPU libc, verifying correctness or at least conformance to standards like OpenCL via exhaustive or random accuracy tests.

How to Build and Run

This test suite depends on the Offload and GPU libc runtimes. After ensuring the runtimes are built (see theofficial instructions), a specific test can be run via:

ninja -C path/to/build/runtimes/runtimes-bins offload.conformance.LogfTest

Next Steps

The planned next steps are:

  • Add command-line argument support for--platform and--device_id.
  • Add standard LLVM file headers to all new code files.
  • Add more tests for half-precision functions and single-precision univariate functions.
  • Implement theRandomGenerator to enable testing of functions with large input spaces (e.g., double-precision).
  • Add tests for single-precision bivariate functions and double-precision functions.
  • Add support for other math library providers:cuda-math andhip-math.
  • Add support for the--provider command-line argument.
  • Implement a unit test suite for internal framework utilities (e.g.,computeUlpDistance).
  • Add a README.md file.

@github-actionsGitHub Actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using@ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by theLLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on theLLVM Discord or on theforums.

Copy link
Contributor

@jhuber6jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Some things to address:
Small LLVM style nits (header, braces, pragma once)
Detect user's platform based on input images (AMDGPU / NVPTX)
Re-use as much as possible of the LLVM libc utils (fpbits)
Don't worry about asynchronous launches for now

@@ -62,6 +62,8 @@ function(add_offload_test_device_code test_filename test_name)
set(output_file"${CMAKE_CURRENT_BINARY_DIR}/${test_name}.amdgpu.bin")
add_custom_command(
OUTPUT${output_file}
# TODO(jhuber6): Add and test the '-stdlib' flag here; also consider
# the '-fno-builtin' flag.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should be able to pass the same flags.

@@ -0,0 +1,121 @@
#pragma once
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LLVM header and#ifndef guards per the LLVM style.

llvm::StringRef KernelName)constnoexcept {
assert(Image &&"Image provided to getKernel is null");

if (Image->DeviceHandle !=this->DeviceHandle) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Here and elsewhere, blocks with one line don't need braces as per LLVM style.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jhuber6jhuber6jhuber6 left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@leandrolcampos@jhuber6

[8]ページ先頭

©2009-2025 Movatter.jp