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 b804e18
Browse filesBrowse the repository at this point in the historyBrowse files
cuda.core: no descriptor cache, no re-export, raw-fd transport for VMM IPC
Apply the decisions on the VirtualMemoryResource IPC design.
No exporter-side cache. VirtualMemoryBuffer.ipc_descriptor exports on
every access and returns a new descriptor that owns its file
descriptors; they close when the descriptor is released. Pickling a
buffer for multiprocessing builds a transient descriptor, so a sender
holds no file descriptors between sends. A spawned Process is the one
exception: it receives the file descriptors when it is created, after
pickling, so the transient descriptor stays on the spawning Popen until
the Process object is released. A descriptor pins the physical memory
while it exists, and nothing else does.
No re-export of imported memory. Every physical allocation records
whether cuMemImportFromShareableHandle produced it
(mem_allocation_is_imported), and modify_allocation reuses the
allocation handles of its input, so the mark reaches every alias,
in-place grow, and move. Exporting such a buffer, directly or through
pickling, raises a RuntimeError before any driver call that says the
buffer contains memory imported from another process, that it cannot be
exported again, and that the caller should forward the descriptor it
imported from or copy into a buffer it owns. A Queue feeder thread
reports the same error and drops the item.
Raw-fd transport. VirtualMemoryIPCBufferDescriptor exposes handle_type,
sizes, handles, and fds, and from_fds() rebuilds a descriptor in the
receiving process from file descriptors received another way (the
integers are duplicated; IPCAllocationHandle objects are shared). The
descriptor's own pickling stays multiprocessing-only.
No ipc_enabled option: handle_type is the switch and is_ipc_enabled the
query, and the docs say so.
Tests: file descriptor counts return to baseline on both sides, export
under a lowered RLIMIT_NOFILE, the re-export errors for imported and
derived buffers (direct, Pipe, Process arguments, Queue feeder thread),
and raw-fd round trips through os.dup and a Unix socket with
SCM_RIGHTS.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
0 commit comments