Repository navigation
Conversation
|
|
raulcd
left a comment
There was a problem hiding this comment.
Thanks so much for working on this @contentis !
While this has been tested locally with several versions of numba-cuda this is only tested on CI with numba-cuda latest, should we remove the comaptibility layer and make it only compatible with latest? Should we test with several numba-cuda versions on CI?
I am concerned that not having the "several compatibility" versions tested on CI will eventually fail and we will have some deprecated (untested) "compatibility" code.
@pitrou what do you think?
| if hasattr(handle, "value"): | ||
| return handle.value | ||
| return int(handle) |
There was a problem hiding this comment.
Can you add comments telling which path is legacy or native?
| from cuda.bindings.driver import CUcontext | ||
| return CUcontext(handle) | ||
|
|
||
| return ctypes.c_void_p(handle) |
| assert ctx.handle == ctx.to_numba().handle.value | ||
| converted = ctx.to_numba() | ||
| assert type(converted.handle) is type(nb_ctx.handle) | ||
| if isinstance(converted.handle, ctypes.c_void_p): |
There was a problem hiding this comment.
Here as well, can you comment on which path corresponds to which Numba version(s)?
Given that this code is quite simple and exists in a module that is hardly every modified, I think it's ok. It will obsolete in 1 or 2 years and we'll be able to remove it by then, I think. |
|
@contentis Can you merge/rebase from main? There is an unexpected CI error here. |
|
@contentis did you want to proceed with this PR? |
7698132 to
ae903b2
Compare
|
I've rebased from main to help moving this along. Also note that PR mentions:
Unfortunately this is not getting fixed, got closed as not planned: NVIDIA/numba-cuda#907 (comment) :
|
Here's a more radical suggestion: how about we deprecate Numba-CUDA support in PyArrow and then remove it? The code has almost not been touched since 2018 when it was first written by @pearu , and we don't seem to get any user feedback or reports about it (the only reason we are noticing problems is because of our own CI). I don't think anyone cares at this point. |
|
As for the Python CUDA CI jobs, we can simply skip |
Or it just works :) In any case, I agree that users should switch to the NVIDIA/numba-cuda-mlir approach ( I looked for downstream users of |
|
+1 on dropping support for numba-cuda |
|
Thanks for rebasing and reviewing! Do you still want this fix as a bridge before deprecation? If so, I’m happy to address the remaining comments. Otherwise, I’m fine with closing this PR. |
|
@pitrou, @raulcd shall we use this as a bridge fix while we track deprecation in #51204? Otherwise I'd prepare a skip-interop-test PR as an alternative. If we proceed with a bridge-fix, @pitrou and @contentis, do suggested comments suffice? In any case, thank you for all your work on this, @contentis ! |
|
I am fine with both an initial PR like this acting as a bridge before removal or dropping support directly as this has been failing for a while and we haven't had a single user reporting issues. |
|
A friendly ping @pitrou , @contentis - go/no go for this bridge-fix? |
|
Given that the patch is relatively short, I'm ok if you want to shepherd it to completion @tadeja |
Co-authored-by: tadeja <[email protected]>
5d12bd8 to
4626b53
Compare
|
I've rebased again, updated PR description and code comments - @contentis, could you confirm those look fine to you, or suggest changes? CUDA jobs passed (also Numba interop tests with numba-cuda 0.30.4), so I would merge this PR as-is on Wednesday if no other feedback. We track Numba-CUDA deprecation in #51204. |
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.Edit: Numba-CUDA is in maintenance mode now and upstream won't fix this, per NVIDIA/numba-cuda#907 (comment)NumPy <=2.4is recommended. The pinnumpy<2.5can be removed with #51204 (removal ofnumba-cuda).Testing
I tested the full CUDA Numba interop suite locally with:
Cython compilation, linting and ShellCheck also pass.