Repository navigation
Description
Feature Request
Add Python bindings and a cuda.core abstraction for CUDA Multicast Objects
(the cuMulticastCreate / cuMulticastAddDevice / cuMulticastBindMem /
cuMulticastBindAddr / cuMulticastUnbind family of driver APIs).
Motivation
Multicast Objects enable a single virtual address to multicast memory accesses
across multiple devices, which is foundational for efficient multi-GPU
collectives and SHARP-style reductions on NVLink-connected systems (Hopper+
and beyond). They are already exposed via the low-level cuda.bindings driver
API, but there is no high-level cuda.core object wrapping them.
This is one of the last major CUDA driver features without a cuda.core
counterpart. Internal teams building multi-GPU libraries (RAPIDS, Triton,
cuBLASMp, etc.) currently have to drop to raw driver calls.
Proposed Scope
- A
MulticastObject(or similarly named) class with:- Constructor / factory taking granularity + participating-device list
add_device(device)/bind_memory(buffer)/bind_address(...)/
unbind(...)methods- Context-manager lifecycle (auto-release on exit)
- Integration with existing
Device,Buffer, andVirtualMemoryResource
- Query helpers for multicast granularity (
cuMulticastGetGranularity) - Example(s) under
cuda_core/examples/demonstrating a simple 2-GPU
multicast allreduce-style pattern - API reference entry in
cuda_core/docs/source/api.rst
Related
- Tracking gaps identified in cuda.core feature audit (Nov 2025) — other
untracked gaps includehost_launchandLibrary(cuLibrary) APIs; those
can be filed separately. - Relevant driver APIs:
cuMulticastCreate,cuMulticastAddDevice,
cuMulticastBindMem,cuMulticastBindAddr,cuMulticastUnbind,
cuMulticastGetGranularity.
Activity
leofang commentedon May 11, 2026
I have mixed feelings in this. On the one hand it's good to have a centralized, pythonic multicast object, on the other hand we simply don't have any hw that could test this feature (which requires at least Hopper+ GPUs, NVLink, and NVSwitch all together in one system, such as NVL72).
Also, from the CUDA perspective this is considered as a central part of VMM, for example
cuMulticastBindMemtakes a VMM handleCUmemGenericAllocationHandleso as to map VA across devices. Furthermore, the CUDA doc suggestswhich is inline with our user/developer guidance: Always start with a high-level library first. So I would wait until someone comes and asks us for coverage.
cc @benhg for thoughts from nvSHMEM & VMM perspectives
benhg commentedon May 13, 2026
I also have mixed feeling son this. In NVSHMEM, we bind multicast address ranges to VMM memprops (moral equivalent of VirtualMemoryResource-allocated objects) and actually can register VirtualMemoryResource buffers against the heap and use for Multimem access.
We are doing all this in the CPP library today, with Python bindings, rather than re-exposing in pure Python so far.
I do know of many users who build this functionality themselves (e.g. TorchSymmetric's CUDA backend)
rparolin commentedon Jun 2, 2026
Did we want to close this as "won't implement"?
cc: @leofang @benhg
2 remaining items
leofang commentedon Nov 25, 2026
Important
Draft for discussion, not a final design. Names, signatures and scope below are placeholders to anchor a review in the cuda.core design meeting. Expect all of them to change.
We now have a user request for this: multi-process multicast teams whose multicast object is shared through POSIX FD or fabric handles, on top of the VMM IPC and fabric support that landed for 1.3.0 (#2980). Below is a sketch based on the driver multicast API and the current
VirtualMemoryResourcedesign (VMM_DESIGN.md).How multicast relates to the existing VMM flow
A multicast object is a
CUmemGenericAllocationHandle, the same handle typeVirtualMemoryResourceallocates. Instead ofcuMemCreatememory, it is backed by memory that each device in the team binds into it. After that it goes through the usual reserve, map and set-access steps:In the usual one-GPU-per-process setup the object crosses processes. One process creates it, requesting the handle types in
CUmulticastObjectProp.handleTypes, and exports it withcuMemExportToShareableHandle. The other processes import it, every process adds its device, and binding can start only after all devices have joined.Why a new class instead of a
VirtualMemoryResourceoptionallocate(size)returns one buffer in one process and has nowhere to keep those.allocate()call would have to hide a barrier it cannot implement.modify_allocation) does not apply, because the size is fixed when the object is created.The new class should still reuse the VMM handle layer (allocation, reservation and mapping boxes, IPC descriptors) rather than build a parallel stack, and take buffers that existing resources produce as its input.
Sketch
Open questions
cuMulticastBindAddrtakes a pointer and accepts memory fromcuMemCreateorcudaMallocAsync, sobind()could take anyBufferfrom aVirtualMemoryResource(and probably from an IPC-enabledDeviceMemoryResource) without exposing allocation handles. A grown VMR buffer spans several allocations; whether one bind may cross allocations needs checking on hardware, and if not,bind()issues one call per allocation.VirtualMemoryResourcerounds tocuMemGetAllocationGranularity. Eitherbind()validates and raises, or the VMR options gain a way to round to the multicast granularity._v2entry points.cuMulticastBindMem_v2andcuMulticastBindAddr_v2(CUDA 13.1+) take the device explicitly and also accept host NUMA memory;cuMulticastUnbindalready takes the device. Use_v2when the driver has it and keep device memory working on older drivers.cuMemRelease), a binding box (deletercuMulticastUnbind) that keeps both the multicast object and the bound buffer alive, and a mapping box formap(). Whetherunbind()is explicit-only or also happens when the last owner goes needs a decision.sizeandnum_devices. Either reuse theVirtualMemoryFdBufferDescriptor/VirtualMemoryFabricBufferDescriptormachinery with a single entry, or add multicast-specific descriptor classes.map()returns. AVirtualMemoryBufferover the multicast range reuses the VMR reservation and mapping code, but the multicast address is meant formultimem.*instructions. Decide whichBufferoperations (copies, DLPack,__cuda_array_interface__) should be allowed on it.Device.properties.multicast_supportedis true (NVSwitch systems). No CI runner has one, so the tests skip in CI and are validated by hand on such systems, as with fabric handles.cuMemMap; kernels use the newfabric.*PTX instructions) and are shared only through fabric handles. That makes them a sibling class with the same shape, not a backend forMulticastObject.-- Leo's bot
rparolin commentedon Nov 28, 2026
Do we need this as well:
#2367 — Device attributes (logical-endpoint multicast support queries only)