Repository navigation
CUDA: Initial support for Minor Version Compatibility - #8180
Conversation
This needs to be enabled using the config variable `CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY`. Limitations: - It presently does not support linking archives, and therefore linking cudadevrt and Cooperative Groups. - Performance may be lower than using the driver's linker as relocatable code is always generated, even if there is only one PTX input.
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This is failing because it needs a not-yet-public package. |
|
gpuci run tests |
|
gpuci run tests |
If they are not available, this should not cause a problem unless the user requested MVC. If the user did, then an explanatory error message is more helpful than just the import error.
|
gpuci run tests |
1 similar comment
|
gpuci run tests |
|
gpuci run tests |
|
gpuci run tests |
The latest cubinlinker packages have now been copied from the gmarkall channel to the rapidsai channel.
|
gpuci run tests |
stuartarchibald
left a comment
There was a problem hiding this comment.
Thanks for the patch. This in general looks good, there's a few minor thing to resolve and this could do with a manual test to confirm the new code paths, otherwise should be ok to merge once comments are resolved. Thanks again.
- Change title to "CUDA Minor Version Compatibility" to make it clearer it only pertains to CUDA. - Explicitly state that Windows is unsupported. - Modify grammar describing the use of external packages.
- Edit wording and correct spelling in exception message given when required packages are not available. - Clarify reference to cc kwarg in exception message. - Minor edit to generation of arch string.
|
gpuci run tests |
|
I've reviewed through to cb163aa and approve the code changes, need to do a manual check that this is working as expected. |
As noted in an OOB discussion, |
stuartarchibald
left a comment
There was a problem hiding this comment.
Thanks for the patch and fixes!
|
Buildfarm ID: |
Passed. |
* main: (2743 commits) Upgrade stale GitHub action Changed wording of the escape error Correct documentation for CAS Revert "Merge pull request numba#8751 from apmasell/mulitprocess_recycling" CUDA driver.py: PR numba#8180 feedback CUDA Docs: Refine MVC docs based on PR numba#8180 feedback revert build_ext change add empty line back revert some changes fix compiler arg, revert build script add build_doc back, fix compiler arg Correct grammar in comment fix import Stale bot: Use `abandoned - stale` label for closed PRs refactor build_ext BLD: remove distutils CUDA tidy-up: remove some unneeded methods Update numba/tests/support.py Update .github/workflows/stale.yml Fix line length error from flake8 ...
This PR adds support for Minor Version Compatibility on Linux, so that Numba can be used with a CUDA toolkit of a later version than the CUDA version supported by the driver, within the same major version - for example, CUDA toolkit 11.7 can be used with a driver that only supports up to CUDA 11.5.
Minor Version Compatibility is not officially supported by NVIDIA for applications producing PTX, so this PR relies on two external packages to compile PTX and link cubins into a form that can be loaded by the driver. These are the
ptxcompilerandcubinlinkerpackages that I maintain as part of RAPIDS.ptxcompileris open-source and available in conda-forge, butcubinlinkeris binary-only and must be obtained from the RAPIDS channel or NVIDIA PyPI.There are two small limitations when using MVC at present:
cudadevrtand the use of Cooperative Groups is not supported.I plan to address these in a future PR - I just need to find a relatively straightforward and Pythonic way to extract objects from archives to add to the link, but I didn't want to add too much complexity to this initial support PR.
Implementation notes
The implementation works by providing a third choice
Linkerimplementation innumba.cuda.cudadrv.driver. This linker uses the PTX compiler fromptxcompilerand the linker fromcubinlinkerto compile and link PTX.Testing adds an additional configuration to test with the CUDA toolkit 11.7 on gpuCI - the gpuCI image only has a driver supporting CUDA 11.5, so this demonstrates correct operation of MVC in Numba.
A small change was made to the interface between the codegen and the linker - instead of the codegen being responsible for taking a copy of the buffer containing the linked executable, the linker now returns a copy that the codegen can own - this keeps things simpler by making the interface between the different linkers and the codegen uniform.