179 questions
No questions match those filters.
What are the actual collective-communication primitives...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansDistributed data-parallel training needs every GPU’s locally computed gradients combined into one agreed-upon gradient before any optimizer step, and that combination happens through a small set of named collective operations, not ad hoc point-to-point messaging.
All-reduce combines a value (typically summing, then usually dividing by world size for the mean) across every device and leaves the identical result on every device — this is the one that actually synchronizes gradients in standard data parallelism. Reduce-scatter performs the same reduction but only gives each device a distinct slice of the combined result rather than the whole thing; all-gather is its inverse, taking distinct slices held on each device and concatenating a full copy onto every device.
Ring all-reduce implements all-reduce efficiently by decomposing it into a reduce-scatter followed by an all-gather around a logical ring topology: each of N devices sends its data to one neighbor and receives from another simultaneously, in N-1 steps, so that by the end every device has contributed to and received the full reduced result. The reason this specific construction matters is bandwidth: naive approaches route through a single aggregator (a parameter server), whose network link becomes the bottleneck and scales badly as you add GPUs. Ring all-reduce’s total data moved per device is independent of the number of devices in the ring — only the number of communication steps scales with N, and each step moves a fixed, small slice — so it uses every link’s bandwidth close to optimally and scales far better as cluster size grows. That’s exactly why it’s the default collective underlying frameworks like NCCL, and why understanding it is what lets you reason about why doubling GPU count doesn’t double training throughput once communication, not compute, becomes the bottleneck.