Configuration
Configuration objects passed to communicator creation methods, plus the flag enums they consume.
NCCLConfig
Used by Communicator.init(), Communicator.initialize(),
Communicator.split(), Communicator.shrink(), and
Communicator.grow(). Fields left unset (None) remain at NCCL’s
internal default; values are validated by the C library when the config is
consumed.
- class nccl.core.NCCLConfig(*, blocking: bool | None = None, cga_cluster_size: int | None = None, min_ctas: int | None = None, max_ctas: int | None = None, net_name: str | None = None, split_share: bool | None = None, traffic_class: int | None = None, comm_name: str | None = None, collnet_enable: bool | None = None, cta_policy: CTAPolicy | None = None, shrink_share: bool | None = None, nvls_ctas: int | None = None, n_channels_per_net_peer: int | None = None, nvlink_centric_sched: bool | None = None, graph_usage_mode: int | None = None, num_rma_ctx: int | None = None, max_p2p_peers: int | None = None, graph_stream_ordering: int | None = None)
Bases:
LowppSpecNCCL configuration for communicator initialization.
Provides configuration options for NCCL communicators, allowing fine-tuning of performance and behavior characteristics. Fields not set in the constructor remain at NCCL’s internal default; values are validated by the C library when the config is consumed.
See also
ncclConfig_tfor the description of each field.- blocking: bool | None = None
- cga_cluster_size: int | None = None
- collnet_enable: bool | None = None
- comm_name: str | None = None
- graph_stream_ordering: int | None = None
- graph_usage_mode: int | None = None
- max_ctas: int | None = None
- max_p2p_peers: int | None = None
- min_ctas: int | None = None
- n_channels_per_net_peer: int | None = None
- net_name: str | None = None
- num_rma_ctx: int | None = None
- nvlink_centric_sched: bool | None = None
- nvls_ctas: int | None = None
- traffic_class: int | None = None
CTAPolicy
- class nccl.core.CTAPolicy(*values)
Bases:
IntFlagNCCL performance policy for CTA scheduling, used by
NCCLConfig.cta_policy.- DEFAULT = 0
- EFFICIENCY = 1
- ZERO = 2
NCCLDevCommRequirements
Used by Communicator.create_dev_comm(). Fields left unset
(None) remain at NCCL’s internal default.
- class nccl.core.NCCLDevCommRequirements(*, lsa_multimem: bool | None = None, barrier_count: int | None = None, lsa_barrier_count: int | None = None, rail_gin_barrier_count: int | None = None, lsa_ll_a2a_block_count: int | None = None, lsa_ll_a2a_slot_count: int | None = None, gin_force_enable: bool | None = None, gin_context_count: int | None = None, gin_signal_count: int | None = None, gin_counter_count: int | None = None, gin_connection_type: NcclGinConnectionType | None = None, gin_exclusive_contexts: bool | None = None, gin_queue_depth: int | None = None, gin_traffic_class: int | None = None, world_gin_barrier_count: int | None = None, gin_strong_signals_required: bool | None = None, gin_va_signals_required: bool | None = None, teams: tuple[TeamRequirement, ...] = (), resources: tuple[LsaBarrierRequirement | GinBarrierRequirement | LLA2ARequirement, ...] = ())
Bases:
LowppSpecNCCL device communicator requirements configuration.
This is a reusable high-level Python request consumed by
Communicator.create_dev_comm(). Per-team requirements are declared through theteamstuple. Each call snapshots the request into independent low-levelncclDevCommRequirements_tand linkedncclTeamRequirements_tstorage, including separate multimem output handles. NCCL copies the requirements and linked-list nodes before the call returns; the resultingDevCommResourceretains the storage referenced by eachoutMultimemHandle. This object may therefore be changed between calls without affecting device communicators that were already created. Do not mutate it concurrently withCommunicator.create_dev_comm().See also
ncclDevCommRequirementsfor the description of each field.- barrier_count: int | None = None
- gin_connection_type: NcclGinConnectionType | None = None
- gin_context_count: int | None = None
- gin_counter_count: int | None = None
- gin_exclusive_contexts: bool | None = None
- gin_force_enable: bool | None = None
- gin_queue_depth: int | None = None
- gin_signal_count: int | None = None
- gin_strong_signals_required: bool | None = None
- gin_traffic_class: int | None = None
- gin_va_signals_required: bool | None = None
- lsa_barrier_count: int | None = None
- lsa_ll_a2a_block_count: int | None = None
- lsa_ll_a2a_slot_count: int | None = None
- lsa_multimem: bool | None = None
- rail_gin_barrier_count: int | None = None
- resources: tuple[LsaBarrierRequirement | GinBarrierRequirement | LLA2ARequirement, ...] = ()
- teams: tuple[TeamRequirement, ...] = ()
- world_gin_barrier_count: int | None = None
Requirement entries
The element types of NCCLDevCommRequirements.teams and
NCCLDevCommRequirements.resources.
TeamRequirement
- class nccl.core.TeamRequirement(team: NCCLTeam, multimem: bool = False)
Bases:
objectA per-team requirement for device communicator creation.
Pass a tuple of these as
NCCLDevCommRequirements.teams. Whenmultimemis True, NCCL allocates a multicast handle for the team, retrievable afterwards viamultimem_handle().- multimem: bool = False
LsaBarrierRequirement
- class nccl.core.LsaBarrierRequirement(team: NCCLTeam, n_barriers: int)
Bases:
objectRequests an LSA barrier resource on
teamwithn_barriersbarriers.Add to
NCCLDevCommRequirements.resources; the finalizedLsaBarrierHandleis returned inresource_handles.- n_barriers: int
GinBarrierRequirement
- class nccl.core.GinBarrierRequirement(team: NCCLTeam, n_barriers: int)
Bases:
objectRequests a GIN barrier resource on
teamwithn_barriersbarriers.Add to
NCCLDevCommRequirements.resources; the finalizedGinBarrierHandleis returned inresource_handles.- n_barriers: int
LLA2ARequirement
- class nccl.core.LLA2ARequirement(n_blocks: int, max_elements: int, max_element_size: int)
Bases:
objectRequests a low-latency all-to-all resource with
n_blocksblocks, sized to hold up tomax_elementselements of at mostmax_element_sizebytes each.Add to
NCCLDevCommRequirements.resources; the finalizedLLA2AHandleis returned inresource_handles.- n_blocks: int
- max_elements: int
- max_element_size: int