-
Notifications
You must be signed in to change notification settings - Fork 91
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
Enable discovery and loading at run time of NVRTC and nvJitLink libraries in a wheels ecosystem #363
Conversation
CTK installations distribute their libraries using personal packages: - nvidia-nvjitlink-cuXX - nvidia-cuda-nvrtc-cuXX The relative path of their libraries to cuda-bindings is consistent, and allows us to use relative paths to discover them when loading at run time.
/ok to test |
/ok to test |
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.
Thanks, Vlad! I left two comments below.
I understand this is the 2nd step as discussed offline. For the 1st step, I think it'd be nice to preserve what pip install cuda-python
behaves today (not depending on CUDA wheels). So let's add an all
optional dependency to facilitate the usage
pip install cuda-python[all]
This can be achieved by adding this section to pyproject.toml
(example):
[project.optional-dependencies]
all = [
"nvidia-cuda-nvrtc-cu12",
"nvidia-nvjitlink-cu12>=12.3.*",
]
We should also document this new installation option.
btw I'll test this manually before merging. I'll also add a new test workflow to test this new use case (meaning we don't install the mini CTK in the test job), in a separate PR. (Let me know if you are interested in work stealing 😉) |
Another thing: Since we do not have any Windows GPU runners in the CI, even if I add a new test job targeting this capability there's still one bug that we wouldn't be able to catch, which is that we need a bit more logic to discover the NVRTC DLL location. We've done this for nvJitLink and the same logic was also applied in nvmath-python:
so @vzhurba01 this will require some manual testing on Windows for the time being... |
cc @kmaehashi @gmarkall for vis |
Done. Also I've split the new documentation between this PR and a new draft PR #366. That draft would only make sense after the new wheels are posted. |
Done. Note that I found some awkwardness during testing and added a comment with commit: 0e51e7d#diff-368f861093deb2399fd7b59421bef21cace83e3092956aafe62b06fbb4e9f235R80-R83
because NVRTC APIs return error code |
No work stealing just yet 😅 I'd be happy to grab it after I first work through my P0s and P1s ✊ |
/ok to test |
Ahhhh yes sorry I forgot about this and wasted your time 😓 Yes, on Windows it's annoying that DLL loading is weird, unlike on Linux where Here's the treatment I added to nvmath-python: |
Is this change targeting only CUDA 12 releases? (nvJitLink is CUDA 12 only, but it might be possible for NVRTC wheels to be used with CUDA 11.) Also, I am 100% happy with a hard (non-optional) dependency on CUDA wheels. We have moved to having a hard dependency on CUDA wheels in RAPIDS. It helps constrain the space of possible installation types and ensures the necessary libraries are available somehow. |
Normally I'd be against messing with the PATH, but because this is done only after we confirm that
My plan was to propagate this change to CUDA 11 as well. This would require a new 11.8.x patch release to make use of it, but I haven't put thought into what else should be bundled and when. |
I added the to-be-backported label, so ideally the bot would raise a PR for us once this one is merged. However, the cherry picking could fail in which case we'll need to do it manually. |
Note that the backport will need cleanup by changing the |
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.
LGTM! Thanks!
Backport failed because this pull request contains merge commits. You can either backport this pull request manually, or configure the action to skip merge commits. |
Looks like the bot is not happy with this PR 🤷 @vzhurba01 would you mind backporting the NVRTC bits manually (so as to avoid asymmetry between 11/12)? |
|
|
Support discovery of NVRTC and nvJitLink libraries at run time
CTK installations distribute their libraries using personal packages:
The relative path of their libraries to cuda-bindings is consistent,
and allows us to use relative paths to discover them when loading
at run time.
close #286
close #287