You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ef9b712
Browse filesBrowse the repository at this point in the historyBrowse files
cuda.core: validate and harden VirtualMemoryResource IPC imports
Address the review of the VirtualMemoryResource IPC path.
Import: check every imported allocation's location against the
resource's before mapping (the same device, or the same host location
type) and raise a ValueError that names both; reject a descriptor with
a size but no allocations; attach notes to driver failures that say
which chunk failed and why a peer-controlled size fails at the map.
The imported buffer no longer keeps the descriptor: the driver copies
the shared allocation into a handle of its own and keeps no reference
to the file descriptor, so the descriptors live only as long as the
caller holds the descriptor object.
Export: an imported buffer, and a buffer grown from one, cannot be
exported again because the driver exports only allocations created
with the requested handle type; say so instead of surfacing
INVALID_VALUE. modify_allocation() rejects a config whose handle_type
differs from the resource's, so every chunk of a buffer is exportable
the same way. __reduce__ preserves subclasses.
Tests: parametrize the memory_ipc suite over VirtualMemoryResource
(VirtualMR), with the pool-only scenarios guarded or skipped;
PatternGen works on the first `size` bytes of a larger buffer; the
fd-leak harness asserts on the success path; new VMM-only tests for
many-chunk ranges, a second device with and without peers, descriptor
validation and rollback, re-export, empty buffers, and a DLPack
consumer.
Docs: file descriptor and memory lifetime, multiprocessing-only
transport, trust boundary, device rule, re-export limit;
VirtualMemoryIPCBufferDescriptor in api_private; the
from_ipc_descriptor stub has its mr type again.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
0 commit comments