IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo struct

Communicators

struct Communicators

Holds NCCL/RCCL communicator handles for a fixed set of GPUs.

Stores one ncclComm_t handle per GPU (up to MAX_GPUS). Instances are initialized lazily by _get_global_comms and cached process-wide; call init_comms() from a single thread before using multi-threaded collectives to avoid the check-then-create race in _get_global_comms.

Fields​

  • ​ngpus (Int): The number of GPUs participating in the communicator group.
  • ​comms (Array[Optional[Pointer[NoneType, MutUntrackedOrigin, _safe=False]], Int(8)]): Per-GPU communicator handles, valid for indices 0..ngpus-1.

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable

Methods​

__init__​

def __init__(out self, *, copy: Self)

Was this page helpful?