- Notifications
You must be signed in to change notification settings - Fork14.5k
[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
base:main
Are you sure you want to change the base?
Conversation
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 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. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading.Please reload this page.
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:
Next Steps
The planned next steps are:
--platform
and--device_id
.RandomGenerator
to enable testing of functions with large input spaces (e.g., double-precision).cuda-math
andhip-math
.--provider
command-line argument.computeUlpDistance
).