GH-49437: [Python][GPU] Support legacy and native Numba CUDA context handles - #50923
Open
contentis wants to merge 1 commit into
Open
GH-49437: [Python][GPU] Support legacy and native Numba CUDA context handles#50923contentis wants to merge 1 commit into
contentis wants to merge 1 commit into
Conversation
contentis
requested review from
AlenkaF,
assignUser,
jonkeane,
kou,
raulcd and
rok
as code owners
August 20, 2026 09:05
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #49437
Numba-CUDA 0.28 changed CUDA context handles from
ctypes.c_void_pto nativecuda.bindings.driver.CUcontextobjects. PyArrow currently expects incoming handles to have.valueand also always returnsctypes.c_void_pwhen converting back to Numba.I added a small compatibility layer which:
ctypeshandles and nativeCUcontextobjects..value.cuda.bindingsare intentionally imported lazily here since they are optional dependencies. Not sure how happy I am with this bit but it was the best solution in my opinion.There is also a temporary
numpy<2.5constraint for the Numba-CUDA environment. Numba-CUDA 0.30.4 currently uses the removednp.row_stackattribute with NumPy 2.5. This is already being handled upstream in NVIDIA/numba-cuda#916 and the constraint can be removed once that fix is released.Testing
I tested the full CUDA Numba interop suite locally with:
Cython compilation, linting and ShellCheck also pass.