Skip to content

Use pynvjitlink for CUDA 12+ MVC - #13650

Merged
rapids-bot[bot] merged 18 commits into
NVIDIA:branch-23.12from
brandon-b-miller:fea-nvjitlink
Nov 20, 2023
Merged

Use pynvjitlink for CUDA 12+ MVC#13650
rapids-bot[bot] merged 18 commits into
NVIDIA:branch-23.12from
brandon-b-miller:fea-nvjitlink

Conversation

@brandon-b-miller

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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-pr-bot

copy-pr-bot Bot commented Nov 14, 2023

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

/ok to test

@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/ok to test

Comment thread python/cudf/cudf/utils/_numba.py Outdated
Comment thread python/cudf/cudf/utils/_numba.py


_patch_numba_mvc()
patch_numba_linker_cuda_11()

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@bdice bdice Nov 17, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 and others added 2 commits November 17, 2023 09:05
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/ok to test

@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/ok to test

@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/ok to test

@bdice bdice left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread python/cudf/cudf/tests/test_mvc.py Outdated
Comment thread python/cudf/cudf/utils/_numba.py Outdated
Comment thread python/cudf/cudf/utils/_numba.py
brandon-b-miller and others added 2 commits November 17, 2023 14:21
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/ok to test

Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@brandon-b-miller

Copy link
Copy Markdown
Contributor Author

/ok to test

@brandon-b-miller

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

/ok to test

Comment thread python/cudf/cudf/utils/_numba.py Outdated
def patch_numba_linker_pynvjitlink():
warnings.warn(
"Minor version compatibility requires pynvjitlink. "
"Please pip install pynvjitlink to proceed using cuDF."

@bdice bdice Nov 19, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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.

@bdice bdice left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

/ok to test

@brandon-b-miller

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 823d321 into NVIDIA:branch-23.12 Nov 20, 2023
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