Part 3 of 4
DiLoCo and its variants
DiLoCo
DiLoCo, short for Distributed Low-Communication, reduces how often workers synchronize. Each worker runs an inner optimizer locally for $H$ steps before participating in a shared update.
Let $\Theta$ be the shared parameters at the start of a round, and $\theta_i$ be worker $i$’s parameters after those local steps. Its contribution is:
\[\Delta_i = \Theta - \theta_i\]This outer gradient is a parameter difference. It summarizes multiple local updates; it is not the derivative of one batch’s loss. The workers average these differences, and an outer optimizer updates $\Theta$. They then load the result and repeat. The original method uses AdamW inside and Nesterov momentum outside.
For a scalar example, suppose $\Theta=10$, and two workers reach $8$ and $6$. Their outer gradients are $2$ and $4$. Plain outer SGD with learning rate $1$ would produce $10-3=7$, the average of their parameters. Momentum changes this update using previous rounds.
Exchanging updates every $H$ steps reduces communication frequency. The workers still meet at synchronization rounds, and increasing $H$ allows more divergence. See the DiLoCo paper.
Streaming DiLoCo
Synchronizing the entire model occasionally can still cause large communication bursts. Streaming DiLoCo splits the parameters into fragments and synchronizes them on a staggered schedule.
A fragment is a subset of parameters selected for communication. Each worker still trains the full model; this is not model parallelism.
Workers can continue local training while a fragment is being exchanged. This reduces peak bandwidth requirements and overlaps communication with computation. The workers still participate in coordinated synchronization rounds, so a failed worker can interrupt progress. See the Streaming DiLoCo paper.
Decoupled DiLoCo
Decoupled DiLoCo retains local training, fragments, and outer optimization, while removing the requirement to wait for every participant. Its learners progress independently, each with its own model replica and inner optimizer.
A syncer maintains the shared fragments. It collects contributions from a minimum number of learners, called a quorum, merges them, applies the outer optimizer, and sends updated fragments back. A short adaptive waiting window can include additional contributions after quorum is reached.
Learners report how many local steps and tokens they processed. This lets the syncer weight contributions from learners that performed different amounts of work. Learners align with updated fragments as they receive them, so their replicas can hold different versions at the same moment.
A slow or failed learner can be left out of a round. The tradeoff is that learners train on increasingly different states, and aligning with a shared fragment can overwrite local work done while communication was in progress. This is a different optimization process from DDP; comparable quality must be established experimentally. See the Decoupled DiLoCo paper.
Previous: Distributed training · Next: GradientMail