feat(cuda.core): share VirtualMemoryResource buffers with fabric handles #3230
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 524 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3230"
general
weight: 0.35
brandon-b-miller
Summary
Buffers of a
VirtualMemoryResourceconfigured withhandle_type="fabric"can now be shared between processes on one node. This adds the fabric transport that #2980 tracks, beside the POSIX fd transport from #3028.Changes
VirtualMemoryFabricBufferDescriptor(listed inapi_private.rst): one opaque 64-byteCUmemFabricHandleper physical allocation, the allocation sizes, the buffer size, and the exporting device's UUID. It is plain data:pickleandmultiprocessingcarry it without the file-descriptor machinery, it compares and hashes by value, andfrom_handles()rebuilds one received through a transport of your own, with validation. The export zeroes the handle struct first, so two exports of one allocation carry the same bytes and no stack bytes travel in a descriptor._VirtualMemoryDescriptor, soBuffer.from_ipc_descriptorand the resource's import run one loop for both transports. The fd descriptor keeps its ownership and identity semantics and itsfrom_fds().VirtualMemoryResourceconstruction checksDevice.properties.handle_type_fabric_supportedforhandle_type="fabric"and raisesRuntimeErrorthat names the NVLink fabric and IMEX channel requirements, before an allocation can fail opaquely. A device can report support while the allocation is refused (the attribute does not check for an NVLink fabric, and older drivers do not check for an IMEX channel); a refused allocation then carries a note that says so.is_ipc_enabledisTruefor"fabric"on Linux with device-located memory.VMM_DESIGN.mdsay so wherever descriptor lifetime is described._ipc.pyiand_virtual_memory_resource.pyiare regenerated by the stub hook.tests/memory_ipc/test_vmm_fabric.pycovers export shape, descriptor validation and pickling, Queue, Pipe, Process-argument, and Pool round trips for descriptors and buffers, a second-GPU import with peer access, handle-type mismatch, garbage and stale handles, re-export of imports, a queued buffer that does not pin, and the unsupported-device error. The fabric fixtures skip on devices without fabric handle support, and on devices that report it but refuse the allocation (one probe allocation per device).Validation
Fabric handles need an NVLink fabric and an accessible IMEX channel. The project's CI has no such runner, so the fabric cases skip there; the release note says that this release's fabric support is not covered by CI. On the CI runners the attribute is true while every fabric allocation is refused with a driver error: the runner VMs disable NVLink and have no IMEX channel, and the attribute checks neither on those drivers. That is why the fixtures probe instead of trusting the attribute.
Validation on NVIDIA internal hardware: a two-GPU B300 system ran the
memory_ipcsuite andtest_memory.pytwice: on the first commit (478 passed, 21 skipped; the one failure found the uninitialized padding in the exported handle struct) and on the fix and on the PR head withmainmerged (479 passed, 21 skipped each), and a Hopper system without fabric support ran the fabric and fd suites (30 passed, 17 skipped, with the unsupported-device error test among the passes). The fabric suite also passed inside a container on the B300 system (a stock CUDA base image with the GPUs injected by the NVIDIA container CLI and the IMEX channel device node mounted; 18 passed, 1 skipped, three runs). Multi-node sharing is out of scope and untested.Related Work
Part of #2980. Follows #3028 and #3229; this PR includes the #3229 commit until that PR merges.
🤖 Generated with Claude Code