You run data-parallel training on N=8 GPUs for a model with P=1 billion parameters and fp16 gradients (2 bytes each). Using ring all-reduce, how many bytes does each GPU send per step, and how long does communication take at 100 GB/s per link?

ML system design, Distributed training
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can derive the communication volume of ring all-reduce, plug in realistic cluster numbers, explain its scaling with worker count N, and say how real training pipelines hide that cost.

Key idea

Ring all-reduce splits the G-byte gradient vector into N chunks and runs two phases around a logical ring of N GPUs (graphics processing units): reduce-scatter (each GPU ends up with one summed chunk) followed by all-gather (every GPU receives all N summed chunks). Each GPU sends 2N−1NG bytes in total, which approaches 2G as N grows rather than scaling with N.

Steps

  1. Compute the gradient buffer size G: with P=109 parameters in fp16 (16-bit floating point, 2 bytes each), G=2×109 bytes=2 GB (using decimal gigabytes, 1 GB=109 bytes, to match the 100 GB/s link speed).
  2. Derive reduce-scatter volume: arrange the N GPUs in a logical ring and partition each GPU's G-byte buffer into N equal chunks of G/N bytes. Over N−1 hops, each GPU sends one chunk clockwise and accumulates the incoming chunk, so after N−1 hops each GPU holds the full sum for one chunk, having sent (N−1)GN bytes.
  3. Derive all-gather volume: over N−1 more hops, each GPU forwards its completely summed chunk around the ring until every GPU holds all N summed chunks. This sends another (N−1)GN bytes, giving total bytes sent (and received) per GPU: Bsent=2 N−1N G.
  4. Plug in N=8, G=2 GB and link bandwidth 100 GB/s: Bsent=2×8−18×2 GB=1.75×2 GB=3.5 GB. Since all N GPUs transmit concurrently over their ring links (ignoring small startup latency), communication takes tcomm=3.5 GB100 GB/s=0.035 s=35 ms.
  5. Note scaling with N and practical overlap: as N increases, N−1N→1, so bandwidth-limited communication stays bounded by 2G (4 GB here) regardless of N. In practice, Distributed Data Parallel (DDP) overlaps gradient buckets with the backward pass (starting all-reduce on later layers while earlier layers still compute gradients), and gradient accumulation over k micro-batches reduces communication per micro-batch by k×.

Common mistakes

How long your answer should be

3–4 minutes; derive 2(N−1)/N × G, compute 3.5 GB and 35 ms, then mention N-scaling and overlap.

Read this

Previous in ML system design: What are data, tensor and pipeline parallelism in distributed training, and when should you use each?
Next in ML system design: Mixed-precision Adam requires 16 bytes per parameter (2 B fp16 weights, 2 B fp16 gradients, 4 B fp32 master weights, and 4 B each for Adam moments m and v). For a 7-billion-parameter model across N=8 GPUs, how much per-GPU memory do model states take under plain data parallelism and ZeRO stages 1, 2 and 3?