Module nccl

Module nccl 

Source
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§

NcclConfig
2026-09-26: Meant for ncclCommInitRankConfig, which nothing in the workspace calls. It does not match ncclConfig_t in the installed nccl.h (2.29.7): that struct starts with magic NCCL_API_MAGIC (0xcafebeef), holds netName as a pointer, and has more fields.
NcclUniqueId
2026-09-26: ncclUniqueId: 128 bytes, passed by value.

Enums§

NcclDataType
2026-09-26: ncclDataType_t, the values up to ncclBfloat16 (9) as in nccl.h.
NcclRedOp
2026-09-26: ncclRedOp_t’s built-in operations, values as in nccl.h.
NcclResult
2026-09-26: ncclResult_t, values 0 to 7 as in nccl.h.

Functions§

check_nccl
2026-09-26: Ok for Success; otherwise an error naming context, the text of ncclGetErrorString and the code.
create_event
create_stream
destroy_event
destroy_stream
ncclAllGather⚠
ncclAllReduce⚠
ncclBroadcast⚠
ncclCommAbort⚠
ncclCommDeregister⚠
ncclCommDestroy⚠
ncclCommGetAsyncError⚠
ncclCommInitRank⚠
ncclCommInitRankConfig⚠
ncclCommRegister⚠
ncclGetErrorString⚠
ncclGetUniqueId⚠
ncclGroupEnd⚠
ncclGroupStart⚠
ncclMemAlloc⚠
ncclMemFree⚠
ncclRecv⚠
ncclReduceScatter⚠
ncclSend⚠
nccl_mem_alloc⚠
2026-09-26: ncclMemAlloc: size bytes of device memory from NCCL’s allocator; nccl.h notes the allocation may be larger than requested.
nccl_mem_free⚠
2026-09-26: ncclMemFree for a pointer from nccl_mem_alloc.
record_event
stream_ready
2026-09-26: cuStreamQuery, without waiting: true when the stream’s work is done, false on CUDA_ERROR_NOT_READY (600), an error otherwise.
stream_wait_event
sync_stream

Type Aliases§

NcclComm
2026-09-26: ncclComm_t, an opaque communicator handle.