Expand description
2026-09-26: Raw NCCL bindings used by metrale-comm, plus the CUDA driver
stream and event calls it needs. The function declarations follow the
installed nccl.h (2.29.7); NcclConfig does not (see its doc).
The extern functions are unchecked: a caller passes a communicator from
ncclCommInitRank, device pointers valid for the element count on that
communicator’s device, and a stream of that device. The wrappers below
(create_stream to stream_ready) check only the status code.
Owner: metrale-gpu-sys. Invariants: none beyond the types.
Structs§
- Nccl
Config - 2026-09-26: Meant for
ncclCommInitRankConfig, which nothing in the workspace calls. It does not matchncclConfig_tin the installed nccl.h (2.29.7): that struct starts with magicNCCL_API_MAGIC(0xcafebeef), holdsnetNameas a pointer, and has more fields. - Nccl
Unique Id - 2026-09-26:
ncclUniqueId: 128 bytes, passed by value.
Enums§
- Nccl
Data Type - 2026-09-26:
ncclDataType_t, the values up toncclBfloat16(9) as in nccl.h. - Nccl
RedOp - 2026-09-26:
ncclRedOp_t’s built-in operations, values as in nccl.h. - Nccl
Result - 2026-09-26:
ncclResult_t, values 0 to 7 as in nccl.h.
Functions§
- check_
nccl - 2026-09-26:
OkforSuccess; otherwise an error namingcontext, the text ofncclGetErrorStringand the code. - create_
event - create_
stream - destroy_
event - destroy_
stream - nccl
AllGather ⚠ - nccl
AllReduce ⚠ - nccl
Broadcast ⚠ - nccl
Comm ⚠Abort - nccl
Comm ⚠Deregister - nccl
Comm ⚠Destroy - nccl
Comm ⚠GetAsync Error - nccl
Comm ⚠Init Rank - nccl
Comm ⚠Init Rank Config - nccl
Comm ⚠Register - nccl
GetError ⚠String - nccl
GetUnique ⚠Id - nccl
Group ⚠End - nccl
Group ⚠Start - nccl
MemAlloc ⚠ - nccl
MemFree ⚠ - nccl
Recv ⚠ - nccl
Reduce ⚠Scatter - nccl
Send ⚠ - nccl_
mem_ ⚠alloc - 2026-09-26:
ncclMemAlloc:sizebytes of device memory from NCCL’s allocator; nccl.h notes the allocation may be larger than requested. - nccl_
mem_ ⚠free - 2026-09-26:
ncclMemFreefor a pointer fromnccl_mem_alloc. - record_
event - stream_
ready - 2026-09-26:
cuStreamQuery, without waiting:truewhen the stream’s work is done,falseonCUDA_ERROR_NOT_READY(600), an error otherwise. - stream_
wait_ event - sync_
stream
Type Aliases§
- Nccl
Comm - 2026-09-26:
ncclComm_t, an opaque communicator handle.