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 ptxcompiler to patch Numba at runtime to support CUDA enhanced compatibility. #9687

Merged
merged 26 commits into from
Nov 29, 2021

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Nov 15, 2021

No description provided.

@github-actions github-actions bot added conda Python Affects Python cuDF API. labels Nov 15, 2021
@gmarkall
Copy link
Contributor

This looks good so far on inspection.

@shwina shwina changed the title Use ptxcompiler to patch Numba at runtime to support CUDA-enhanced compatibility. Use ptxcompiler to patch Numba at runtime to support CUDA enhanced compatibility. Nov 16, 2021
Copy link
Contributor

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

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

It sounds like we're not going to require ptxcompiler for ARM (and not even build the package for it) and just require CUDA 11.5 for it - in that case, I think we'll also need to depend on ptxcompiler conditionally, and guard its use with try ... except ImportError.

conda/recipes/cudf/meta.yaml Outdated Show resolved Hide resolved
Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

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

Per Graham's question about handling ImportErrors. Maybe the changes below would be sufficient?

python/cudf/cudf/__init__.py Outdated Show resolved Hide resolved
Comment on lines 109 to 114
# Patch Numba to support CUDA enhanced compatibility.
# See https://github.com/rapidsai/ptxcompiler for
# details.
patch_numba_codegen_if_needed()
del patch_numba_codegen_if_needed

Copy link
Member

Choose a reason for hiding this comment

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

Removed as added above

Suggested change
# Patch Numba to support CUDA enhanced compatibility.
# See https://github.com/rapidsai/ptxcompiler for
# details.
patch_numba_codegen_if_needed()
del patch_numba_codegen_if_needed

@shwina shwina marked this pull request as ready for review November 18, 2021 14:04
@shwina shwina requested review from a team as code owners November 18, 2021 14:04
@shwina shwina requested review from rgsl888prabhu and skirui-source and removed request for a team November 18, 2021 14:04
@raydouglass raydouglass added feature request New feature or request non-breaking Non-breaking change labels Nov 18, 2021
@@ -51,6 +51,7 @@ requirements:
- nvtx >=0.2.1
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to increase the numba pin in this file as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Contributor

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@galipremsagar
Copy link
Contributor

rerun tests

@jakirkham
Copy link
Member

rerun tests

@kkraus14
Copy link
Collaborator

This will make cudf change the behavior of Numba on import now, correct? It's a bit of a shame that we're adding additional side effects to importing cudf that are arguably more impactful than the memory allocator side effects we currently have...

@gmarkall
Copy link
Contributor

It patches Numba only in an Enhanced Compatibility scenario - when the toolkit version is newer than the driver version. When the driver version is sufficient, no patching occurs. In other words, the only scenario in which Numba is patched is when it wouldn't have worked at all.

In the long term I expect Numba will use ptxcompiler by default, but it also needs a cubin linker than can be linked statically too, which is not available at present. This will give Numba general support for Enhanced Compatibility, so no patch would be needed in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants