Uh oh!
There was an error while loading. Please reload this page.
Fix issues discovered during v0.6.0 integration testing - #1660
Conversation
Andy-Jost
commented
Feb 19, 2026
cc @brandon-b-miller — this restores the private |
Andy-Jost
commented
Feb 19, 2026
/ok to test 68bd7fbd0c5de226dea9b39bebc3cc99da1076ac |
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
Andy-Jost
commented
Feb 19, 2026
@mdboom Tried it — Cython rejects |
leofang
commented
Feb 19, 2026
Brandon will be verifying with numba-cuda locally. |
…mpat Adds _handle properties that delegate to .handle on Context and Kernel, preserving backward compatibility for downstream projects (e.g., numba-cuda) that relied on the private attribute. Co-authored-by: Cursor <cursoragent@cursor.com>
68bd7fb to
a6f091eCompareAndy-Jost
commented
Feb 19, 2026
/ok to test a6f091e |
- Convert @classmethod to @staticmethod for pickle callables in ObjectCode, IPCEventDescriptor, IPCBufferDescriptor, and Buffer to fix pickle identity check failures in Cython cdef classes - Comment out cuLibraryUnload calls in LibraryBox deleters to prevent potential segfaults when owning context is destroyed before library - Guard ml_dtypes import in test_utils.py as optional dependency Co-authored-by: Cursor <cursoragent@cursor.com>
Andy-Jost
commented
Feb 20, 2026
/ok to test 550c20e |
| p_cuLibraryUnload(b->resource); | ||
| // TODO: re-enable once LibraryBox tracks its owning context | ||
| // p_cuLibraryUnload(b->resource); |
There was a problem hiding this comment.
Note for posterity: This restores the old behavior since cuda.core 0.1.0 (this was changed when module/library was cythonized).
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
Adds parametrized roundtrip tests covering both pickle and cloudpickle for Device, ObjectCode, IPCBufferDescriptor, and IPCEventDescriptor. These tests guard against the Cython @classmethod identity issue fixed in NVIDIA#1660 (cloudpickle fails when __reduce__ references a @classmethod). ClosesNVIDIA#1671 Made-with: Cursor
Adds parametrized roundtrip tests covering both pickle and cloudpickle for Device, ObjectCode, IPCBufferDescriptor, and IPCEventDescriptor. These tests guard against the Cython @classmethod identity issue fixed in #1660 (cloudpickle fails when __reduce__ references a @classmethod). Closes#1671 Made-with: Cursor
Summary
_handleas a property onContextandKernelthat delegates to the public.handleproperty, providing backward compatibility for downstream projects (e.g., numba-cuda) that relied on the private attribute removed during the resource handles refactoringcdef classtypes (ObjectCode,IPCEventDescriptor,IPCBufferDescriptor,Buffer) where@classmethodcallables in__reduce__fail pickle's identity checkcuLibraryUnloadinLibraryBoxdeleters to prevent potential segfaults when the owning context is destroyed before the library (to be re-enabled onceLibraryBoxtracks its owning context)0.6.0to the docs version switcher (nv-versions.json)ml_dtypesimport intest_utils.pyas an optional dependencyChanges
_context.pyx: Add_handleproperty that returnsself.handle_module.pyx: Add_handleproperty onKernelthat returnsself.handle; convertObjectCode._reduce_helperfrom@classmethodto@staticmethod_event.pyx: ConvertIPCEventDescriptor._initfrom@classmethodto@staticmethod_memory/_buffer.pyx: Add@staticmethod _reduce_helperforBuffer.__reduce___memory/_ipc.pyx: ConvertIPCBufferDescriptor._initfrom@classmethodto@staticmethod_cpp/resource_handles.cpp: Comment outcuLibraryUnloadcalls inLibraryBoxdeletersdocs/nv-versions.json: Add0.6.0entrytests/test_utils.py: Guardml_dtypesimport with try/except and add skip markersTest Coverage
ObjectCodeverified manually_handleproperty delegates to existing.handlewhich is already tested_handlepathRelated Work
.handleto accesscuda-coreobjects numba-cuda#794