-
Notifications
You must be signed in to change notification settings - Fork 224
test_nvvm.py changes for compatibility with CTK 11.8 #443
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Collaborator
Author
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
|
/ok to test |
rwgk
added a commit
to leofang/cuda-python
that referenced
this pull request
Feb 11, 2025
Collaborator
Author
leofang
reviewed
Feb 11, 2025
Contributor
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Member
|
/ok to test |
leofang
approved these changes
Feb 11, 2025
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cuda.bindings
Everything related to the cuda.bindings module
P1
Medium priority - Should do
test
Improvements or additions to tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolve compatibility problems discovered while backporting PR #421 to the 11.8.x branch.
The NVVM IR
major&debug_majorversion numbers inMINIMAL_NVVMIR_TXTin test_nvvm.py need to match the version numbers in the libnvvm.so being used.For CTK 11.8 the libnvvm.so IR
major&debug_majorversions numbers are1and3, respectively.For CTK 12.x the libnvvm.so IR
major&debug_majorversions numbers are2and3, respectively.This is easily accommodated for
MINIMAL_NVVMIR_TXT, but generatingMINIMAL_NVVMIR_BITCODErequires a tool for converting NVVM IR text to bitcode.If
llvmliteis available the conversion is actually very simple:However, we decided it is best to not make
llvmlitea hard dependency for testing. To this end, a dictionary with bitcode inputs inbinasciiformat is introduced, keyed by NVVM IRmajor&debug_majorversion numbers, e.g.:Now we have a total of four combinations of situations:
llvmliteavailable yes/noMINIMAL_NVVMIR_BITCODE_STATICentry available yes/nollvmliteis available, running test_nvvm.py will generate the missing entry forMINIMAL_NVVMIR_BITCODE_STATIC, correctly formatted for pasting into test_nvvm.py, andbitcode_statictesting will simply be skipped.If only the
MINIMAL_NVVMIR_BITCODE_STATICentry is available,bitcode_dynamictesting will simply be skipped. This is assumed to be the routine situation.If both
llvmliteand theMINIMAL_NVVMIR_BITCODE_STATICentry are available, testing will run with both independently.With this setup it is expected to be very easy to keep up with new CTK versions.
llvmliteis needed only when testing with a new CTK version for the first time, to generate the newMINIMAL_NVVMIR_BITCODE_STATICentry.