Group Operations
Free functions and helpers for batching NCCL operations into groups. See Group Calls for usage details.
group
- nccl.core.group() Generator[None, None, None]
Context manager for NCCL group operations.
Automatically calls
group_start()on entry andgroup_end()on exit, ensuring proper cleanup even if an exception occurs.Simulation mode is not supported here. To simulate, call
group_start()andgroup_end()directly and passsimulate=Truetogroup_end().
group_start
- nccl.core.group_start() None
Starts a group of NCCL operations.
All NCCL operations called after this will be batched together and executed when
group_end()is called. This can improve performance by allowing NCCL to optimize the operation sequence.
group_end
- nccl.core.group_end(*, simulate: Literal[False] = False) None
- nccl.core.group_end(*, simulate: Literal[True]) GroupSimInfo
- nccl.core.group_end(*, simulate: bool) GroupSimInfo | None
Ends a group of NCCL operations.
By default, executes all operations queued since the last
group_start(). Whensimulate=True, the queued operations are simulated instead of executed, and the estimated execution time is returned in aGroupSimInfo.- Parameters:
simulate – When True, simulates the group instead of executing it and returns a
GroupSimInfocarrying the estimated time. Defaults to False.- Returns:
Nonewhensimulate=False; aGroupSimInfowith the simulation result whensimulate=True.
GroupSimInfo
- class nccl.core.GroupSimInfo(estimated_time: float)
Bases:
objectResult of an NCCL group simulation.
Returned by
group_end()when called withsimulate=True.- estimated_time: float
Estimated execution time for the simulated group operations, in seconds.