For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo module
ccl
Provides Mojo FFI bindings for NCCL (NVIDIA) and RCCL (AMD) collective operations.
Selects and loads the correct vendor library at runtime: librccl.so on AMD
systems and libnccl.so on NVIDIA systems. Exposes allreduce, allgather, and
broadcast collectives, along with communicator initialization helpers and
availability probes.
comptime values
CCL_LIBRARY
comptime CCL_LIBRARY = _Global[StringSpan("CCL_LIBRARY"), _init_ccl_dylib]
NCCL_LIBRARY_PATHS
comptime NCCL_LIBRARY_PATHS = List(Path("libnccl.so"), Path("libnccl.so.2"), Path("/usr/lib/x86_64-linux-gnu/libnccl.so"), Path("/usr/lib/x86_64-linux-gnu/libnccl.so.2"), __list_literal__=NoneType(None))
ncclComm_t
comptime ncclComm_t = Optional[Pointer[NoneType, MutUntrackedOrigin]]
RCCL_LIBRARY_PATHS
comptime RCCL_LIBRARY_PATHS = List(Path("librccl.so"), Path("librccl.so.1"), Path("/opt/rocm/lib/librccl.so"), Path("/opt/rocm/lib/librccl.so.1"), __list_literal__=NoneType(None))
Structs
-
Communicators: Holds NCCL/RCCL communicator handles for a fixed set of GPUs. -
ncclDataType_t: Data-type selector for NCCL/RCCL collective calls. -
ncclRedOp_t: Reduction operation selector for NCCL/RCCL collective calls. -
ncclResult_t: Status code returned by NCCL/RCCL collective operations.
Functions
-
allgather: Performs an allgather across all GPUs via the vendor CCL library. -
allreduce: Per-GPU allreduce for use in multi-threaded contexts. -
broadcast: Per-GPU broadcast for use in multi-threaded contexts. -
group: Returns a context manager that groups NCCL/RCCL collective calls. -
init_comms: Pre-initialize NCCL/RCCL communicators. -
is_allgather_available: Reports whether the vendor CCL allgather symbol is loadable at runtime. -
is_allreduce_available: Reports whether the vendor CCL allreduce symbol is loadable at runtime. -
is_broadcast_available: Reports whether the vendor CCL broadcast symbol is loadable at runtime. -
ncclCommInitAll: Initializes NCCL/RCCL communicators for a set of GPUs. -
wait_for_comms: Spin-wait until communicators for ngpus have been initialized.