Distributed primitives#
Low-level communication primitives used internally by the distributed layers. They are documented here so that advanced users can build custom distributed operators on top of the same infrastructure.
All primitives are autograd-compatible: each one defines both a forward and backward communication pattern so that gradients flow correctly through distributed computations.
Transpose (all-to-all)#
All-to-all transpose across the azimuth process group. |
|
All-to-all transpose across the polar process group. |
Copy / Reduce#
Identity in the forward pass; all-reduce across polar ranks in the backward pass. |
|
Identity in the forward pass; all-reduce across azimuth ranks in the backward pass. |
|
All-reduce across polar ranks in the forward pass; identity in the backward pass. |
|
All-reduce across azimuth ranks in the forward pass; identity in the backward pass. |
Scatter / Gather#
Split |
|
All-gather along |
|
All-gather along |
|
Fused reduce-scatter across polar ranks along |
|
Fused reduce-scatter across azimuth ranks along |
Halo exchange#
Exchange |
|
Return the |
Tensor reshaping#
Collapse all but the trailing |
|
Inverse of |