Skip to content
inference.academy

glossary/scale/all-reduce

All-reduce

also allreduce, NCCL all-reduce, ring all-reduce

The collective that tensor parallelism runs twice per transformer layer: once after the attention output projection and once after the MLP down projection, so that each GPU's partial product of its weight shard becomes the full activation on every GPU. A ring implementation moves 2(N-1)/N of the tensor per GPU in 2N-2 steps; NVSwitch multicast does it in two. For decode the message is batch x hidden x 2 bytes, 16 KB at batch 1 on a 70B model, so the cost is the fixed latency of starting the collective, about 12.5 microseconds on NVSwitch, paid 160 times a token.


160 per token

All-reduces in one decode step of an 80-layer model under tensor parallelism; at 12.5 us each that is a 2 ms floor per token no matter how small the batch.


See it happen


Related