Free — no signup required

The All-Reduce Operation: Why Network Topology Determines Training Speed

2 min read

The Synchronized Dance of Distributed Training

Data Parallel training is the most common method for training large models. The process works like this:

  1. Copy the full model to every GPU across all servers (e.g., 1,000 GPUs).
  2. Each GPU receives a different mini-batch of training data.
  3. Each GPU independently computes a gradient — the direction and magnitude to adjust each model weight to reduce the loss.
  4. Because each GPU saw different data, each GPU computed slightly different gradients.
  5. Critical step: Before the next training iteration, all GPUs must agree on a single set of updated weights. They must average their gradients together.

This averaging step is called All-Reduce. It is a collective communication operation where every participant both sends and receives data from every other participant, and the result (the average) is delivered to all participants simultaneously.

Why All-Reduce Is a Cluster-Wide Bottleneck

With 1,000 GPUs, each holding a gradient tensor of several gigabytes, All-Reduce generates a massive, synchronized burst of network traffic. Every GPU sends to every other GPU at the same moment.

The critical property: All-Reduce is a synchronization barrier. No GPU can begin the next training step until every GPU has received the complete averaged gradient. The cluster's effective speed is determined by the slowest link in the network — not the average link.

This is why tail latency (the latency of the worst-performing packet or link) matters more than average latency in AI networks. A single congested switch port or a single dropped packet stalls the entire 1,000-GPU cluster.

Ring All-Reduce: The Efficient Algorithm

Naively sending every GPU's gradient to every other GPU would require O(N²) data transfers. The Ring All-Reduce algorithm is far more efficient:

  1. Arrange all GPUs in a logical ring.
  2. Each GPU sends a chunk of its gradient to its neighbor and receives a chunk from the other neighbor.
  3. After N-1 steps, every GPU has the complete averaged gradient.
  4. Total data transferred per GPU: 2 × (N-1)/N × gradient_size ≈ 2 × gradient_size (independent of N).

This means Ring All-Reduce scales efficiently to thousands of GPUs — the total data transferred per GPU stays roughly constant as you add more GPUs, as long as the network bandwidth scales proportionally.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free