Skip to content
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

Use pynvjitlink for CUDA 12+ MVC #13650

Merged
merged 18 commits into from
Nov 20, 2023

Conversation

brandon-b-miller
Copy link
Contributor

@brandon-b-miller brandon-b-miller commented Jun 30, 2023

Fixes #12822

This PR provides minor version compatibility in the CUDA 12.x range through nvjitlink via the preliminary nvjiitlink python binding. Thus far this PR merely leverages a local installation of the library and should not be merged until nvjitlink is hosted on conda-forge and cuDF's dependencies are adjusted accordingly, likely as part of this PR.

@brandon-b-miller brandon-b-miller added feature request New feature or request numba Numba issue Python Affects Python cuDF API. non-breaking Non-breaking change labels Jun 30, 2023
@brandon-b-miller brandon-b-miller requested a review from a team as a code owner June 30, 2023 15:36
@brandon-b-miller brandon-b-miller self-assigned this Jun 30, 2023
@jakirkham
Copy link
Member

Added a "Fixes" note in the OP. @brandon-b-miller please double check if that is correct

@brandon-b-miller brandon-b-miller changed the base branch from branch-23.08 to branch-23.12 November 14, 2023 13:11
@brandon-b-miller brandon-b-miller changed the title Use nvjitlink for CUDA 12+ MVC Use pynvjitlink for CUDA 12+ MVC Nov 14, 2023
Copy link

copy-pr-bot bot commented Nov 14, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

/ok to test

python/cudf/cudf/utils/_numba.py Outdated Show resolved Hide resolved
python/cudf/cudf/utils/_numba.py Show resolved Hide resolved


_patch_numba_mvc()
patch_numba_linker_cuda_11()
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be unconditionally using CUDA 11 patching logic in tests. We should use CUDA 12 patching logic when on CUDA 12, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this whole test skips in a CUDA 12 environment based on the below

@pytest.mark.skipif(
    not IS_CUDA_11, reason="Minor Version Compatibility test for CUDA 11"
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should probably add a test for CUDA 12 MVC eventually but I don't think any of our CI jobs would cover that case yet sadly.

Copy link
Contributor

@bdice bdice Nov 17, 2023

Choose a reason for hiding this comment

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

The MVC tests should be enabled for CUDA 12, even if we don't have an MVC-triggering environment in CI with the drivers/runtimes we use. We want to be able to run pytest on a system requiring MVC and know that it's being covered by cudf.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's okay to have them be skipped if on CUDA 12 and MVC is needed and pynvjitlink isn't available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that makes sense. I'm thinking I'll rename this file test_mvc and have a separate test for cuda 11 and cuda 12. updates to follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did some refactoring in 35b7e59

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

/ok to test

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

A few cleanups -- but this is looking close to right. Have you verified that the tests run locally as expected with pynvjitlink?

python/cudf/cudf/tests/test_mvc.py Outdated Show resolved Hide resolved
python/cudf/cudf/utils/_numba.py Outdated Show resolved Hide resolved
python/cudf/cudf/utils/_numba.py Show resolved Hide resolved
@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

A few cleanups -- but this is looking close to right. Have you verified that the tests run locally as expected with pynvjitlink?

For me at least tests pass locally building from source with a 12.0 driver and 12.3 CTK. I'll also do a round of follow up testing on the tip of 23.12 after the merge.

@brandon-b-miller
Copy link
Contributor Author

/ok to test

def patch_numba_linker_pynvjitlink():
warnings.warn(
"Minor version compatibility requires pynvjitlink. "
"Please pip install pynvjitlink to proceed using cuDF."
Copy link
Contributor

@bdice bdice Nov 19, 2023

Choose a reason for hiding this comment

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

Depending on the timing of pynvjitlink being shipped, we'll want to do one of the following:

  • If pynvjitlink isn't shipped by the time we release, we should remove this note and say something like before (explain the MVC problem and direct users to match their driver and toolkit)
  • If pynvjitlink is available in time, we should give the full install command, like pip install pynvjitlink --extra-index-url=https://pypi.nvidia.com

We don't want to leave this in a halfway state where we tell users to install pynvjitlink but don't specify the index, especially if the package isn't yet available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you feel about keeping the original warning to be safe then. The changes will still allow pynvjitlink to work once it's out, but we won't document it or direct users to it in any official way until then.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, do that. We can change the warning during code freeze if we ship pynvjitlink in time.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Approving with one request for a final change based on the status/timeline of pynvjitlink wheels being published: #13650 (comment)

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller
Copy link
Contributor Author

/ok to test

@brandon-b-miller brandon-b-miller added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Nov 20, 2023
@brandon-b-miller
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 823d321 into rapidsai:branch-23.12 Nov 20, 2023
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge feature request New feature or request non-breaking Non-breaking change numba Numba issue Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] CEC for CUDA 12: using nvjitlink (instead of ptxcompiler / cubinlinker)
5 participants