Many machines can train one model with no boss. Each machine swaps updates only with its two neighbours, so no single link jams. Turn the network down and watch who slows.
Learn why Lian et al. showed that training with neighbours only can match training with a central server, and can beat it when the network is slow.
Pick a method, then drag Bandwidth down and Latency up. Watch the bars: the parameter server collapses first, ring all-reduce collapses on latency, and D-PSGD barely moves. Then we build, piece by piece, the neighbour graph, one step of the algorithm, the proof that neighbours are enough, and the experiments.
You need an average (add the numbers, divide by how many) and the idea of a model that learns by small steps. We build the rest from zero.
Paper: Can Decentralized Algorithms Outperform Centralized Algorithms? A Case Study for Decentralized Parallel Stochastic Gradient Descent, by Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang and Ji Liu (NeurIPS 2017). Re-taught here in our own words and devices. It is a reading of the background lesson on decentralized and gossip training and of the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands by Rohan Anil.
An illustrative model with our own formulas, not the paper’s measurements. Each machine holds a ResNet-20 sized model of 0.27 million numbers at 4 bytes each, so a message is 1.08 MB. Server: n gradients in, then n models out, through one link. Ring all-reduce: 2(n−1) steps of 1/n of the model. D-PSGD on a ring: send the model to 2 neighbours. Each message pays the latency once. Only up to ten machines are drawn.
Chapter 0
See why a crowd of machines that all talk to one server slows down, and what the paper asks instead
Eight machines in one room are training the same neural network. Each machine holds its own copy of the model. Each machine reads its own slice of the training pictures. After every small batch of pictures, each machine has learned something. We call that something a gradient: a list of numbers that says how to nudge each setting of the model so its mistakes get smaller.
The eight gradients differ, because the pictures differ. To keep the eight copies the same, somebody must combine the eight gradients into one. Who does that?
The common answer is a boss. One machine, the parameter server, collects every gradient, averages them, updates the model, and sends the new model back to all eight machines. The paper says that most distributed learning systems of its day, including TensorFlow and CNTK, were built this way. We call the design centralized, because everything passes through one centre.
Every machine sits on the network through a link, which is a cable with two limits. Bandwidth is how many bits per second the cable carries. Think of the width of a pipe. Latency is how long the first bit takes to arrive. Think of the length of the same pipe.
Now look at the server. Its single link must carry all eight gradients in and all eight new models out. That is 16 messages for 8 machines, and 200 messages for 100 machines. The server link is a one-lane road that every car must use.
The paper calls this the traffic jam on the central node. The busiest node is the machine that handles the most data in one step. In the server design, its load grows in a straight line with n, the number of machines. Add machines to go faster and the jam gets worse. You can see the first sign of it in the instrument at the top of this page: set the server bars next to the D-PSGD bar at 10 Mbps.
The purple line is the server. The warm line is the busiest machine when each machine talks only to its neighbours. Drag the number of machines, then change how many neighbours each machine has.
Counted as in the paper’s Table 1: the unit is one gradient or one copy of the model, sent or received. The server gets n gradients and sends n models. A machine with d neighbours sends its model to d machines and receives d. The counts are exact for these designs; they say nothing yet about speed.
With 8 machines the server handles 16 messages. A machine on a ring handles 4. At 64 machines the server handles 128 and the ring machine still handles 4. The ring machine does not care how many other machines exist. That is the whole appeal.
Lian and colleagues ask a plain question: can a design with no centre do better? In a decentralized design, each machine talks only to its neighbours, the few machines it is directly linked to. Nobody sees all the gradients. Nobody holds the one true model.
You may expect this to be worse. Information has to leak across the whole group through short hops, like news in a village that has no town crier. Earlier work agreed with that fear. The paper says earlier theory either made no comparison with the centralized design or implied the decentralized design was much worse. Decentralized methods had been studied by the control community for cases where only a decentralized network exists, such as a field of sensors, and they were seen as a compromise.
The paper changes the story with three claims. First, it gives the first theory that finds a regime where the decentralized design can be faster. Second, it shows that adding machines speeds training up in a straight line, which the paper calls linear speedup. Third, it tests the idea on clusters of up to 112 GPUs and finds that on slow networks it can be up to ten times faster than well-tuned centralized systems.
This paper is a reading of the Core Automation post The Hitchhiker’s Guide to Training on Compute Islands by Rohan Anil (2 November 2026). The post studies compute islands: clusters of GPUs that sit far apart, joined by links that are slow compared with the wires inside a cluster. Its history table lists this paper in one line: “Decentralized SGD: nodes average with neighbors (gossip) instead of a global all-reduce.” An all-reduce is the step where every machine ends up holding the sum of every machine’s numbers. Chapter 6 shows why it also suffers when latency is high.
The same post revisits butterfly mixing, where eight learners swap model pieces in pairs and, after three rounds, every learner’s update has reached all eight. That is a neighbour-only design with a clever graph. The paper in front of you is where the theory for such designs starts. For the plain background, read Decentralized and Gossip Training first or beside this page.
Chapter 1
Build the centralized baseline from zero and see exactly where its traffic jam comes from
You are standing on a foggy hillside and you want to reach the valley floor. You cannot see the valley. You can only feel the slope under your feet. So you take a small step downhill, feel the slope again, and repeat. This is gradient descent. The slope is the gradient, and the model’s settings are your position.
Training a neural network is the same walk in a space with millions of directions. The paper writes the goal as one line: find the setting x that makes the average mistake f(x) as small as possible, where the average is taken over the data. Each single training example gives its own stochastic gradient, a noisy estimate of the true slope. Stochastic means that it has some chance in it.
A single machine does this loop. Draw a small batch of samples. Compute the gradient on the batch. Move the weights a small step against it. The step size is the step length γ, also called the learning rate. The loop is stochastic gradient descent, or SGD, and the batch version is mini-batch SGD.
The batch gradient is noisy. Its average over many batches points the right way, but any single one wobbles. A bigger batch wobbles less. Here is the measured rule: the wobble, written as a standard deviation, shrinks with the square root of the batch size. Four times the samples gives half the wobble.
Now give the work to n machines. Each machine draws its own batch and computes its own gradient at the same weights. The server averages the n gradients, which is the same as one batch n times larger. It takes one step, then sends the new weights to all machines. The paper calls this C-PSGD, for centralized parallel SGD. It is also plain mini-batch SGD with batch size n.
Try it. In the device below, each machine returns the true slope plus random noise. The blue dots are 200 repeated steps of the server. Add machines and watch the dots tighten.
The vertical line is the true slope, 1.0. Each dot is the average gradient from one training step, using the number of machines you choose. Drag the machines up and watch the cloud tighten. Press Draw again for a new set of 200 steps.
Toy numbers, ours and not the paper’s: the true slope is 1.0 and each machine adds noise with standard deviation 2.0 (the paper’s σ). The measured spread is real for the 200 random draws shown, so it varies a little around the exact value 2.0/√n.
With one machine the steps land anywhere from about −5 to 7, so many steps even point uphill. With 16 machines the spread is 0.5. This is the reason to use many machines at all: not that each step is longer, but that each step is more trustworthy. A more trustworthy step lets you use a larger step length and reach the valley sooner.
The paper shows two simple ways to give the machines their data. In Strategy 1, all machines can read the same shared database. In Strategy 2, the data is cut into n pieces and each machine keeps one piece. In the second case, one machine’s data can differ from the others. The paper measures this difference with a number ς (varsigma): in Strategy 1 it is 0, and in Strategy 2 it can be greater than 0. Chapter 5 shows that this number makes the theory harder, and the ring harder still.
Look at what C-PSGD needs from the network. Every step, each machine sends a full-size gradient to the server. The server returns a full-size model. The weights of a modern network are large, so these messages are large. The server link carries n of each. That is the traffic jam of Chapter 0, now with a name for every part of it.
The paper also notes a repair that other systems use: several parameter servers, and the all-reduce primitive of MPI (the standard library for message passing between machines). Footnote 1 of the paper warns that these fixes may suffer when network latency is high. Chapter 6 measures why.
Chapter 2
Describe who talks to whom as one small table of weights, and check that it keeps the average safe
Picture eight friends sitting in a circle. Each friend holds a number on a card. The rule is simple: look at the friend on your left, the friend on your right, and yourself; add the three numbers; divide by three; write the result on a fresh card. Everyone does this at the same moment. Nobody sees the whole circle, yet something useful happens, as the next chapters show.
To reason about this, we need a way to write down who listens to whom, and how much. The paper uses a small table of numbers called the weight matrix W, also called the mixing matrix. It has n rows and n columns, one for each machine. The entry Wij says how much machine i listens to machine j. If Wij is 0, machine i does not listen to j at all, so they are not neighbours.
The paper asks W to be a symmetric doubly stochastic matrix. That sounds heavy. It is three plain rules, and each has a job.
Because the matrix is symmetric, every column also adds to 1. This second fact is the important one. It means that no machine gives away more than it has and none creates something from nothing. The total of all the machines’ numbers does not change when they mix, and neither does their average.
The paper’s main example is the ring. Each machine has two neighbours, one on each side, and every weight is 1/3. In the matrix, each row has three entries of 1/3 and zeros elsewhere. Take our eight friends with cards 8, 2, 6, 1, 7, 3, 5, 4. Their total is 36 and their average is 4.5.
friend 3: (6 + 1 + 7) / 3 = 4.67 friend 0: (4 + 8 + 2) / 3 = 4.67 friend 4: (1 + 7 + 3) / 3 = 3.67
Do this for all eight friends and you get 4.67, 5.33, 3.00, 4.67, 3.67, 5.00, 4.00, 5.67. They add to 36 again, so the average is still 4.5. The cards are now squeezed closer to 4.5: the biggest card fell from 8 to 5.67 and the smallest rose from 1 to 3.00. One round of mixing already helped.
This is line 4 of the paper’s Algorithm 1. Notice that x here is a whole model, a list of N numbers. The same weights Wij apply to all N numbers at once. The ring above is the case N = 1.
A table of weights is also a picture. Draw one dot for each machine and a line wherever Wij is above 0. This is the communication graph, and the paper’s Figure 1(b) shows one. The number of lines at a machine is its degree. The ring has degree 2. The paper’s result is that the busiest node’s cost is the degree, not n.
Play with the matrix below. Choose a way of connecting the machines and read both the graph and the table. Two ideas to look for. First, the more connected the graph, the more of the table is filled. A fully connected graph with weights 1/n is exactly the average of everyone, which is what an all-reduce computes. Second, look at the number ρ (rho) in the read-out. It measures how slowly the machines agree, and Chapter 4 explains it.
Left: who talks to whom. Right: the weight matrix W, with darker cells for bigger weights. Pick a connection pattern and a number of machines, then check that every row adds to 1.
Ring: weight 1/3 on self and each of two neighbours, as in the paper’s Theorem 3. Ring plus far link: our own variant in the spirit of the paper’s 16-machine run, where each machine also links to the machine farthest away; weights 1/4 each. Everyone: weight 1/n, the same as an all-reduce average. ρ is computed here from the matrix itself, as the paper defines it.
Look at the ring when n grows from 8 to 16. The degree stays 2 and each machine still does the same small amount of talking. But ρ climbs towards 1. That means a bigger ring agrees more slowly. The far link buys back some of that speed for one extra message. This is the central trade of the whole paper: fewer links per machine, slower agreement.
Chapter 3
Run the algorithm by hand: compute a gradient, average with neighbours, step
Back to the eight friends in the circle. This time each friend also has a private job. Friend i is looking for the best guess for a single number, and friend i’s own data says the answer is ai. The cards say 8, 2, 6, 1, 7, 3, 5, 4. No one knows the others’ answers. The group wants the one guess that is least wrong for everybody, which is the average, 4.5. How can they find it by only talking to neighbours?
The paper’s answer is Algorithm 1. Every machine repeats the same three actions at every step k. This is the whole method.
Look at which weights each action uses. The gradient is computed at the old weights xk,i, before averaging. The average is taken over the old weights of the neighbours. Because neither of the first two actions needs the output of the other, they can run at the same time: the machine computes its gradient while the network carries the neighbours’ weights. Footnote b of the paper says that if the talking takes less time than the computing, the talking is hidden completely.
This is the same update for every machine, written once for the whole group. The paper uses this form for all its proofs.
Give machine i the mistake fi(x) = ½(x − ai)². Its gradient is x − ai. Start every machine at x = 0, as the paper’s Assumption 4 does. Use the ring and γ = 0.5.
Step 1. All weights are 0, so averaging gives 0. The gradient at 0 is −ai. Each machine moves to 0 + 0.5 ai: that is 4, 1, 3, 0.5, 3.5, 1.5, 2.5, 2. Their average is 2.25, which is half of 4.5.
Step 2, machine 0. Its neighbours hold 2 (machine 7) and 1 (machine 1), and it holds 4. The average is (2 + 4 + 1)/3 = 2.33. Its gradient at 4 is 4 − 8 = −4. It steps to 2.33 + 0.5 × 4 = 4.33.
The group average moved from 2.25 to 3.375. Check it by hand: the average gradient at step 2 is 2.25 − 4.5 = −2.25, and 2.25 + 0.5 × 2.25 = 3.375. The group’s average moved exactly like plain gradient descent on the average mistake. The mixing did not change it, because W keeps the average. That is why the paper can analyse the average of all local weights, as in its Theorem 1.
Now play. In the device, press Step and watch eight teal lines. They start together at 0. They rise towards 4.5, and between them they stay close. Then change the step length, the noise and the pattern of links.
Each teal line is one machine’s weight. The warm dashed line is their average. The green line is the best answer, 4.5. Press Step, or Run 20, then try a large step length and gradient noise.
A toy of ours, not an experiment of the paper: eight scalar weights, fi(x) = ½(x − ai)² with a = 8, 2, 6, 1, 7, 3, 5, 4, all starting at 0. The update is exactly the paper’s Xk+1 = XkW − γ∂F. Noise adds a Gaussian of standard deviation 1.0 to each gradient. “Spread” is the gap between the highest and lowest machine.
Four things to see, all measured on this toy. With γ = 0.5 and no noise, the group average reaches 4.50 in about ten steps. But the machines never meet exactly: each keeps a pull towards its own ai, so on the ring the highest and lowest stay about 2.7 apart. Shrink γ to 0.1 and the gap falls to 0.92, though the walk is slower (4.43 after 40 steps). Switch to Everyone and the gap is still 2.3 at γ = 0.5, because each machine still follows its own gradient between averages. Last, push γ to 0.9 on the ring: the average still reaches 4.50, but the machines fly apart. A step length that is too large for the graph breaks agreement. The paper’s theory sets γ small for this reason.
For a real network with N weights, machine i holds xk,i of shape [N] and a local batch. The forward and backward pass produce a gradient of shape [N]. Communication sends the vector x of shape [N] to each neighbour and receives one back from each: 2 × degree messages of N numbers. Machine memory is a small multiple of N. There is no machine that stores all n copies.
At the end, the output is the average of all the machines’ weights: (1/n) Σi xK,i. The paper proves that the copies converge together (Theorem 4), so in practice one can take any one copy. In its Torch experiments it averages all the models once after the last epoch with a single all-reduce. That final step costs one message round, once, not at every step.
Chapter 4
Watch copies that only talk to neighbours still converge on one answer, and measure how fast
A village has no town crier. One morning a farmer learns that the river is rising. She tells her two neighbours. They each tell their other neighbour. By the evening, everyone knows. News spread without anyone who talked to all the village.
Weights spread the same way. When machine 0 learns something from its data, only machines 1 and n−1 hear it directly. But those machines mix with their neighbours at the next step, and so on around the ring. Chapter 3 showed this working. This chapter asks how fast it works, because the paper’s whole result depends on the answer.
To isolate the effect, switch the gradients off. Each machine holds a number and the only action is the neighbour average. We want to know how quickly the numbers become equal. The gap between the machines is the disagreement. We measure it as the spread: the root mean square of the distance of each number from the group average.
Take a ring of 4 machines with W entries of 1/3, and cards 4, 0, 0, 0. The average is 1. The distances from it are 3, −1, −1, −1, so the spread is √((9 + 1 + 1 + 1)/4) = 1.73. After one round the cards read 1.33, 1.33, 0, 1.33. The spread is now 0.58. After a second round it is 0.19. Each round multiplied the spread by 1/3. The average stayed at 1 the whole time.
spread: 1.73 → 0.58 → 0.19 each round × 1/3
That 1/3 is not luck. It is a number that belongs to the matrix W. Repeating a mix is repeated multiplication by W. A matrix like ours has special numbers called eigenvalues, written λ1 ≥ λ2 ≥ … ≥ λn. For our kind of W, λ1 is always exactly 1, and it belongs to the direction “everybody holds the same number”. Mixing never changes that direction. Every other direction is a pattern of disagreement. Each round multiplies a disagreement pattern by its eigenvalue. The slowest pattern to die is the one with the largest eigenvalue in size, which is either λ2 or −λn.
The distance 1 − √ρ is called the spectral gap: the gap between the top eigenvalue 1 and the slowest-fading one. A big gap means fast agreement. In our 4-ring, √ρ = 1/3, which is the factor we measured.
Here is the guarantee in one line. After k rounds of mixing, the spread is at most (√ρ)k times the starting spread. Since √ρ < 1, this goes to zero as a geometric decay: halved, halved again, and so on. The device draws the real spread of a random start as a solid line, and the guarantee as a dashed line above it.
The solid line is the real spread between the machines after each round of neighbour averaging, on a log scale. The dashed line is the bound from ρ. A steeper fall means a better graph. Compare the ring with the ring plus a far link, and drag the number of machines.
Starting numbers are a fixed random list (not the paper’s data); mixing is exact matrix multiplication; ρ is computed from the eigenvalues of W. The dashed bound is (√ρ)k times the starting spread, a true upper bound for these symmetric matrices.
Set 16 machines on the ring. ρ is 0.90, so each round the worst pattern shrinks only to 95% of its size. In the device, it takes 106 rounds to shrink the spread 1000 times. Add the far link and it takes 36. Choose Everyone and one round does it. This is the paper’s trade made visible. A degree of 2 keeps the busiest node light, but the price is slower agreement.
In real training the gradients keep making the machines disagree, a little, every step. Mixing keeps pulling them together. The balance depends on γ and ρ. This is why the paper’s Theorem 4 says the copies reach consensus at rate O(1/K) when γ is chosen as in Corollary 2: as training goes on, the step shrinks and the disagreement shrinks with it. In plain words: given enough steps, every machine holds nearly the same model, so it does not matter which one you keep.
The size of ρ also controls how many steps you need before the nice speed-up of Chapter 5 begins. The bounds (5) and (6) in the paper both contain 1/(1−ρ) terms. A worse graph needs a longer run before it behaves like the server.
Chapter 5
Read the convergence theorem in plain words: the same rate as the server, with linear speed-up
You are about to buy 16 machines instead of 1. A salesperson promises, “16 times faster.” You should ask two questions. Faster at what? And under what conditions? A theorem is the answer to those two questions, written with care. This chapter reads the paper’s theorem as a promise with small print.
Assumption 1 of the paper lists what must hold. Each item has a plain meaning.
The paper stresses one thing it does not assume: that the gradients or the search region are bounded. Earlier work on decentralized methods often did, and it made the proofs easier but hid some of the real behaviour.
We want a small average gradient, since a zero gradient means we have reached the bottom of a valley. The paper calls a point an ε-approximate solution when the average squared size of the gradient over the run is at most ε. Theorem 1 bounds that quantity for D-PSGD. Corollary 2 picks the step length γ = 1/(2L + σ√(K/n)), and the bound becomes this.
Now read the two terms as a race. At first, K is small, and the start-up term 1/K may be the larger one. As K grows, 1/K falls faster than 1/√(Kn), so eventually the noise term wins. The paper’s condition on K, equations (5) and (6), says how long you must wait: it depends on n, σ, ς and 1/(1 − ρ). Past that point, the rate is O(1/√(Kn)).
In numbers: reaching error ε takes O(1/ε²) gradient evaluations in total, whatever n is. Share them among n machines and each does O(1/(nε²)). Double the machines and each does half the work.
The device draws the bound for a made-up problem, over many steps K, for 1, 4, 16 and 64 machines. Pick the error you want, and read off how many steps each choice needs.
Faint lines are the bound for 1, 4, 16 and 64 machines. The bright line is the number you choose. The yellow line is your target. Move the target down and watch where the lines cross it.
Illustrative constants of ours: f(0) − f* = 10, L = 1, σ = 1, so the bound is 80/K + 84/√(Kn). The shape comes from the paper’s Corollary 2; the constants do not come from any experiment. The ring limit uses the orders K1/9 and K1/13 from Theorem 3, whose true constants the paper does not give.
At the loose target 1.0, 64 machines need only 29.6 times fewer steps than 1 machine, not 64, because the start-up term 80/K takes a large share. At the tight target 0.001, 64 machines need 63.9 times fewer. That is the “K large enough” condition at work. Linear speedup is a promise about the long run.
Theorem 3 puts the ring into the theorem. For W with entries 1/3, the linear speedup holds when n is at most of order K1/9 if all machines share a database, and of order K1/13 if the data are split (ς > 0). These are tiny powers. With a billion steps, K1/9 is 10 and K1/13 is about 5. The paper says these bounds can probably be improved. Read them as: the proof for a plain ring does not allow many machines. Better-connected graphs have a larger gap and a looser limit.
Chapter 6
Count what the busiest machine must send, and see when that decides the wall clock
A theorem counts steps. A clock counts seconds. A fast algorithm on paper can be slow in the lab, because a step has two parts: the machines compute, and the machines talk. This chapter puts a clock on the talking. Then it finds the two different ways a network can be slow, and shows which designs suffer from which.
Recall the pipe from Chapter 0. Bandwidth is the width of the pipe, in bits per second. A narrow pipe makes a big message take a long time. Latency is the length of the pipe: the delay before the first bit arrives, whatever the width. A long pipe makes even a tiny message wait.
Units help here. A megabit per second (Mbps) is a million bits each second. A gigabit per second (Gbps) is a thousand times that. A byte is 8 bits. So a 10 Mbps link carries 1.25 million bytes per second. Latency is measured in milliseconds (ms), thousandths of a second. Light in glass fibre needs about 5 ms for 1,000 km, so two sites on opposite sides of the planet cannot be closer than roughly 100 ms apart, even on a very wide pipe.
A message of M bytes sent over one link takes about M / bandwidth + latency. Every design below is a count of how many such messages the busiest node must send in a row.
Take our ResNet-20-sized model: 0.27 million numbers, 4 bytes each, so M = 1.08 MB, or 8.64 megabits. Take 8 machines on 10 Mbps links with 5 ms latency. Then M over the bandwidth is 0.864 s. This is our own model of the paper’s setting; the paper does not give these formulas.
Look at the numbers. The server is the clear loser on a narrow pipe, by about eight times. That is the traffic jam. But ring all-reduce is not a loser here. It is slightly faster than D-PSGD, because its pieces are small and no node sends the whole model twice. The paper agrees with this in its text: D-PSGD beats the parameter-server version on low-bandwidth networks, because its traffic is balanced. It beats the all-reduce version (CNTK) on high-latency networks, because it needs far fewer rounds.
The reason is in the count of rounds. Ring all-reduce needs 2(n − 1) rounds, so with 112 machines it needs 222 rounds in a row. Each round pays the latency again. D-PSGD needs one round whatever n is. Make latency 100 ms and 8 machines: all-reduce takes 1.51 + 1.40 = 2.9 s, D-PSGD takes 1.83 s. Make the link a fast 1 Gbps with 100 ms latency and 112 machines: all-reduce is about 22 s, D-PSGD about 0.12 s. Latency, not bandwidth, is where the order of magnitude hides.
Each line is the time for one pass over the training data. Sweep bandwidth with latency fixed at 5 ms, or sweep latency with bandwidth fixed at 1 Gbps. The dots mark the setting of the slider underneath. This mirrors the paper’s Figure 2(c) and 2(d).
Illustrative model of ours, not the paper’s data: message 1.08 MB; 50,000 CIFAR-10 images per epoch with 128 images per machine per step; compute 0.05 s per step. Parameter server and all-reduce pay compute plus talking. D-PSGD overlaps the two, as footnote b of the paper allows, so it pays the larger of them. The paper’s own claim, measured with CNTK on up to 112 GPUs, is up to one order of magnitude.
Slide the sweep to bandwidth, set latency to 5 ms and push bandwidth up to 10 Gbps. All three lines meet at the floor set by computing. That matches the paper: on a fast network all implementations run at about the same speed, because talking is never the bottleneck. Now sweep latency at 1 Gbps. The all-reduce line climbs about 14 times faster than the D-PSGD line, because it pays the latency 14 times per step with 8 machines (and 222 times with 112).
The Core Automation post trains one model across two clusters that sit nearly half the world apart, joined by a 25 Gbps link. At that distance, latency is large, and a design that needs hundreds of ordered rounds would pay it hundreds of times. A design that needs one or two rounds does not. The post’s own answer combines several ideas, such as sending less often and mixing in pairs. Neighbour-only averaging is one of those ideas. This chapter is the reason it is on the list.
Chapter 7
Read each figure and table of the paper for what it measures and what it proves
A good experiment section answers a few plain questions. Did the new method reach the same quality? Was it faster in seconds? Did it keep that speed as machines were added? And under which conditions did it stop winning? This chapter walks through the paper’s Section 5 and its supplement and says, for each figure, what is measured and what is proved.
The paper trains on two kinds of task: image classification and speech recognition, with a natural-language task in the supplement. For images it trains ResNet networks, deep image models built from blocks with shortcut connections, with 20, 32 or 56 layers, on CIFAR-10, a set of 50,000 small training pictures in 10 classes. It builds D-PSGD twice: inside Microsoft's CNTK using MPI, and in Torch using TCP sockets. It compares against four baselines, which are listed below along with the hardware.
| What was run | Hardware and network | What it was compared with | What it showed |
|---|---|---|---|
| ResNet-20, loss against time | 7 GPUs in one machine (Titan Xp), network slowed to 10 Mbps, or to 5 ms latency | CNTK (all-reduce) and a parameter server written with MPI | D-PSGD reaches the same loss sooner in wall-clock time when the network is slow |
| Seconds per epoch, bandwidth and latency swept | The tc tool setting bandwidth and latency (the caption of Figure 2 lists 7 and 10 GPUs) | The same two baselines | All equal on a fast network; centralized ones slow down much more on slow or distant links, up to one order of magnitude |
| Convergence per epoch | Up to 112 K80 GPUs on EC2 (4 p2.16xlarge + 6 p2.8xlarge) | Centralized SGD | Same loss per epoch even with 112 nodes |
| Speedup over one GPU, ResNet-56 | 7 GPUs, 4 PCIe channels | One GPU | Near-linear to 4 GPUs, about 5 times with 7, limited by shared PCIe |
| Torch, ResNet-32 against EASGD | 9 to 16 machines with one K20 GPU each, Gigabit Ethernet | EASGD with τ = 1, 4 and 16 | D-PSGD wins by a large margin on loss against time |
| IBM Watson NLC, in the supplement | 8 K80 GPUs in one server | NCCL all-reduce SGD | Same loss and test error, communication cut 3 times and 2 times |
Figure 2(a,b): loss against time. Both panels train ResNet-20 on 7 GPUs. In (a) the link is slowed to 10 Mbps. In (b) it has 5 ms latency. In both, the D-PSGD curve falls faster than the CNTK and parameter-server curves. This supports one claim: with a slow network, D-PSGD finishes sooner for the same loss. It does not say D-PSGD finishes sooner on every network.
Figure 2(c,d): the sweep. The authors use tc, a Linux tool for shaping a network, to change bandwidth and latency by hand, then time one epoch. With high bandwidth and low latency all three systems are similar, “not surprisingly”. As bandwidth falls, or latency rises, both centralized systems slow down a lot, and D-PSGD can be up to ten times faster. This is the figure behind the abstract's headline. Chapter 6 reproduced its shape with a model of our own.
Figure 3: convergence and speedup. Training loss against epochs for ResNet-20 on 112 GPUs shows D-PSGD tracking the centralized curve. That is the theory's first promise: the same number of gradients is needed. A second panel plots speedup against workers on one machine: near-linear to 4 GPUs, and 5 times at 7, which the authors blame on synchronisation and on four PCIe channels shared by seven GPUs. A third shows who talks to whom in one run.
Figure 4 to 6: against EASGD. EASGD, elastic averaging SGD, is a parameter-server method that lets each machine wander near a central copy. It talks every τ steps. With τ = 1, EASGD converges well but its traffic saturates the Gigabit links and slows every machine. With τ = 4 and 16 it talks less and converges more slowly than D-PSGD. D-PSGD, the paper says, “allows more communication in an efficient way without reaching the network bottleneck”, and it shows less fluctuation because it is synchronous. Both learning rate 0.1 and momentum 0.9 were the same for the two.
Scalability, Figures 7 to 12. On 1, 4, 8 and 16 machines, D-PSGD needs about 80, 20, 10 and 5 epochs to reach a training loss of 0.2. The per-epoch time grows by only 3 percent against one machine. At 16 machines each node also gets one extra link, to the machine farthest round the ring. The authors found this helped information flow.
Choose a result. Each bar is a number printed in the paper. The faint marker shows what a perfect result would be.
All numbers are printed in the paper. Epochs: about 80, 20, 10 and 5 for 1, 4, 8 and 16 machines (Torch, ResNet-32, CIFAR-10, Gigabit Ethernet). Network need: about 22 MB/s with 4 and 8 machines and about 33 MB/s with 16, against a practical Gigabit Ethernet capacity of 100 to 120 MB/s. NLC: communication cost reduced by 3 times on the Joule dataset and 2 times on Yelp, with 8 nodes.
The epochs bars halve each time the machines double: that is a perfect straight line in epochs. The paper says it “justifies the correctness of our theory”. Be careful with what it proves. It shows the number of steps falls in proportion to machines. Wall-clock speedup also needs the time per epoch to stay flat, which the 3 percent figure supports.
The network bars answer a practical question: can a cheap network carry this? A machine needs 22 MB/s, and Gigabit Ethernet gives 100 to 120. The authors read this as headroom for a GPU 4 to 5 times faster, since the need grows in proportion to GPU speed.
Training loss is not test accuracy. In the generalization test, the learning rate drops to 0.01 at epoch 80, following the original ResNet paper, and the final test error is compared to the 0.0751 that He et al. report for the same 32-layer network. D-PSGD, the authors say, reliably beats that level for any number of machines, so it “does not negatively affect (or perhaps helps) generalization”. The wording is careful. This shows no harm, not a guaranteed gain. The paper also does not tune D-PSGD’s schedule, and says so.
Chapter 8
Name the assumptions, the synchronous barrier, and how later work answered them
Eight rowers share one boat. Everyone must pull at the same instant, or the boat veers. If one rower is tired and slow, the other seven must wait for each stroke. The boat goes as fast as its slowest rower. This chapter is about the rowers, and about every other condition under which the paper’s promise needs care.
D-PSGD, as the paper defines it, is a synchronous algorithm. At every step, all machines compute, then all machines swap weights, and nobody moves on until the swap is done. That wait is the synchronization barrier. The paper states it plainly: because the algorithm is synchronous, it wants every node to compute each mini-batch in roughly the same time.
A machine that is slower than the rest is a straggler. In a barrier design the step time is the time of the slowest machine, and every fast machine sits idle for the difference. Idle machines are paid-for compute doing nothing.
The paper offers two remedies in one sentence. If the machines differ in power, give them different mini-batch sizes to even out the time. Or let faster machines run more than one mini-batch before the sync. Both are cheap to say and need care to do. See what the barrier costs, and what the first remedy buys, in the device.
Each bar is how long a machine takes to compute one mini-batch. The line is the barrier: nobody can swap until the slowest is done. Machine 3 is the straggler. Make it slower, then give it a smaller batch.
Toy times of ours, not the paper’s: seven machines take 1.0 time units per full batch and machine 3 takes the chosen multiple. Idle share is 1 minus the mean compute time over the step time. With the remedy, machine 3 handles 1 over its slowdown of a full batch, as the paper suggests, so it finishes with the others but the step carries slightly fewer samples.
At 3 times slower, with the same batch for all, the step takes 3.0 units and 58 percent of all machine time is idle. Eight machines now do the work of 3.3. Give machine 3 a third of a batch and every machine finishes in 1.0 unit; the step carries 7.33 batches of samples instead of 8. That is 92 percent of the ideal throughput, instead of 33 percent. The price is that machine 3’s data is sampled less often, which matters if its data differs from the rest (ς > 0).
The Core Automation post has a timeline of low-communication training. It lists this paper in 2017 as “Decentralized SGD: nodes average with neighbors (gossip) instead of a global all-reduce.” Around it sit the other ideas that fill the gaps above. Federated averaging and Local SGD take many local steps between exchanges. Quantization and sparsification shrink each message. Downpour SGD copes with unreliable peers. Later entries named in the post include Moshpit SGD (2021), with dynamic averaging groups for unreliable, heterogeneous peers, and Factored Gossip DiLoCo (June 2026), which replaces part of DiLoCo’s global averaging with pairwise gossip to cut blocking communication.
The post then revisits butterfly mixing for its own run. It splits 64 GB300 GPUs at one site into eight cells, each an eight-GPU learner training its own copy of a 32-billion-parameter mixture-of-experts model. The cells swap model fragments in pairs and keep training between swaps. After three rounds every cell’s update has reached all eight, with no all-reduce, and the training quality matched the baseline. That is D-PSGD’s idea with a graph chosen so that information crosses the group in log2 n rounds instead of drifting around a ring. For the full story, see Decentralized and Gossip Training.
Chapter 9
Keep the numbers, the checklist, the core code and the links onward
Here is the whole paper on one page. Centralized parallel SGD sends every gradient to one server, so the server link jams as machines are added. Decentralized parallel SGD lets each machine average with a few neighbours and then step on its own gradient. The weight matrix W records the neighbours, and the number ρ says how fast they agree. The theorem says that D-PSGD needs as many gradient steps as the server design and gets linear speedup once the run is long enough. The busiest machine moves O(degree) messages, not O(n). The experiments show the gain on slow or distant networks, up to ten times, and no gain on fast ones.
| Quantity | Value | Where it comes from |
|---|---|---|
| Busiest-node messages per step | O(n) for a server; O(degree) for D-PSGD, which is 2 on a ring | Table 1 |
| Gradient evaluations to reach error ε | The same for both designs | Table 1, Corollary 2 |
| Convergence rate | O(1/K + 1/√(nK)), so O(1/√(nK)) for large K | Corollary 2, equation (4) |
| Step length | γ = 1 / (2L + σ√(K/n)) | Corollary 2 |
| Ring weights | 1/3 on self and each neighbour | Theorem 3 |
| Ring speedup limit | n of order K1/9 (shared data), K1/13 (split data) | Theorem 3 |
| Consensus rate | O(1/K) | Theorem 4 |
| Epochs to training loss 0.2 | About 80, 20, 10, 5 on 1, 4, 8, 16 machines | Section 5.3, Torch |
| Per-epoch time against one machine | Up by 3% | Section 5.3 |
| Network need per machine | About 22 MB/s (4 or 8 machines), 33 MB/s (16); Gigabit gives 100 to 120 | Network utilization |
| Largest cluster | 112 GPUs; up to one order of magnitude faster on slow networks | Abstract, Section 5.2 |
| Error to beat on ResNet-32 | 0.0751 (He et al.); D-PSGD reliably beats it | Generalization ability |
| Communication saved on NLC | 3 times (Joule), 2 times (Yelp) | Supplement |
| Term | Plain meaning |
|---|---|
| Gradient | A list of numbers saying how to nudge each setting to make mistakes smaller |
| Parameter server | One machine that collects all gradients and hands back the model |
| All-reduce | A step after which every machine holds the combined (summed or averaged) numbers of all machines |
| Bandwidth, latency | The width of the pipe in bits per second; the delay before the first bit arrives |
| Busiest node | The machine that handles the most data in a step |
| Mixing matrix W | A table of weights: how much machine i listens to machine j |
| ρ, spectral gap | How fast neighbour averaging makes copies agree; near 1 is slow |
| Consensus | All machines hold (almost) the same model |
| Linear speedup | Twice the machines, half the steps each |
| Straggler, barrier | A slow machine; the wait that makes everyone match its pace |
This is the paper’s Algorithm 1 for all machines at once. It runs, and it prints 4.5 for the toy of Chapter 3. In a real system, each column of X lives on a different machine and the product X @ W becomes messages to neighbours.
pythonimport numpy as np def ring_W(n): # symmetric, doubly stochastic: 1/3 on self and the two ring neighbours W = np.zeros((n, n)) for i in range(n): for j in (i - 1, i, i + 1): W[i, j % n] += 1 / 3 return W def dpsgd(grad, X0, W, gamma, steps): """X has shape (N, n): column i holds machine i's N weights.""" X = X0.copy() for k in range(steps): # line 3: each machine's gradient at its OWN old weights, shape (N, n) G = np.stack([grad(i, X[:, i]) for i in range(X.shape[1])], axis=1) # lines 4 and 5: average with neighbours (X @ W), then step X = X @ W - gamma * G return X.mean(axis=1) # output: the average of all copies, shape (N,) a = np.array([8, 2, 6, 1, 7, 3, 5, 4], float) grad = lambda i, x: x - a[i] # f_i(x) = 0.5 (x - a_i)^2, so the gradient is x - a_i print(dpsgd(grad, np.zeros((1, 8)), ring_W(8), 0.5, 40)) # [4.5] l = np.sort(np.linalg.eigvalsh(ring_W(8)))[::-1] print(max(abs(l[1]), abs(l[-1]))**2) # rho = 0.6476
Now press Present or Teach and explain, from memory, why the parameter server jams, what the matrix W and ρ say, how one step of D-PSGD works, and when it beats ring all-reduce. Then go back to the sliders at the top, set latency to 100 ms and 112 machines, and explain why the all-reduce bar collapsed and the D-PSGD bar did not.
Credit: the method, theorem and experiments are by Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang and Ji Liu, arXiv 1705.09056 (NeurIPS 2017). The context comes from Rohan Anil’s post The Hitchhiker’s Guide to Training on Compute Islands (Core Automation, 2 November 2026). Toy numbers on this page are ours and are labelled where they appear.