DiLoCoX

A 107-billion-parameter model trained over a plain 1 Gbps link ran 357 times faster than the textbook method. Pick a model and a training time. See how many tokens each method gets through.

Learn how to train a huge model on server rooms that sit far apart and talk over a slow wire, and why the trick is to talk less, talk while working, and talk in a smaller language.

Press Qwen1.5-107B, then drag the hours. Watch the all-reduce bar stay a sliver. Then we build, piece by piece, the four ideas underneath: local steps, pipeline stages, overlapped talking and squeezed messages.

You need a rough idea of what a neural network is and that training means nudging its weights. We build the rest from zero.

Based on DiLoCoX: A Low-Communication Large-Scale Training Framework for Decentralized Cluster (arXiv 2506.21263, June 2025) by Ji Qi, WenPeng Zhu, Li Li, Ming Wu, YingJun Wu, Wu He, Xun Gao, Jason Zeng and Michael Heinrich, of China Mobile (Suzhou) Software Technology and Zero Gravity Labs. Re-taught here in our own words and devices. It is a reading of the DiLoCo lesson and of the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands by Rohan Anil.

Race over a 1 Gbps link

6

The throughputs are the paper’s (Figure 4 and Section 4.2.2), measured with the link limited to 1 Gbps: OPT-1.3B 745, 16,161 and 23,880 tokens per second; Qwen1.5-107B 10.4, 2,427 and 3,728. Tokens in the window and days for one billion tokens are our arithmetic on those rates, not runs. The paper gives no OpenDiLoCo rate at 1.3B in text.

Chapter 0

The Wall at One Gigabit

See why a slow wire between server rooms leaves the world’s GPUs idle, and measure exactly how long one sync takes

Picture three server rooms in three cities. Each room holds a rack of GPUs, and inside a room the GPUs talk to each other fast. Between the rooms there is one cable, about as quick as a good home internet plan. You own all three rooms. You want them to train one very large model together.

The paper calls this a decentralized cluster: several groups of GPUs, each group fast inside and slow to the others. The Core Automation post, The Hitchhiker’s Guide to Training on Compute Islands, calls the groups islands. Same picture. This lesson teaches one paper about that picture, DiLoCoX, which trained a 107-billion-parameter model across such a link.

Four words you need first

Bandwidth is how much data a wire carries each second. Think of the width of a pipe. We write it in Gbps, gigabits per second. A bit is one 0 or 1. Eight bits make a byte. So 1 Gbps is 125 million bytes per second, or 125 MB/s. The paper says decentralized clusters often have “hundreds of Mbps to 1 Gbps” between them.

A parameter is one number inside the model, one weight. A model with 100 billion parameters stored as FP32 (a number that takes 4 bytes) is 400 GB. That is what one full copy of the model weighs: far more than one GPU holds, and a long download even on a fast link.

A gradient is the list of nudges that training wants to apply to each parameter. It has one entry per parameter, so it weighs as much as the model. Training repeats a cycle: read some text, compute the gradient, nudge the weights.

An all-reduce is a group chore. Every worker holds a list of numbers. After the all-reduce, every worker holds the same list: the average of all of them. In plain data-parallel training, the workers do this to their gradients after every single step. Chapter 1 shows why that is the problem.

How big is one sync?

The paper does this sum in Section 2.4.1. Use the ring all-reduce: the clusters sit in a circle, and each passes pieces of its list to its neighbour. With C clusters and a list of size S, the data that crosses the links is 2 × (C − 1) × S / C. The 2 is because the ring needs a pass to add up and a pass to hand the result back.

Take the paper’s numbers: 100 billion parameters, FP32, three clusters, 1 Gbps between them. The list is S = 400 GB. The traffic is 2 × 2 × 400 / 3 = 533.3 GB. At 125 MB/s that is 4,266 seconds, which is 1.18 hours, for one sync.

Now ask what the GPUs do meanwhile. The paper lets the clusters train H = 500 local steps between syncs, at one second per step. That is 500 seconds of work. Then they wait 4,266 seconds for the wire. The GPUs work about 10.5% of the time. The paper says the idle time is “approximately 1.04 hours”; our arithmetic gives 1.05 hours, and the gap is rounding.

Try your own numbers below. Drag the model size down, the bandwidth up, or switch to smaller numbers, and watch the wire bar shrink.

Time one sync

The blue bar is local training between syncs. The warm bar is sending the average over the wire. The last bar shows one full cycle: blue is work, grey is GPUs waiting. The defaults are the paper’s example.

100
3
1.0
500

Formula and defaults are the paper’s (Section 2.4.1): ring all-reduce traffic 2(C−1)/C of the list, 100B parameters, FP32, three clusters, 1 Gbps, H = 500, one second per local step. The seconds-per-step is the paper’s assumption, not a measurement. FP16 and Int4 rows are our arithmetic.

Two ways out appear on the sliders. Raise H and the blue bar grows, so the wire is a smaller share. Cut the bytes (switch to Int4) and the warm bar shrinks eight-fold. Both are real ideas in the paper. A third trick, doing the sync while the GPUs keep working, needs a bar the device cannot show yet. Chapter 4 adds it.

The paper states the target in one sentence: for models above 100B the team needs to “compress more than 10x” so that communication time stays reasonable. The rest of the paper is the recipe for that.

The claim, as a trade

DiLoCoX trains a 107B model over 1 Gbps at 3,728 tokens per second where plain all-reduce reached 10.4, because it syncs rarely, syncs while it trains, and syncs a squeezed message. That is a 357-times speedup by the paper’s count (Chapter 8 checks the arithmetic). The price is a higher training loss: 4.20 against 3.90 after 4,000 steps.

The road

  1. Local steps and pseudo-gradients: train alone for H steps, then average the change.
  2. Why earlier methods fall short: out of memory, idle GPUs, over-squeezed messages.
  3. Pipeline stages with two optimizers: cut the model so every GPU holds a slice.
  4. One-step-delay overlap: send last round’s change while training this round.
  5. Squeezing the message: low rank plus four-bit numbers.
  6. Adapting the squeeze: lower the rank as training settles.
  7. The convergence bound: what the theory says, and what it does not.
  8. What the tables show: throughput, loss and the ablation.
  9. Field guide: numbers, terms, code, and where to read next.

For the background on all-reduce and why training sits on fast links, see distributed training and data parallel and all-reduce. For the arithmetic of links, see bandwidth arithmetic.

A ring of three clusters syncs a 400 GB list over 1 Gbps. Which number is closest to the data that crosses each link?

Chapter 1

Train Alone, Then Compare Notes

Learn local SGD, the pseudo-gradient and the two optimizers that DiLoCo uses, and see the price of talking less

Two teams of students prepare for the same exam. Plan A: after every single practice question they stop and agree on the best way to study. Plan B: each team works through fifty questions alone, then they meet once and merge what they learned. Plan B wastes far less time in meetings. Its risk is that the teams drift apart in the fifty questions.

That is the whole idea of local SGD. SGD is stochastic gradient descent: look at a small batch of text, compute which way each weight should move, and move it a little. In ordinary data-parallel training, many workers each take a batch and all-reduce their gradients after every step. Local SGD lets each worker take H steps alone before any talking.

The pseudo-gradient

After H local steps, worker i has moved its weights from the starting point θt−1 to a new place θt(i). Subtract to get the total move. The paper calls this the pseudo-gradient (Section 2.2):

δt(i)
The pseudo-gradient of worker i in round t. It points the way the worker did not go, like a gradient, so we subtract it later.
θt−1
The shared weights at the start of the round. Every worker begins here. It is a list of d numbers.
θt(i)
Worker i’s weights after H local steps. Same shape as the start.

It is “pseudo” because no one computed it from one batch. It sums H real gradients, passed through the optimizer. But it plays the role of a gradient: one list of d numbers that says where to go. The workers average the lists:

Δt
The average pseudo-gradient. This is the only thing that crosses the slow wire, once per H steps.
D
The number of workers that average (the data-parallel degree).

Two optimizers

DiLoCo (Douillard et al., 2023) uses two. The inner optimizer runs on each worker for the H local steps. It is AdamW, the usual choice for language models. The outer optimizer runs once per round on the averaged pseudo-gradient. DiLoCo makes it Nesterov momentum: keep a running velocity v of past averages, and look slightly ahead when stepping.

A worked example with one weight. The start is 1.0. Cluster A ends at 0.7, cluster B at 0.5. So δA = 0.3, δB = 0.5, and Δ = 0.4. A plain outer step with rate 1 gives 1.0 − 0.4 = 0.6: pure weight averaging. With Nesterov (rate 0.7, momentum 0.9, both illustrative), the velocity is v = 0.4, and the step is 0.7 × (0.4 + 0.9 × 0.4) = 0.532. The new weight is 0.468. The outer step can overshoot the average, on purpose, because the same direction is likely to keep paying off.

The paper credits this recipe: DiLoCo trained models up to 400M parameters with data parallelism only and matched or beat fully synchronous training. OpenDiLoCo (Jaghouar et al., 2024) re-implemented it openly and reached 1.1B parameters with FP16 gradient compression over links of hundreds of Mbps. See the DiLoCo lesson, the DiLoCo paper lesson and the OpenDiLoCo lesson for the full story, and local SGD and model averaging for the background.

Now see the price. The toy below has two clusters with different data. Cluster A cares most about the x weight; cluster B cares most about y. Each runs plain gradient steps, then they average. The green star is the best shared answer.

Merge after H steps

Grey lines are the local walks. Blue dots are the shared weights after each merge. Each cluster gets 200 steps in total. Drag H up and watch the dots take fewer, longer jumps.

20

A toy of ours, not the paper’s experiment. Cluster A: curvature (2, 0.2), best point (1, 0). Cluster B: curvature (0.2, 2), best point (0, 1). Inner step: plain gradient descent, rate 0.1 (the paper uses AdamW). Start at (−0.1, −0.1). The best shared point is (0.909, 0.909). Nesterov rate and momentum are illustrative.

At H = 1 the clusters agree after every step and walk straight to the star. At H = 100 each cluster mostly reaches its own best point before the merge, and the average of two private optima is not the shared optimum. This drift is the cost of talking less. Every method in this lesson is a way to keep H large without paying too much for it.

Why does the outer optimizer act on the averaged pseudo-gradient instead of the weights directly?

Chapter 2

Why the Earlier Methods Fall Short

Find the three walls that DiLoCo, OpenDiLoCo and CocktailSGD hit at 100 billion parameters, and count the memory behind the first

You have a recipe that works at 1 billion parameters. You scale it to 100 billion and it breaks in three places at once. The paper names the three walls in its introduction. Each wall gets one chapter of the method, so it pays to meet them now.

Wall 1: the model does not fit on one GPU

A GPU is the chip that does the arithmetic. Its working memory is called VRAM. The paper’s GPUs are NVIDIA A800s with 40 GB of VRAM each.

DiLoCo and OpenDiLoCo use data parallelism only. In data parallelism every worker holds a whole copy of the model, plus the memory the inner optimizer needs. The paper says it directly: they “do not support FSDP or DeepSpeed, thus the VRAM of GPU capacity limits the scale of model parameters.” FSDP and DeepSpeed are tools that split model state across GPUs.

There is a second problem. In OpenDiLoCo the first worker on each node also holds the outer optimizer’s state. That worker needs more memory than its neighbours. The paper calls this “unbalanced VRAM usage.” One overloaded GPU decides the maximum model size.

How much memory is a model, really? Here is the standard count for training with AdamW in mixed precision (this accounting is common practice, not a table from the paper). Per parameter: 2 bytes for the FP16 weight, 2 for its gradient, 4 for an FP32 master copy, and 4 + 4 for Adam’s two running averages. That is 16 bytes. For 107 billion parameters: 1,712 GB. The outer optimizer adds an FP32 copy of the starting weights (4 bytes) and a momentum list (4 bytes). That is 8 more: 856 GB. And all this ignores the activations that backpropagation must remember.

Try it. The device compares what one GPU must hold under the two designs.

Does it fit in 40 GB?

Top bars: data parallel only. Bottom bar: the model cut into M pipeline stages (Chapter 3). The dashed line is one 40 GB A800. Drag M and find the smallest value that fits.

40

Illustrative accounting for the paper’s 107B model: 16 bytes per parameter for weights, gradients and AdamW state in mixed precision, plus 8 for the outer copy and momentum. It leaves out activations and buffers. The paper reports only that OpenDiLoCo ran out of memory (Section 4.2.1) and that its own run fit; it does not state its number of stages.

Even with perfect splitting the sums are tight, which is why the paper reduced Qwen1.5-107B from 80 layers to 78 “for GPU memory optimization.” The takeaway: a model this big must be cut across GPUs, and the outer optimizer must be cut too.

Wall 2: the GPUs sit idle during the sync

DiLoCo and OpenDiLoCo are synchronous. All workers stop, send their pseudo-gradients, wait for the average, then continue. Chapter 0 measured it: at 100B the stop lasts 1.18 hours against 500 seconds of work. Your expensive GPUs wait.

Wall 3: squeezing too hard breaks training

CocktailSGD (Wang et al., 2023) goes the other way. It compresses every gradient hard, up to 117 times, by mixing three tricks: random sparsification, top-k sparsification and quantization. It does use pipeline parallelism and reached 20B parameters, but only for fine-tuning, and it takes no local steps. The paper warns: aggressive compression “leads to significant differences between the parameters of the local model and the global model, resulting in a degradation of the convergence.”

The paper also gives the opposite problem for DiLoCo-style methods. In the OPT-1.3B run OpenDiLoCo uses H = 500, and the paper blames its poor loss on “excessively large H” causing “gradient staleness.” Too few syncs and the workers drift (Chapter 1’s toy). Too much squeeze and the sync itself is wrong. DiLoCoX must balance the two.

The comparison

MethodLargest scale namedParallelismLocal stepsCompressionIdle during sync
DiLoCo400M parametersData onlyYesNone namedYes
OpenDiLoCo1.1B parametersData onlyYesFP16 gradientsYes
CocktailSGD20B (fine-tuning)Pipeline + dataNoUp to 117x, three tricksNot stated
DiLoCoX107B (pretraining)Pipeline + dataYesLow rank + Int4, adaptiveNo, overlapped

Read the table as a to-do list. DiLoCoX takes local steps from DiLoCo, pipeline stages from the 3D-parallel playbook (Narayanan et al., 2021), compression from CocktailSGD’s spirit, and adds two new parts: the dual optimizer layout and the overlap. For the other two papers see DistBelief and QSGD. For parallelism basics see the parallelism zoo and pipeline and FSDP.

The core post puts DiLoCoX in a similar place. It lists it as a “systems experiment” that is “useful at large parameter count, with a measurable quality gap.” Hold that sentence in mind through Chapter 8.

Which wall does pipeline parallelism with a split outer optimizer address?

Chapter 3

Pipeline Stages With Two Optimizers

Cut the model into slices, give every worker one slice and a share of both optimizers, and follow one round of the dual optimizer policy

Imagine a car factory with a hundred stations in a row. No single worker could hold all the tools. So each worker takes one station, and the car moves down the line. A language model is also a stack of layers. You can give each worker a few layers and pass the data down the line.

That is pipeline parallelism. Cut the model by layers into M stages. Stage 1 runs the first layers and passes its output to stage 2, and so on. What travels between stages is the activation: for a batch it is a tensor of shape [batch, tokens, hidden], the same size at every cut. In the backward pass the matching gradient flows back up the line. The paper picks pipeline parallelism because it “has the least communication volume among parallel methods in the 3D parallel strategy.” Inside a fast cluster that traffic is cheap.

The layout: N = M × D

Take N workers in all. Arrange them in a grid of M stages and D data-parallel groups (D copies of the whole pipeline). Worker (i, j) is stage j of copy i. It holds three things (Section 2.2):

  1. A slice of the parameters: the layers of stage j, about d/M numbers, where d is the whole model.
  2. A slice of the inner optimizer state for those layers (AdamW’s running averages).
  3. A slice of the outer optimizer state for the same layers (the velocity of the Nesterov step, and the saved start of the round).

This is the dual optimizer policy. Compare it with OpenDiLoCo. There the first worker on a node held the complete outer optimizer, so memory was lopsided. Here the outer optimizer is cut along the same lines as the model, so each worker carries an equal share. The paper says this brings “a more balanced utilization of VRAM.”

One round, in five moves

Follow the algorithm for round t. Everything below happens per worker, on its own slice.

  1. Start. The worker saves a copy of its slice as the round’s starting point θt−1.
  2. H inner steps. It trains. Activations flow down the pipeline inside its cluster. The inner optimizer updates the slice after each step. No data crosses between clusters.
  3. Pseudo-gradient. It subtracts: δ = start − now. Shape: the same as the slice, about d/M numbers.
  4. Average. It averages δ with the workers that hold the same stage in other copies: one all-reduce per stage, over the slow link. A stage-3 worker never talks to a stage-5 worker here.
  5. Outer step. Its slice of the outer optimizer takes one step with the average and writes the new starting point.

Two clusters, four stages. Step through a round below.

Step one round

Each column is a cluster. Each box is one worker holding one stage. Pick a move to light it up, then change the number of stages.

4

A toy layout of ours (two clusters, M stages), in the spirit of the paper’s Figure 1, which shows 32 workers in 2 clusters with PP = 8 and DP = 2. Sizes use the Chapter 0 example (100B parameters, FP32). Whether each worker has its own 1 Gbps link is our reading of the setup; the paper says only that inter-worker bandwidth is limited to 1 Gbps for data parallelism.

Now count what the slow link carries. With D = 2 copies the ring volume is 2(D−1)/D = 1 times the slice. A slice is 100B / M parameters. At M = 4 that is 25B parameters, 100 GB in FP32, per stage ring. Cutting the model into more stages makes each ring smaller, because each worker only sends its own slice. The total is the same, but it is split across more rings that can run side by side.

Two rules are easy to miss. First, pipeline traffic stays inside a cluster; only the average crosses the slow wire. Second, the inner and outer optimizers never need the whole model in one place. The code of Chapter 9 shows this as a plain loop over j.

For more on pipelines and sharding see pipeline and FSDP and distributed training for small devices. For swarm-style pipelines across unreliable machines, see SWARM parallelism.

In the dual optimizer policy, who averages pseudo-gradients with the worker that holds stage 3 of copy 1?

Chapter 4

Talk While You Work

Hide the sync behind the next round of training by applying each average one round late, and see exactly when the hiding works

A chef finishes a dish and has to wait for the delivery driver before starting the next. The driver takes twenty minutes. The kitchen stands still for twenty minutes, every dish. Now a smarter chef starts the next dish at once and lets the driver collect the last dish while the new one cooks. The kitchen never stops. The only cost: the driver always runs one dish behind.

That is the one-step-delay overlap of communication and local training (Section 2.3). In DiLoCo and OpenDiLoCo the GPUs stop during the pseudo-gradient sync. The paper writes that “during the synchronization process, the computing resources are in idle state.” DiLoCoX does not stop.

The schedule

The paper gives three steps. Let a round be H local steps.

  1. End of round 1. Compute the pseudo-gradient δ1. Start averaging it in the background. Do not wait. Start round 2 at once.
  2. During round 2. The background all-reduce works on δ1 while the GPUs train.
  3. End of round 2. Compute δ2 and start averaging it. Now apply the outer step using the finished average of round 1, Δ1.

In symbols the paper writes the update as:

θ(t)
The shared weights after outer step t.
θ(t−1)
The shared weights one outer step earlier.
Δ(t−1)
The averaged pseudo-gradient from the previous round. This is the delay: the newest average is always one round old.

The paper’s bet: “the pseudo-gradients will not change significantly between two consecutive outer steps.” If that holds, a one-round-old average is almost as good as a fresh one. The word for the gap is staleness. The paper does not prove the bet in this section. It tests it with the ablation of Chapter 8.

When does hiding work?

Let Tc be the time of one round of training, H × (seconds per step). Let Tm be the time of one sync. Without overlap, a cycle lasts Tc + Tm. With overlap, the two run side by side, so a cycle lasts the longer of them, max(Tc, Tm).

Use Chapter 0’s numbers. Tc = 500 s and Tm = 4,266 s. Without overlap: 4,766 s per cycle, GPUs busy 10.5%. With overlap: 4,266 s, busy 11.7%. The overlap barely helps. The wire is still the boss.

Now squeeze the message 16 times (Chapter 5). Tm = 267 s. Without overlap: 767 s per cycle, busy 65%. With overlap: max(500, 267) = 500 s, busy 100%. The sync disappears behind the work. Overlap does its job only after compression brings Tm under Tc. The two ideas need each other. Try it:

Overlap the wire

Top lane: the GPUs. Bottom lane: the wire. Blue is training, warm is sending, grey is waiting. Turn overlap on, then raise the compression until the grey disappears.

4x
500

Chapter 0’s example: 100B parameters, FP32, three clusters, 1 Gbps, one second per step, so an uncompressed sync takes 4,266 s. The compression multiplier divides that time. The max() and the sum are the schedule from Section 2.3; this model ignores the cost of the outer step itself and the first round, which has nothing to apply.

Symptom, measurement, fix

The symptom of a bad overlap is a loss curve that lags or wobbles, because every update uses an old average. The measurement is Table 1 on the 107B model. With overlap the loss is 4.20. Without it, 4.15. Throughput rises from 2,197 to 3,728 tokens per second: 1.70 times, for a loss that is 0.05 higher. The fix if staleness hurts is not to drop the overlap but to keep the sync short enough that one round of delay is all you ever pay, which is what the compression of the next two chapters is for.

One more detail from Algorithm 2: the update step is guarded by “if t > 1.” Round 1 has no earlier average, so it applies nothing and only sends. Compare the same idea in post-local SGD and in the DiLoCo lesson.

Training rounds take 500 s and a sync takes 267 s. How long is one cycle with one-step-delay overlap, and what does the overlap cost?

Chapter 5

Squeeze the Message

Compare four ways to shrink a pseudo-gradient, learn why only two survive an all-reduce, and combine low rank with four-bit numbers

You must send a photo over a weak signal. You can shrink it two ways. Lower the resolution: fewer pixels, but each pixel exact. Or keep every pixel and use fewer colours. Either way the picture gets smaller and a little worse. Compression is a deal between size and damage.

The message here is the pseudo-gradient, and Chapter 4 showed that it must shrink by 10 times or more. The paper (Section 2.4) first reviews four tools: random sparsification, top-k, quantization and low rank. Then it asks one extra question that decides the winner: can the compressed messages be added up by an all-reduce?

Why all-reduce compatibility matters

An all-reduce adds the workers’ lists position by position. It only works if every list has the same layout, so that position 7 means the same weight everywhere. Any compression that keeps a common layout can ride on all-reduce, which is the cheapest way to average. Any that does not needs a detour.

  1. Random sparsification. Keep a random subset of entries. Workers share a seed, so everyone picks the same positions, and sending the seed is enough. Layout matches, so it is compatible. The cost: it throws away large entries as readily as small ones, so for the same sparsity it adds more error.
  2. Top-k. Keep the k entries with the largest size. Less error, but each worker picks different positions. The layouts disagree, so the lists need index numbers. The paper counts K · log2 d bits for an index list, or d bits for a bitmap, and says top-k “is not AllReduce compatible and requires a parameter server and double compression.”
  3. Quantization. Store each number in fewer bits. Compatible and cheap. But from FP16 the best you can reach is 16 times, and the paper warns that “a linear decrease in the number of bits… often results in an exponential increase in error.”
  4. Low rank. Treat each weight matrix as a sum of a few simple patterns. Compatible, and it can reach high ratios (Vogels et al., 2020; see PowerSGD).

A worked example shows the top-k tax. A model piece has d = 230 numbers. Keep 1% as FP16 values (16 bits each). Each kept value also needs a 30-bit index. Cost per kept entry: 46 bits. Against 16 bits per entry for the full list, the ratio is 16 / (0.01 × 46) = 34.8 times, not the 100 times the sparsity suggests. (This example is ours.)

Low rank, in plain words

A weight matrix W has m rows and n columns, so mn numbers. Its rank says how many independent patterns it contains. A matrix with rank r can be written as a product of two thin matrices: P with shape [m, r] and Q with shape [n, r], so that W ≈ P QT. You send P and Q, which is r(m + n) numbers instead of mn.

Take m = n = 8,192 (an assumed hidden size, for illustration). Full: 67.1 million numbers. Rank 2,048: 2,048 × 16,384 = 33.6 million. That is 2 times smaller, which matches the paper’s remark that r1 = 2,048 is “approximately 2x compression.”

Algorithm 1: low rank, then quantize

DiLoCoX chains the two compatible tools: C[δ] = QUANTIZE(LOWRANK(δ, r), q). The inputs are a pseudo-gradient δ, a rank r and a bit count q. The output is the compressed pseudo-gradient. Try the two knobs on a small matrix. The left square is the true matrix. The right square is what the receiver rebuilds.

Squeeze a matrix

Warm cells are positive, blue cells negative. Slide the rank down and the picture blurs into fewer patterns. Pick fewer bits and the cells snap to a few levels.

4

A toy of ours: a seeded 32×32 matrix built from twelve patterns of falling strength plus small noise, factored by power iteration and quantized with one scale per factor. Real pseudo-gradients are huge and their spectrum is not this tidy. Sizes compare against the same matrix in FP16. The paper’s Algorithm 1 is the same two steps; its Int4 and rank values are in the text below.

The ratio the paper reports

On Qwen1.5-107B the paper uses r1 = 2,048 (about 2 times), Int4 and H1 = 125. Int4 against FP16 is 4 times. So the message is 2 × 4 = 8 times smaller, and it is sent 125 times less often: 8 × 125 = 1,000. That matches the stated “communication compression ratio of all algorithms is set to 1,000x.” On OPT-1.3B there is no low rank: Int4 (4 times) with H = 125 gives 500, and the paper says 500x. Both fit a baseline of FP16 all-reduce on every step; the paper does not spell the baseline out, so this is our reading.

Error feedback: do not lose what you drop

Compression throws information away. If it is thrown away for good, small errors add up round after round. The cure is error feedback: keep a buffer e of what the shared message failed to carry, and add it to the next pseudo-gradient. Algorithm 2 sets δt = (θt−1 − θt) + et and then e ← δt−1 − Δt−1.

With one number: the worker’s true change is 0.50. The shared compressed average that came back is 0.42. The buffer keeps 0.08. Next round the worker adds 0.08 to its new change, so the missing part gets another chance to travel.

See also communication compression, QSGD and Deep Gradient Compression for the rest of the family.

Why is top-k sparsification a poor fit for an all-reduce?

Chapter 6

Squeeze Harder as Training Settles

Follow the adaptive rule that lowers the rank as training settles and rescales the local steps with it, and see why a window of five rounds smooths it

A sculptor starts with a rough block and ends with fine detail. In the first hour big chunks fly off. In the last hour the chisel barely moves. Training also has rough and fine stages. Early on the weights change fast and in many directions. Late in training they change slowly and in a few directions.

That fact lets DiLoCoX shrink its messages over time. Section 2.4.3 of the paper builds the rule, adaptive gradient compression, on a theorem about rank.

The rank diminishing principle

Chapter 5 defined rank as the number of independent patterns in a matrix. Theorem 2.1 (from Feng et al., 2022) says that through a neural network the rank of its sub-networks, and the intrinsic dimension of its features, can only stay the same or go down with depth. The paper then argues that this “will affect the gradient rank of the parameter space through back-propagation”: the updates concentrate on “a few principal components,” so the gradient matrix grows more redundant. In plain words: as training goes on, the useful content of a pseudo-gradient fits in a smaller rank. So later messages can use a lower rank without losing what matters.

This is the paper’s argument, not a measurement shown in the paper. The text gives no plot of rank over time, and it does not say how the rank r′ of a gradient is measured. The device below therefore draws an illustrative curve.

Algorithm 3, line by line

The inputs: a window size c (the paper uses 5), the first rank r1 (2,048 for the 107B model) and the first local step count H1 (125). After each outer all-reduce, the algorithm measures r′t on the globally averaged gradient and does this:

  1. Early rounds (t < c). Keep rt = r1 and Ht = H1. Too few measurements to trust.
  2. Later rounds. Set rt to the average of the last c measurements of r′. Averaging smooths noise.
  3. Scale the steps. Compute the rank reduction ratio α = (r1 − rt) / r1, and set Ht = H1 · α.

Why tie H to the rank at all? Two times set the pace. The message time Tm grows with the rank r. The training time Tc grows with H. Chapter 4 showed that overlap works best when the two are close. The paper says H is “continuously tuned accordingly to maximize the overlap between local training and gradient updates while ensuring model convergence.” The rule is the paper’s way to move both knobs from one measurement.

The ratio is easy to misread, so check the direction. α is the reduction in rank, as a share of the first rank: (r1 − rt) / r1. It is 0 while the rank has not fallen and it grows toward 1 as the rank falls. (The PDF text of this formula is scrambled, so we read it from the printed page image.) Taken literally, Ht = H1 · α is smaller than H1 and grows as the rank settles. The paper does not discuss this shape or show a run of the rule, so treat the direction of H as the formula’s, not as a measured result.

A worked example. Let c = 5, r1 = 2,048, H1 = 125. The last five measured ranks are 1,400, 1,250, 1,150, 1,100 and 1,050. Their mean is rt = 1,190. The rank fell by 2,048 − 1,190 = 858, so α = 858 / 2,048 = 0.419. Then Ht = 125 × 0.419 = 52.4, about 52 steps. The message is 1,190 / 2,048 = 58% of its first size. A round later the window slides by one measurement, and rt, α and Ht all update. The ranks here are illustrative.

Follow the rank down

Grey dots are the measured rank each round. The pink line is the windowed average the algorithm uses. The blue line is the local step count. Change the window and watch the pink line.

5
12

Illustrative. The measured rank follows a made-up decay from 2,048 toward 35% of that, with seeded noise; the paper shows no such curve and does not say how r′ is measured. The window rule and the values r1 = 2,048, H1 = 125 and c = 5 are the paper’s. The ratio α = (r1 − rt) / r1 is read from the paper’s Algorithm 3.

Symptom, measurement, fix

With a window of 1 the rule trusts every noisy measurement. The symptom is a jumping H, and the message size and overlap jump with it. The device shows this as a ragged pink line. With a very large window the line lags: the rank has already dropped but the algorithm still sends the old, larger message. The paper’s fix is c = 5, a window short enough to follow and long enough to calm the noise. In the last phase, the paper says, rank and H become stable, “which means a stable low-rank compression.”

For OPT-1.3B the adaptive rule was not used at all. The paper explains: “Int4 quantization and 125-step local training can overlap well and achieve good results.” Adaptivity earns its keep only at the scale where the wire is the problem. Table 1 (Chapter 8) measures it: removing adaptive compression drops throughput to 1,168 tokens per second.

In Algorithm 3, how is the local step count Ht set after the first c rounds?

Chapter 7

What the Theory Promises

Read the convergence bound term by term, see which knob pushes which term, and learn where the paper’s own algebra needs a careful look

A bridge builder does not only test the bridge. She also calculates a limit: this much load, no more. A convergence bound is that kind of limit for training. It says: after T rounds, the size of the gradient will be no larger than this expression. The paper gives one in Section 3 for Algorithm 2. This chapter reads it slowly, because the shape of the bound tells you what each knob does.

The assumptions, in plain words

  1. Smoothness (3.1). The loss is L-smooth: its slope cannot change faster than a rate L. The loss surface has no cliffs.
  2. Noisy but fair gradients (3.2). A gradient from a random batch is correct on average, with variance at most σ2.
  3. Data differences (3.3). The clusters’ data may differ, but their gradients differ from the average by at most ξ2. This is Chapter 1’s drift, given a name.
  4. Local stability (3.4). After H AdamW steps a worker has not moved far: E‖θlocal − θstart‖2 ≤ η2H2σ2, where η relates to the AdamW rate. Drift grows with the square of H.
  5. Compression error (3.5). The squeeze loses at most a fraction ω2 of the message’s size: E‖C(θ) − θ‖2 ≤ ω2‖θ‖2, with 0 ≤ ω < 1.

Lemma 3.6 turns assumption 5 into a number for Algorithm 1 with rank r, dimension d and q bits: ω2 = 1 − (r/d) · 2−q.

The bound

Corollary 3.8 says that, with a suitable learning rate γ, the average squared gradient size over T outer steps obeys:

Left side
How big the gradient still is on average. Small means close to a flat spot, so training has converged.
First term
The ordinary rate for SGD with D workers and H local steps. Total work is D × H × T, so more of any of them shrinks it. It falls like 1/√T.
Second term
The price of talking less and squeezing. It grows with data differences ξ, noise σ, local drift ηH and compression error ω, and it falls faster, like T−2/3.

Read it as a race between two curves. The second term falls faster in T, so for large T the first term dominates and the compression price becomes small. The paper concludes that “adaptive compression that combines Low-Rank and Quantization has almost no impact on convergence” when ω2 → 0, and that H appears in a higher-order term that “slightly degrades the convergence speed when… H is excessively large.” Notice the double role of H: it helps the first term (more steps per round) and hurts the second (more drift). That is the trade of Chapter 1 in algebra.

Race the two terms

The blue line is the ordinary SGD term. The pink line is the compression and drift term. Both axes are logarithmic. Move the knobs and find where the pink line crosses under the blue.

25%
4
125

Illustrative. We set L = 1, f(θ0)−f* = 1, σ2 = ξ2 = 1, η = 0.01 and D = 2, and drop the O(·) constants, so only the shapes mean anything. ω2 = 1 − (r/d)2−q is Lemma 3.6 as printed in the paper.

Two honest cautions

First, look at Lemma 3.6 as printed. With r/d = 25% and q = 4 bits, ω2 = 1 − 0.25 × 0.0625 = 0.984. Even with full rank and 16 bits it is 1 − 2−16, close to 1. So in the printed formula ω2 never gets near 0, and the sentence “when ω2 → 0” is not reachable by turning r, q or H. Drag the sliders and you will see the pink line barely move. A quantizer with q bits should lose roughly 2−2q of the energy, so the printed formula may be a typesetting slip. We could not check it against a published erratum. Treat the bound as a shape, not a guarantee.

Second, a bound with constants set to one tells you nothing about the real loss. The paper does not compare the bound with the measured curves. The strongest evidence for DiLoCoX is Chapter 8’s experiments, not this chapter.

See Local SGD converges for the base theory and adaptive federated optimization for outer optimizers.

In the bound, what does raising H do?

Chapter 8

What the Tables Show

Read the setup, the loss curves, the throughput bars and the ablation, check the paper’s arithmetic, and list what the experiments leave open

You now know the recipe. The question for any recipe is: did it taste right? This chapter reads Section 4 the way a careful reviewer would. First what was run, then what was measured, then what was not shown.

The setup

Two models were pretrained on WikiText-103, a standard text set of Wikipedia articles: OPT-1.3B, and a modified Qwen1.5-107B with its layer count cut from 80 to 78. Every run lasted 4,000 steps. The hardware was NVIDIA A800 GPUs with 40 GB each. To imitate far-apart clusters, the team used the Linux tool tc (traffic control) to throttle the link between workers to 1 Gbps. Nothing was run across a real wide-area network.

ItemOPT-1.3BQwen1.5-107B
GPUs16 (2 nodes of 8)160 (20 nodes of 8)
Target compression, all methods500x1,000x
OpenDiLoCoH = 500out of memory
CocktailSGDrandom 0.1, top-k 0.08, Int4random 0.1, top-k 0.04, Int4
DiLoCoXH = 125, Int4, no adaptive ruleH1 = 125, r1 = 2,048, Int4, window 5

The paper tuned every method to the same compression ratio, so the comparison is fair on message size. The all-reduce baseline has no local steps and no compression, and the paper says it “is equivalent to centralized distributed training.” Note carefully: here all-reduce also runs over the throttled 1 Gbps link. It is the method of a centralized cluster, not a run on a fast one.

Figure 3: loss after 4,000 steps

Figure 3 plots training loss against steps. The text reports the end points. Lower is better.

DiLoCoX sits 0.21 above all-reduce on OPT (5.2% higher) and 0.30 above on Qwen (7.7% higher). Both baselines that compress or delay harder end far worse. The paper blames OpenDiLoCo’s large H and CocktailSGD’s aggressive squeeze, matching the theory of Chapters 1 and 5.

Figure 4: throughput

Figure 4 shows tokens per second at 1 Gbps. OPT-1.3B: all-reduce 745, CocktailSGD 16,161, DiLoCoX 23,880. Qwen1.5-107B: 10.4, 2,427 and 3,728. The paper gives headline ratios of 32 times and 357 times against all-reduce, and 1.35 times against CocktailSGD at 107B.

Let us check them. 23,880 / 745 = 32.1, which matches. 3,728 / 10.4 = 358.5, a hair above the paper’s 357, a rounding difference. But 3,728 / 2,427 = 1.54, not 1.35. The paper’s own numbers give a bigger advantage over CocktailSGD than the text claims, so one of the printed numbers is probably off. The honest summary: about 358 times over all-reduce, about 1.5 times over CocktailSGD.

Table 1: the ablation

An ablation removes one part to see what that part was worth. Table 1 does it on the 107B model at 1 Gbps.

ConfigurationLossTokens per second
Full DiLoCoX4.203,728
Without overlap4.152,197
Without adaptive compression4.021,168
All-reduce3.9010.4

Overlap buys 1.70 times the speed for 0.05 of loss. Adaptive compression buys 3.19 times (3,728 / 1,168) for 0.18 of loss. Each part trades a little loss for a lot of speed. Plot loss against speed on a log axis and the full method sits on a clear frontier between the extremes. Try the plot:

Loss against speed

Right is faster. Lower is better. The best corner is bottom right. Switch the model and compare each point with the all-reduce dot.

All points are the paper’s: losses from Section 4.2.1 and Table 1, throughputs from Section 4.2.2 and Table 1. Single run per point; the paper reports no error bars. OpenDiLoCo on OPT has loss 5.37 but no throughput in the text, so it is not plotted.

What the experiments leave open

  1. Short, small data. 4,000 steps on WikiText-103. This tests the machinery, not a full pretraining run.
  2. Loss only. No downstream benchmarks. A loss gap of 0.30 might or might not matter.
  3. One run per point. No seeds, no error bars.
  4. Emulated link. A throttle on a fast network. No latency, jitter, packet loss, or a machine dropping out.
  5. Same GPUs everywhere. Real compute islands differ, as heterogeneous and unreliable compute explains.
  6. No head-to-head at 107B with OpenDiLoCo. It ran out of memory, so only CocktailSGD and all-reduce were compared there.
  7. A quality gap. Core Automation’s post says the same in one phrase: useful at large parameter count, with a measurable quality gap.
Removing adaptive compression raised the 107B model’s quality (loss 4.02 against 4.20). Why does the paper keep it?

Chapter 9

Field Guide

Keep the numbers, the terms, a checklist and the core loop on one page, then follow the links to the neighbours of this paper

DiLoCoX trains a model with more than 100 billion parameters across clusters joined by a 1 Gbps link. It does so with four moves: take H local steps (Chapter 1), cut the model into pipeline stages with sharded inner and outer optimizers (Chapter 3), apply each averaged pseudo-gradient one round late so the wire is hidden (Chapter 4), and send a low-rank, four-bit message whose rank and H adapt (Chapters 5 and 6). The cost is a loss 0.30 higher than all-reduce after 4,000 steps (Chapter 8).

The numbers

QuantityValueWhere
Ring traffic per sync2(C−1)/C of the list; 533.3 GB for 100B FP32, C = 3Section 2.4.1
Sync time at 1 Gbps1.18 h against 500 s of trainingSection 2.4.1
HardwareA800 40 GB; 16 GPUs (OPT), 160 GPUs (Qwen)Section 4.1.2
ModelsOPT-1.3B; Qwen1.5-107B with 78 layersSection 4.1.1
DiLoCoX settingsH1 = 125, r1 = 2,048, Int4, window c = 5Section 4.1.3
Compression target500x (OPT), 1,000x (Qwen)Section 4.1.3
Final loss, OPT-1.3B4.06 all-reduce, 4.27 DiLoCoX, 5.37 OpenDiLoCo, 5.79 CocktailSGDSection 4.2.1
Final loss, Qwen-107B3.90 all-reduce, 4.20 DiLoCoX, 5.23 CocktailSGDSection 4.2.1
Tokens per second, 107B10.4 / 2,427 / 3,728 (all-reduce / CocktailSGD / DiLoCoX)Section 4.2.2
Ablation, 107Bno overlap 4.15 and 2,197; no adaptive compression 4.02 and 1,168Table 1

The terms

TermPlain meaning
Bandwidth, GbpsHow much a wire carries per second. 1 Gbps is 125 MB/s.
All-reduceEvery worker ends up holding the average of all workers’ lists.
Local SGDEach worker trains H steps alone before any talking.
Pseudo-gradientStart weights minus end weights after H local steps.
Inner / outer optimizerAdamW for local steps / Nesterov momentum on the averaged pseudo-gradient.
Pipeline parallelism, stageThe model cut into slices of layers, one slice per worker.
Dual optimizer policyBoth optimizers sharded along the pipeline, so memory is balanced.
One-step-delay overlapAverage in the background and apply it one round late.
RankThe number of independent patterns in a matrix.
Quantization, Int4Store each number in fewer bits; Int4 uses four.
Error feedbackAdd what compression dropped to the next message.
StalenessHow old the information in an update is.
AblationRemove one part to measure what it was worth.

Checklist

  1. Can you compute the sync time for any model size, cluster count and link speed?
  2. Can you say what the pseudo-gradient is and why it is averaged, not the weights?
  3. Can you name the three walls DiLoCo, OpenDiLoCo and CocktailSGD hit?
  4. Can you say which workers average with a stage-3 worker, and why?
  5. Can you show that overlap helps only once Tm ≤ Tc?
  6. Can you say why top-k fails the all-reduce test and low rank passes it?
  7. Can you compute the adaptive rank and H from five measured ranks?
  8. Can you name two reasons not to read 357 times as the speedup over a data center?

The core as code

This is Algorithm 2 for one worker (stage j of copy i), written as Python-like pseudocode in our own words. The two threads of the paper become one loop with an asynchronous call.

python
def dilocox_worker(shard, data, T, H, r, q, c):
    # shard: this worker's slice of the weights, shape ~ [d / M]
    e = zeros_like(shard)                 # error-feedback buffer, same shape
    delta = None; pending = None
    for t in range(1, T + 1):
        start = shard.clone()                           # theta_{t-1}
        if t > 1:                                        # send LAST round's change in the background
            pending = all_reduce_async(
                compress(delta, rank=r, bits=q),        # low rank, then quantize (Algorithm 1)
                group=same_stage_in_other_copies)       # one ring per stage
        for _ in range(H):                              # inner steps keep running meanwhile
            x = next(data)                               # [batch, tokens]
            loss = pipeline_forward(x, shard)           # activations [batch, tokens, hidden] stage to stage
            shard = inner_opt.step(shard, pipeline_backward(loss))
        if t > 1:
            Delta = pending.wait()                      # averaged, compressed pseudo-gradient
            e = delta - Delta                           # what the shared message missed
            r, H = ada_grad_cmp(c, r, H, Delta)         # Algorithm 3: new rank and local steps
        delta = (start - shard) + e                     # pseudo-gradient plus error compensation
        if t > 1:
            shard = outer_opt.step(start, Delta)        # one-step delay; printed as OuterOpt(theta_{t-1}, Delta_{t-1})
    return shard

Read it line by line. The compress call is where Chapter 5 lives. The pending handle is Chapter 4. The group argument is Chapter 3. The last line of the loop body is the delay. We kept the outer-step line as the paper prints it; check the original on which weights it updates.

Where this sits

The Core Automation post places DiLoCoX in a timeline of low-communication work, between the first DiLoCo and later sparsification methods, as a systems experiment on a 107B model. Its text on the paper is short: “Useful at large parameter count, with a measurable quality gap.” Our reading agrees. The paper shows that the machinery works at 107B and shows a price, but not yet a full-scale, real-network, downstream-tested run.

Keep going

The takeaway. When the wire is the bottleneck, do three things at once: talk rarely, talk while working, and talk in a small language. Each helps a little. Together, on a 1 Gbps link, they turned 10.4 tokens per second into 3,728 for a 107B model, at a measured loss cost.

Credit: DiLoCoX was written by Ji Qi, WenPeng Zhu, Li Li, Ming Wu, YingJun Wu, Wu He, Xun Gao, Jason Zeng and Michael Heinrich of China Mobile (Suzhou) Software Technology and Zero Gravity Labs (arXiv 2506.21263, 26 June 2025). Every number here comes from that paper unless a device says it is illustrative. This lesson is our own re-teaching; the authors did not review it.

Which pair of choices lets the sync disappear behind training on a 1 Gbps link?

Now press Present or Teach and explain, from memory, how DiLoCoX hides a 1.18-hour sync. Then go back to the race at the top, set the model to Qwen1.5-107B, and say out loud which of the four ideas each bar owes its length to.

DiLoCoX: A Low-Communication Large-Scale Training Framework for Decentralized Cluster
Read the paper · The Core Automation post · The DiLoCo background lesson · Back to Gleams