Group API¶
Collecting several operations and executing them at the outermost LcclGroupEnd(). Semantics match NCCL group calls; see Groups.
LcclGroupEnd¶
Closes a group region and dispatches the batched operations.
1 | |
Returns — kLcclSuccess on success, error code otherwise. An aborted or watchdog-killed kernel is reported here.
A no-op except at the outermost nesting level, where it plans, launches and waits, so the batch is complete on return. This describes blocking communicators: with nonblocking communicators, LcclGroupEnd may instead return kLcclInProgress immediately without waiting (when the group still has comms waiting to connect or async jobs), and completion is then observed via LcclCommGetAsyncError. One plan carries one kernel, so a batch spanning several kernels (or dtypes, or P2P batches) runs as several plans back to back.
LcclGroupStart¶
Opens a group region; collective calls within are collected and executed at the outermost LcclGroupEnd().
1 | |
Returns — kLcclSuccess on success, error code otherwise.
Warning
A group means "these are independent", not "run these in order". Collective tasks are sorted by transfer size and scheduled ahead of P2P, so they generally do not execute in the order they were called in. Buffers must therefore not alias across operations in one group - undefined, and undetected. When B needs A's result, put them in separate groups; consecutive groups are ordered.
The resulting order is a deterministic function of the whole call sequence, not of the batch's contents alone, so every rank must issue the same operations with the same sizes in the same order. Ranks that disagree derive different orders and mismatch. P2P is stricter still: per peer and direction LcclSend / LcclRecv keep their call order, because they are paired positionally against the peer's queue.
Groups nest; only the outermost LcclGroupEnd dispatches. That keeps nesting transparent, so LcclAllToAll's internal per-peer fan-out joins the caller's batch instead of flushing.