Four workers train one model but may talk only every τ steps. The standard method, DOWNPOUR, blows up once τ reaches 16. Elastic Averaging SGD ties each worker to a centre with a spring and stays calm.
Pick how rarely the workers talk, then press Run 400 steps. Watch the blue DOWNPOUR line leave the page while the warm EASGD line keeps falling. Then we build, piece by piece, the spring, the update rule, the messages and the stability test that explain why.
You need the idea of a slope (which way a curve goes down) and a little algebra. We build gradient descent, workers and the parameter server from zero.
Based on “Deep learning with Elastic Averaging SGD” by Sixin Zhang, Anna Choromanska and Yann LeCun (NIPS 2015), arXiv 1412.6651. It is one of the papers behind Rohan Anil’s Core Automation post The Hitchhiker’s Guide to Training on Compute Islands. The background lesson is Local SGD and Model Averaging.
A toy, not the paper’s experiment: one parameter, loss ½x², four workers starting at x = 3, step size 0.05, noise 0.6 on every gradient, EASGD moving rate β = 0.9 (the paper’s main runs use 0.98, its supplement figure 0.9). The curves are real runs of both update rules in your browser. The paper’s finding that DOWNPOUR turns unstable at τ = 16 and 64 is in its Figure 2.
Chapter 0
See why a thin cable between two buildings of GPUs turns every message into lost time, and what a method must do about it
Imagine two buildings full of GPUs. A GPU is a chip that does the arithmetic of training very fast. The buildings are far apart, and one thin cable joins them. You want all of those chips to train one model.
This is the picture in Rohan Anil’s Core Automation post, The Hitchhiker’s Guide to Training on Compute Islands. The team trained one model across two clusters “nearly halfway around the world from each other, over a bidirectional link of 25 Gbps”. The post calls each cluster an island. Its history table lists the paper in this lesson with one line: workers “are loosely tied to a central copy, so they tolerate delay and drift”.
A model is a long list of numbers called parameters. Training nudges those numbers so the model makes fewer mistakes. One nudge works like this. Show the model a small batch of examples. Measure how wrong it is, which is the loss. Compute the gradient: for each parameter, the direction that raises the loss. Then move every parameter a small step the other way.
That recipe is gradient descent. The step size is the learning rate, written η (eta). When the batch is a random sample, the gradient is a noisy estimate, and the recipe is called stochastic gradient descent, or SGD. Train a model means repeat this step millions of times.
One chip is too slow, so we use many. Each chip is a worker: a process that holds a copy of the parameters and computes gradients on its own batches. The hard question is how the workers agree. If they never talk, you get many separate models. If they talk after every step, they spend their time talking.
How long does a message take? Take a model with 1 billion parameters, stored with 16 bits (2 bytes) each. That is 2 gigabytes, or 16 gigabits. Bandwidth is how many bits a cable moves each second, and Gbps means gigabits per second. A 25 Gbps link moves 16 gigabits in 0.64 seconds. That is the best case, with no delay in the cable and no other traffic.
Now compare. Suppose one training step takes about 1 second on the worker’s chip. If every step needs a 0.64 second message, the chip sits idle for 39% of the time. Try it. Move the sliders and watch the yellow gaps.
Warm blocks are training steps of 1 second each. Yellow blocks are messages while the worker waits. Raise the communication period τ and the gaps grow rarer.
Illustrative numbers: a step of 1 second and a message of 0.64 seconds (a 1 billion parameter model in 16 bits over a 25 Gbps link, from the arithmetic above). Real step times and link speeds differ. The idle share is exact for this timeline: message time divided by (τ steps plus one message).
At τ = 1 the idle share is 39%. At τ = 10 it is 6%. At τ = 64 it is under 1%. So a larger τ saves time. But workers that talk rarely drift apart. Their copies disagree, and a message can arrive carrying an old view of the model. We call that old view stale.
The paper, by Sixin Zhang, Anna Choromanska and Yann LeCun, asks one question. Can we let workers talk rarely and still train well? In 2014 their setting was a few GPUs in one computer or one rack. The setting is smaller than two islands. The logic is the same.
Their answer has one picture. Give every worker a copy of the model. Keep one more copy, the centre variable, as a shared reference. Tie each worker to the centre with a spring. Workers may wander, so they explore. The spring stops them from wandering too far, and it pulls the centre toward the crowd.
The rest of the lesson builds this picture from the ground. We first meet the standard method it beats, DOWNPOUR. Then we derive the spring, write its update rule, run it asynchronously, and test when it is stable. Last, we read the paper’s tables and figures.
Chapter 1
Follow three workers and a shared whiteboard to see how DOWNPOUR, the method EASGD must beat, lets workers talk every τ steps
Three tutors share one whiteboard. The whiteboard holds the best answer the team has so far. Each tutor copies it onto a private notepad, works on it alone for a while, then walks over and writes down what changed. Nobody waits for the others.
That is the design of most parallel training since 2012. The whiteboard is the parameter server: one place that stores the official copy of the model. The paper calls its stored copy the centre variable, written x̃ (x with a tilde). The tutors are the workers, and worker i keeps its own copy xi.
Every worker holds the whole model but reads different data. Worker 1 sees one batch of images. Worker 2 sees another. Each computes a gradient on its own batch. We call this data parallelism, and it is the setting of this paper. Each copy is a vector of d numbers, a tensor of shape [d], where d is the count of parameters.
Two ways exist to combine the workers. In synchronous training, all workers finish a step, average their gradients, and move together. One slow worker holds everyone up. In asynchronous training, each worker goes at its own speed and talks to the server whenever it wants. The paper uses the second kind.
DOWNPOUR is the asynchronous method from Google’s DistBelief system (Dean and colleagues, NIPS 2012). In that paper a model replica fetches fresh parameters from the server and pushes its gradients back. The authors note that you can cut the traffic by fetching and pushing only every few steps. The EASGD paper tests exactly this, with a communication period τ (tau): the count of local steps between two talks with the server.
Here is the version the EASGD paper uses as its baseline (its Algorithm 3). Worker i keeps a running total vi of every step it has taken since the last talk. Every τ steps it adds that total to the centre, copies the centre back, and clears the total.
Read the rule slowly. The worker does not send its position. It sends its change. The server simply adds the change to whatever the centre is right now. By then other workers may have moved the centre, so the change was computed from an old starting point. That mismatch is the seed of the trouble in Chapter 2.
Step through it. Three workers share one parameter, with loss ½x² and no noise so you can follow the numbers. Each tick, every worker takes one step. A worker whose turn has come talks to the server.
Purple is the centre on the server. Warm dots are the workers’ private copies. A hollow ring marks where each worker last copied the centre. Press Next tick and watch who talks.
Toy numbers: loss ½x², learning rate 0.12, τ = 3, no gradient noise, all copies start at 3.00, and the three workers talk on different ticks (A on ticks 1, 4, 7, B on 2, 5, 8, C on 3, 6, 9). The update rule is the paper’s Algorithm 3.
Look at the worker that just talked. Its dot jumped onto the purple line. That jump erased its private path. In DOWNPOUR a worker has no freedom: every τ steps it becomes a clone of the centre. Chapter 3 gives that freedom back, on purpose.
Synchronous training looks safer, so why avoid it? Suppose one worker out of 100 runs three times slower than the rest. Every step then takes three times as long, because the others wait at the meeting point. If a worker crashes, the whole run stops until it returns. Asynchronous training removes the waiting. It pays with a different cost: old information.
A worker’s change is always computed from a centre that was true some time ago. We call the age of that centre the staleness of the update. In the device, worker C talks on tick 3, but its change grew from the centre it copied at tick 0. Workers A and B pushed their own changes in between. About p − 1 other pushes land between a worker’s copy and its push, whatever τ is. But each push carries τ steps of movement. So the stale gap grows with τ, and Chapter 2 measures how badly.
Each talk costs two messages of d numbers: the worker sends vi up, and gets x̃ down. With d = 1 billion and 16-bit numbers, each message is the 2 gigabytes from Chapter 0. With p workers and a period of τ, the server sees about p messages up and p down per τ steps.
Chapter 2
Compute the exact number that makes DOWNPOUR overshoot, and find the longest period τ at which four workers stay safe
Four hikers stand at the same spot on a hillside. Each is told: walk downhill for a while, then report how far you went. Add all four reports to the map. The valley floor is 100 metres away. Each hiker walks 56 metres toward it and reports “56”. The map now says 224 metres. You flew past the valley by 124 metres.
Nobody made an error. Each report was right for the starting spot. But the reports were all made from the same old starting spot, and DOWNPOUR adds them together as if they were separate. This is the failure that the hero showed at τ = 16 and τ = 64. Now we measure it.
Use the simplest loss with a valley: F(x) = ½ h x², a bowl with its bottom at x = 0. The number h says how steep the bowl is. Its gradient is h·x. A noiseless gradient step with learning rate η turns x into x − ηh·x = (1 − ηh)·x. So the worker shrinks its distance to the bottom by the same factor at every step.
Start at the centre value x̃0 and take τ steps. The copy is now (1 − ηh)τ·x̃0. The change it reports is the copy minus the start:
Now let p workers all report against the same old centre. The server adds p copies of −q·x̃0. The new centre is x̃0(1 − p·q). We call 1 − p·q the round factor: what one round of reports does to the distance from the bottom.
A factor between −1 and 1 shrinks the distance, so the centre settles. A factor outside that range grows it. So DOWNPOUR is safe only when p·q < 2. Put the numbers in. Take ηh = 0.05 and p = 4:
τ = 1: q = 0.05, factor = 1 − 4(0.05) = 0.80 (settles)
τ = 4: q = 1 − 0.954 = 0.1855, factor = 0.26 (settles fast)
τ = 16: q = 1 − 0.9516 = 0.5599, factor = −1.24 (grows, flips sign)
τ = 64: q = 1 − 0.9564 = 0.9624, factor = −2.85 (grows fast)
The boundary is p·q = 2, which means q = 0.5, which means 0.95τ = 0.5. That gives τ between 13 and 14. At τ = 13 the factor is −0.95 and the centre still creeps in. At τ = 14 it is −1.05 and the centre grows. This matches the hero, where τ = 4 settled and τ = 16 did not.
The curve is the round factor 1 − p·q for every period τ. Green is the safe band between −1 and 1. Outside it the centre grows. Drag the workers and the learning rate and watch the breaking point move.
Derived above for a noiseless bowl with all p workers reporting against the same centre, the worst case. With staggered, asynchronous talks the exact numbers shift a little, but the toy run in the hero also breaks near τ = 16. The paper’s Figure 2 shows DOWNPOUR and its variants unstable at τ = 16 and 64 on CIFAR.
Symptom. The centre’s loss does not fall. It jumps up after each round of reports, and the distance flips sign every time. Measurement. Compute q for your τ and η, multiply by p, and check it is below 2. Fix. You can shrink η, cut p or cut τ. The first slows learning, the second wastes chips and the third brings back the network cost of Chapter 0.
The paper does the first. For DOWNPOUR on CIFAR it tried learning rates of 0.005, 0.001 and 0.0005. For momentum DOWNPOUR it tried rates of 0.00005, 0.00001 and 0.000005 (its Table 1). Even so, it reports that every DOWNPOUR variant gave its best test error at τ = 1 or 4 and was “highly unstable” at 16 and 64.
Real networks are not bowls, and gradients are noisy, so the clean threshold above is only a guide. The shape of the lesson holds. Pushing a sum of stale moves into a shared copy is risky, because the moves do not know about each other.
The paper also tests DOWNPOUR with Nesterov momentum on the master. Momentum with δ = 0.99 lets the velocity build up. A long run of steps in one direction then travels about 1/(1 − 0.99) = 100 times farther than a plain step. In our formula that makes q much larger at the same η. The paper’s Table 1 fits this: momentum DOWNPOUR used rates near 0.00005 and below, about 100 times under the plain DOWNPOUR rates near 0.005 and below. The link is our reading, not a claim of the paper.
Go back to the hero with this in mind. At τ = 4 the blue line settles. At τ = 16 it climbs. The hero adds noise and staggers the talks, yet the break comes in the same place the clean formula predicts.
Chapter 3
Write one new objective that charges a price for straying from the centre, and derive both update rules by taking its slopes
Picture four dogs on four leads, all tied to one post. Each dog wants to sniff a different bush. The leads let each dog roam, but the farther it goes the harder the lead pulls. The post itself is not fixed: if all four dogs lean one way, the post is dragged along.
That is the whole idea of the paper. The dogs are the workers. The post is the centre variable. The leads are springs. DOWNPOUR let workers roam freely and then reset them to the centre. The spring replaces the reset with a gentle, steady pull.
Training normally minimises one loss F(x). A worker minimising its own loss alone would wander wherever its own batches lead. So the paper writes a new objective (the thing we minimise) with one term per worker, plus a price for distance:
This idea is old. It is the quadratic penalty method: instead of demanding that all copies agree, you charge a price for disagreement. If ρ is huge, they must agree. If ρ is small, they may differ a little. The paper cites the textbook by Nocedal and Wright and notes that this is the same as a known problem called global variable consensus.
To minimise by gradient descent, we need the slope of the objective with respect to each variable. Start with worker i. Its loss term has the usual gradient gi. The spring term ρ/2·(xi − x̃)² has slope ρ(xi − x̃): the same as a spring’s force, stiffness times stretch. A step downhill gives the first update rule:
xi ← xi − η( gi + ρ(xi − x̃) )
Now the centre. It appears in no loss term, only in the p springs. Each spring has slope −ρ(xi − x̃) with respect to x̃. Adding the p springs and stepping downhill gives the second rule:
x̃ ← x̃ + ηρ ∑i (xi − x̃)
These are the paper’s Equations 3 and 4. Read them as physics. The worker feels two forces: the loss pulls it downhill and the spring pulls it home. The centre feels only the springs, and it moves toward the crowd.
One worked step with one worker. Let xi = 3, x̃ = 1, ρ = 0.5, the loss gradient g = 0.8 and η = 0.1. The spring force is 0.5(3 − 1) = 1.0. The worker moves to 3 − 0.1(0.8 + 1.0) = 2.82. The centre moves to 1 + 0.1(0.5)(3 − 1) = 1.10. The worker came in by 0.18, and the centre came out by 0.10. They are drawn toward each other.
Check the extremes. Let ρ grow very large. Any gap between a worker and the centre then costs so much that all p copies must equal the centre. The objective becomes p times F(x̃): ordinary training of one model. Now let ρ shrink to 0. The springs vanish, each worker minimises its own loss alone, and the centre has nothing to follow. The useful setting lies between. Workers stay close enough to share what they learn, and loose enough to try different things.
The paper notes that minimising F(x) alone and minimising this penalised form are linked in the literature on global variable consensus. We do not prove the link here. What matters for training is that the penalised form splits cleanly. Each worker needs only its own gradient and the centre. The centre needs only the workers’ offsets. That is why the messages in Chapter 5 are so few and so simple.
Now watch the spring at work. The toy loss below has several valleys, so different workers like different ones. The picture shows where the four copies settle when we run Equations 3 and 4 without noise until they stop.
The curve is a loss with several valleys. Warm dots are four workers, the purple diamond is the centre, and pink lines are the springs. Drag ρ and see where the workers settle.
Toy loss F(x) = 0.08x² − 0.6cos(2.5x). Workers start at −5.0, −2.5, 0.9 and 2.5, the centre at their mean. Each setting is Equations 3 and 4 run for 4,000 noiseless steps at η = 0.02. The paper itself starts all workers from the same point (its footnote 7); this toy starts them apart to make the spring visible.
With ρ near 0 the workers fall into their own valleys and the centre sits among them. With a stiff spring the workers are dragged together and share one valley. The knob ρ is a dial between exploring and agreeing. Chapter 6 returns to why the paper wants it set loose.
Chapter 4
Rewrite the spring equations with a moving rate, work one exchange by hand, and see why equal and opposite pulls matter
Chapter 3 ended with two equations that use η and ρ together. Every time they appear as the product ηρ. So the paper gives the product its own name: the moving rate α = ηρ. It says what fraction of the gap between a worker and the centre gets closed in one exchange. It is a number between 0 and 1 in practice.
The paper then adds a second number, β = pα, where p is the number of workers. Hold that thought. First, rewrite the worker rule with α (the paper’s Equation 5):
xi ← xi − η gi − α( xi − x̃ )
Read it in two parts. The first part, −ηgi, is an ordinary SGD step on the worker’s own batch. The second part, −α(xi − x̃), closes a fraction α of the gap to the centre. The two parts are independent. You can think of each step as SGD followed by a small pull home.
Now the centre. Put the sum over workers in Chapter 3 into terms of the workers’ mean. The sum of the gaps equals p times the gap between the mean and the centre. Then ηρ times that sum is β times the gap. This gives the paper’s Equation 6:
That is a moving average: keep (1 − β) of the old value and take β of the new. The paper says it is an average “in time and also in space”. Set β = 1 and the centre becomes the workers’ mean in one jump. That is the plain model averaging of the background lesson, Local SGD and Model Averaging. Set β below 1 and the centre keeps a memory.
Look at one worker and the centre in Chapter 3’s rules. The worker moves by α(xi − x̃) toward the centre. The centre moves by α(xi − x̃) toward the worker. The two pulls are equal in size and opposite in direction, like a real spring. The paper calls this elastic symmetry, and says it “has a crucial influence on the algorithm’s stability”. Chapter 7 shows exactly where.
A useful consequence: an exchange between one worker and the centre never changes their sum. What one loses, the other gains. Nothing is created or destroyed by the spring. Only the loss gradients push the system anywhere.
One more detail. The centre rule uses the worker value xit from before the worker’s gradient step, not after. The paper says this keeps the gap xi − x̃ fresh, to “minimize the staleness” of the difference.
Try the extreme values to build a feel. If α = 0, no pull acts and each worker trains alone. If α = 1, the worker lands exactly on the centre after each exchange. That is the reset of DOWNPOUR, and the worker loses its private path. In between, α sets how long a worker remembers its own path: after an exchange it keeps a fraction 1 − α of its gap. For α = 0.225 that is 77.5% of the gap.
For the centre, β = 0.9 means it keeps only 10% of its old value each round, so its memory is short. A β near 0 would freeze it. Watch for one failure: a rate above 1. The pull then overshoots, the worker lands on the far side of the centre, and the next pull swings it back harder. Chapter 7 gives the exact limit.
Take four workers at 3.0, 1.0, 2.5 and 0.5, and a centre at 2.0. Ignore gradients to see the spring alone. Use α = 0.225 and β = 4 × 0.225 = 0.9. Worker 1 sits 1.0 above the centre. It moves to 3.0 − 0.225(1.0) = 2.775. The centre moves to 2.0 + 0.225(1.0) = 2.225. Check the sum: 3.0 + 2.0 = 5.0 before, 2.775 + 2.225 = 5.0 after.
Now let all four exchange at once (the synchronous form). The mean is (3.0 + 1.0 + 2.5 + 0.5)/4 = 1.75. The centre becomes 0.1(2.0) + 0.9(1.75) = 1.775. Worker 2 sits 1.0 below, so it climbs to 1.225. Worker 3 falls to 2.3875 and worker 4 climbs to 0.8375. Try both modes below.
Bars are the four workers and the centre. A ghost outline marks the value before the exchange. Choose a mode, then press Exchange. There are no gradients here, so every move comes from the springs.
Toy numbers from the worked example: workers at 3.0, 1.0, 2.5, 0.5 and a centre at 2.0, p = 4, so β = 4α. The rules are the paper’s Equations 5 and 6 with the gradient set to zero.
Chapter 5
Follow one worker through Algorithm 1, count what crosses the wire, and learn which copy of the model gets tested
So far every worker exchanged with the centre at the same moment. Real workers are never that tidy. One GPU is a little slower, another waits on its disk, a third restarts. A method that needs everyone to stop and meet will move at the speed of the slowest.
The paper gives the asynchronous form in its Algorithm 1. Each worker has its own clock ti: a counter of the gradient steps that worker has taken. The clock starts at 0 and ticks once per step. Nobody shares a clock, so nobody waits for anyone else’s step.
Every worker runs the same loop. The only shared thing is the centre, and the master holds it. Here is the loop for worker i:
Notice what the master does. It receives a vector and adds it. It never asks a worker for a gradient or a parameter. A worker that dies simply stops sending. The centre keeps the memory of everything it has already absorbed, and the other workers carry on. The post on compute islands lists exactly this property for the older DOWNPOUR family: “training continues when individual machines are slow or fail”.
Here is what moves, with shapes. Let d be the number of parameters. The CIFAR network in the paper reads mini-batches of 128 random crops of 3×28×28 pixels, a tensor of shape [128, 3, 28, 28]. Its forward and backward pass gives a gradient [d], entirely on the worker, with no talk at all.
Only the exchange crosses the wire. The master sends x̃, shape [d]. The worker returns α(xi − x̃), shape [d]. That is two vectors per exchange, the same cost per talk as DOWNPOUR. The saving comes from how rarely it happens: the paper runs EASGD at τ = 10 while DOWNPOUR runs at τ = 1 on ImageNet.
One more detail matters for testing. The paper reports the training loss, the test loss and the test error of the centre variable. At inference time you use x̃, one ordinary model, with no workers involved. The workers are a training tool. They are not part of the final model.
Each lane is a worker over 64 steps. A yellow tick is an exchange with the master. Drag τ and compare the traffic with DOWNPOUR at τ = 1.
Illustrative sizes: a model of d = 1,000,000 parameters in 32-bit numbers, so one vector is 4 MB and one exchange moves two of them, 8 MB. Workers are staggered so their exchanges do not all land on the same step. The paper’s own time breakdown is in Chapter 8.
Suppose worker 3 runs at half speed. Its clock ticks half as often, so its exchanges come half as often. The other workers are not affected, because none of them waits for it. The centre feels fewer pulls from worker 3 and follows the other workers more closely. If worker 3 dies, the centre loses one spring and carries on with the rest. A synchronous run would stall at the next meeting point.
Now the failure that remains: waiting for x̃. Symptom: a worker’s GPU sits idle at step 2 of the loop. Measurement: the communication column of the paper’s Table 4, which Chapter 8 reads. Fix: raise τ, so that the wait happens less often. Note also that the gradient in step 4 is taken at the copy as it was before the exchange, as in the paper’s Algorithm 1.
With many workers and long gaps, the pull per exchange must stay gentle. The paper fixes β in its experiments (0.98 in the main runs, 0.9 in a supplement figure) and sets α = β/p. With β = 0.9 and p = 4 that is 0.225, and with p = 16 it is 0.056. A footnote adds that, in the asynchronous setting, the “effective β” per step is β/τ. So a longer period means each exchange carries the pull of many steps at once.
Chapter 6
Read the loose spring as a design choice, add Nesterov momentum to get EAMSGD, and watch more workers shrink the centre’s error
You are searching a mountain range for the lowest valley, and you have a team. One plan: everyone walks to the nearest low spot and stays. Another plan: the team spreads out, each person checks a different valley, and a coordinator keeps a running summary of what they find. The second plan costs more walking and may find a better place.
The paper names the two jobs. Exploration means trying many places. Exploitation means settling into the best place found so far. DOWNPOUR forces every worker to restart at the centre, so it explores little. EASGD splits the jobs: “allow the local workers to perform more exploration (small ρ) and the master to perform exploitation”.
A bowl has one bottom. A neural network’s loss does not. It has many valleys, called local optima, and the paper points to earlier work on the loss surfaces of multilayer networks for this. A worker that rolls into one valley may stay there. With a loose spring, four workers can sit in four valleys and still hand the centre a blend of what they see. Go back to the springs of Chapter 3 and slide ρ low to see it.
What does the data say? On CIFAR, the paper notes that the lowest test error that EASGD or EAMSGD reaches decreases as the number of workers p grows from 4 to 8 to 16. It suggests this “can potentially be explained” by more exploration. That is a guess, not a proof. In a second study (Supplement 9.5) it finds that for EAMSGD higher learning rates helped the test error, which it links to larger fluctuations of the workers, while for plain EASGD larger rates hurt. In both, the setting with the best training loss gave the worst test error.
Momentum gives the copy inertia, like a heavy ball. It keeps a velocity v, a vector of d numbers, that blends the last move with the new gradient. The paper uses the Nesterov form: it asks for the gradient not at the current spot but at the spot the velocity is about to carry the copy to, a look-ahead. Adding the spring gives the paper’s Equation 7:
One step with numbers. Let δ = 0.9, the old velocity v = −0.20, η = 0.1, and the look-ahead gradient 0.50. The new velocity is 0.9(−0.20) − 0.1(0.50) = −0.23. Then x moves by −0.23, and the spring subtracts its pull α(x − x̃) as before. In the paper’s Algorithm 2 the exchange happens every τ steps, exactly as in Chapter 5.
The paper also states a limit. EAMSGD can get stuck at a worse loss when τ = 100, unless the learning rate is lowered gradually over time (Supplement 9.6). Plain EASGD ran from τ = 1 up to τ = 1000 with very similar curves. So momentum buys speed and costs some safety.
Symptom: with momentum and τ = 100, the training loss stops at a worse level and stays there. Measurement: the paper’s Figure 9 in the Supplement compares τ = 1, 10, 100 and 1000. Plain EASGD looks alike across all of them, while EAMSGD at τ = 100 gets stuck. Fix: lower the learning rate over time, ηt = η/(1 + γt)0.5, with γ = 10−4 in the figure. Since α = ηρ stays fixed, a falling η means a rising ρ: the springs stiffen as training goes on.
The theory in the paper's Supplement has a clean message. In the noisy bowl of Chapter 2, the centre’s steady-state squared error falls roughly as 1/p as workers are added (its Corollary 7.1). Think of p workers each sending a noisy view. The centre averages them in space and in time, so the noise averages out.
We can compute that exactly for the bowl. The average of the workers and the centre form a two-number linear system, and its steady-state variance has a closed form we can iterate. Slide β and η below. The yellow line is one plain SGD worker at the same learning rate.
The warm curve is the centre’s steady error for 1 to 256 workers. The dashed purple line is the paper’s 1/p limit. The yellow line is one SGD worker. Pick a worker count to read off the numbers.
Exact for the noisy one-dimensional bowl F = ½x² with unit gradient noise (the setting of the paper’s Lemma 7.1), computed by iterating the steady-state variance of the system (Equations 31 and 32 of the Supplement); a simulation of 400,000 steps agreed within 1% at p = 1, 4 and 16. The dashed line is the paper’s large-p limit C/p. Deep networks are not bowls, so treat this as the mechanism, not a prediction.
Chapter 7
Derive the paper’s two-line stability test, see why equal and opposite pulls make it independent of the worker count, and watch ADMM fail it
A bridge can pass every test one beam at a time and still sway itself apart when the beams act together. Chaining many safe steps does not always give a safe whole. The paper checks this for EASGD, and compares it with another popular method, ADMM.
To check it, the paper makes the problem small. It takes the bowl F(x) = ½x² with no noise, and lets the workers take turns: at global time t only worker number (t mod p) is active. This turn-taking is the round-robin scheme. It is a clean stand-in for asynchronous talking.
Because the bowl is linear, one active turn is a linear map: it multiplies the whole state by a fixed table of numbers, a matrix. The state is (x1, …, xp, x̃), all the copies and the centre. For p = 2 and worker 1 active, the paper writes the table out. Look at where α sits. It appears in row 1, column “centre”, and again in row “centre”, column 1. The table is the same when you flip it across its diagonal. We call such a table symmetric. That is elastic symmetry from Chapter 4, written as numbers.
An eigenvalue of a matrix is a factor by which the map stretches the state along some special direction. If every eigenvalue has size at most 1, repeating the map never blows up. We call that stable. If one eigenvalue has size above 1, some direction grows without limit.
For an active worker and the centre, the interesting part of the map is the 2×2 table [[1 − η − α, α], [α, 1 − α]]. Its eigenvalues λ solve (1 − η − α − λ)(1 − α − λ) = α². Multiply it out and you get:
Two easy checks decide where both roots sit inside [−1, 1]. Put λ = 1 into the polynomial: you get ηα, which is never negative. Put λ = −1: you get 4 − 2η − 4α + ηα, and this must stay at least 0. Solve that for α and you get the paper’s condition:
0 ≤ η ≤ 2, 0 ≤ α ≤ (4 − 2η)/(4 − η)
Try numbers. At η = 0.5 the limit is (4 − 1)/(4 − 0.5) = 0.857. At η = 1 the limit is 2/3 = 0.667. Now break it: η = 1 and α = 0.8. The polynomial is λ² + 0.6λ − 0.8 = 0, whose roots are 0.64 and −1.24. The second root has size above 1, so the system is unstable.
Green is the region where both eigenvalues have size at most 1. Drag η and α and see the dot cross the border.
Exact for the paper’s setting: the one-dimensional bowl, no noise, the 2×2 table above. The eigenvalues are (2 − η − 2α ± √(η² + 4α²))/2, computed live. The border is the paper’s Section 4 condition.
With p workers the full map is p such tables chained, one per turn. Each table is symmetric, and each has all its eigenvalues inside [−1, 1]. A symmetric table with that property can never stretch any vector, so its norm is at most 1. A product of such tables also cannot stretch anything. So the chain is stable under the same condition, whatever p is. The paper states that the condition is “independent of p”.
ADMM (alternating direction method of multipliers) is another method that ties copies to a centre. It adds a multiplier λi per worker: a running price on disagreement that grows while the worker stays off the centre. Its updates are not symmetric. Each ADMM table, taken alone, is stable. But chain them in round-robin order, and the product can have an eigenvalue above 1.
The paper shows this for p = 3 and p = 8 (its Figure 1), and gives a recipe: η = 0.001, ρ = 2.5, all copies and the centre starting at 1000. It also says that for ADMM “the analytic condition” for stability “is still unknown”. We ran the same recipe from the paper’s Equations 9 to 11, and EASGD with α = 0.0025 beside it. Here is what the size of the state does.
Both lines start at the same point. The vertical axis is the size of the state on a power-of-ten scale. Choose three or eight workers.
Our run of the paper’s Equations 9 to 13 in one dimension with F = ½x², η = 0.001, ρ = 2.5 for ADMM and α = 0.0025 for EASGD, all variables starting at 1000, 200,000 steps. The state size is the sum of absolute values of all copies and the centre. The ADMM growth is slow at first (about 1.001 to 1.002 per round), which is why it looks harmless early.
A footnote adds a fair caveat: in the paper’s own deep-learning runs, asynchronous ADMM performed “nearly the same” as EASGD, though its momentum version was less stable at large periods. The proof of stability is a reason to prefer EASGD, not a claim that ADMM always fails on real networks.
Chapter 8
Read the paper’s setup, its three figures and its time table, and learn which claims they support and which they do not
A claim is only as good as the test behind it. Before the numbers, here is what the authors actually ran. Knowing the setup tells you what a result can and cannot mean.
All runs used a cluster of GPUs joined by InfiniBand, a fast data cable made for clusters. Each node held 4 Titan GPUs, and each worker was one GPU. The centre variable lived on a central parameter server. Two image-classification tasks were used, and both used convolutional neural networks (a type of network that slides small filters over an image).
Every method started from the same random initial parameters. The authors note in a footnote that starting workers and master from different seeds “traps” the algorithm in the symmetry-breaking phase. In all runs EASGD used β = 0.98, and every momentum method used δ = 0.99. Each method got its own search over learning rates (Tables 1 to 3 in the Supplement). The CIFAR runs were repeated 3 times and the best result per method is shown. The ImageNet runs were done once, with the best setting found.
Four workers on one node, with the period τ set to 1, 4, 16 and 64. Each panel plots the centre’s training loss, test loss and test error against wall-clock time. The paper’s reading is direct. The DOWNPOUR family does best at τ = 1 or 4 and “become[s] highly unstable” at 16 and 64. EAMSGD beats the comparators at every τ, and its lead grows at 16 and 64. This is the experiment the hero of this lesson imitates in a toy.
Now p grows. The lowest test error reached by EASGD or EAMSGD decreases as p rises. The caption gives one headline number: for p = 16 the best comparator is plain momentum SGD on one GPU, and EAMSGD reaches 21% test error 11.1 times sooner in wall-clock time.
Here EASGD and EAMSGD talk every τ = 10 steps, while DOWNPOUR and its momentum version talk every step. For p = 8 the best comparator is DOWNPOUR, and EAMSGD reaches 49% test error 1.8 times sooner, while sending ten times fewer exchanges. The learning rate was dropped twice, by a factor of 5 and then 2, when the online loss stopped improving.
This table is the heart of the communication claim. It splits the time into computation, data loading and parameter communication, in seconds. The CIFAR figures cover 400×128 examples, and the ImageNet figures cover 1,024×128. Use the picker to compare DOWNPOUR at τ = 1 with EASGD at τ = 10.
Each bar is the total seconds for a fixed amount of data. Warm is computation, grey is data loading, yellow is talking to the parameter server. Pick a task and a worker count.
All numbers are the paper’s Table 4, in seconds, approximate: CIFAR p = 8 is 11/2/5 for τ = 1 and 11/2/1 for τ = 10; CIFAR p = 16 is 11/2/9 and 12/2/1; ImageNet p = 4 is 1323/24/173 and 1254/58/7; ImageNet p = 8 is 1239/61/284 and 1266/84/11 (computation/loading/communication).
On CIFAR with 16 workers, DOWNPOUR at τ = 1 spends 9 of its 22 seconds on communication. EASGD at τ = 10 spends 1 of 15. The paper’s summary: at τ = 10 the communication time becomes negligible. Computation is the same in both, so the savings are pure.
In every curve, the horizontal axis is wall-clock time: minutes for CIFAR, hours for ImageNet. Each curve is for the centre variable, and lower is better. A speed-up number compares the time to reach one test-error level, such as 21% or 49%. A method whose curve never reaches that level has no speed-up number and does not appear on the paper’s time plots (its Figures 10 and 11, which test levels from 21% down to 18% on CIFAR and from 49% down to 43% on ImageNet). So a missing bar in those plots means the method failed to get there.
They show that on these two image tasks, with a few GPUs, EASGD and EAMSGD reach a given test error sooner than DOWNPOUR and its variants and tolerate rare messages. They do not show that the exploration story is the cause: the paper offers it as a likely reason, not a test. They also stop at 16 workers on CIFAR and 8 on ImageNet, far from today’s clusters. In the speed-up study (Supplement 9.8) a larger p did not always shorten the time to a given error, because smaller learning rates were chosen for larger p.
Chapter 9
Keep the numbers, the checklist and the core code on one page, and see where the paper sits for training across compute islands
In one paragraph. Workers train their own copies and talk to a centre only every τ steps. Instead of resetting to the centre (DOWNPOUR), each worker is pulled a fraction α toward it, and the centre is pulled the same fraction toward each worker. The pulls are equal and opposite, which keeps the system stable at any worker count. Workers explore, the centre averages, and messages are rare.
| Name | What it is | Value or source |
|---|---|---|
| xi | Worker i’s own copy of the parameters, shape [d] | Eq. 3 and 5 |
| x̃ | Centre variable on the parameter server, shape [d]. The model you test. | Eq. 4 and 6 |
| η, ρ | Learning rate; spring stiffness (small ρ means more exploration) | Eq. 2; ρ = α/η |
| α = ηρ | Moving rate of a worker: share of the gap closed per exchange | α = β/p in the runs |
| β = pα | Moving rate of the centre toward the workers’ mean | 0.98 (Section 5.2) |
| τ | Local steps between exchanges | 1, 4, 16, 64 (CIFAR); 10 (ImageNet, EASGD) |
| δ | Momentum term in EAMSGD | 0.99 |
| Batch and crops | Mini-batch size; input crop | 128; 3×28×28 (CIFAR), 3×221×221 (ImageNet) |
| Stability | Round-robin, quadratic case | 0 ≤ η ≤ 2, 0 ≤ α ≤ (4 − 2η)/(4 − η) |
| Speed-up, CIFAR | EAMSGD vs the best comparator (MSGD) to reach 21% test error, p = 16 | 11.1 (Fig. 3) |
| Speed-up, ImageNet | EAMSGD vs DOWNPOUR to reach 49% test error, p = 8 | 1.8 (Fig. 4) |
| Communication share | CIFAR p = 16: DOWNPOUR τ = 1 vs EASGD τ = 10 | 9 of 22 s vs 1 of 15 s (Table 4) |
import numpy as np def easgd(grad, x0, p=4, eta=0.05, beta=0.9, tau=10, steps=400): alpha = beta / p # moving rate of one worker center = x0.copy() # x~, shape [d] xs = [x0.copy() for _ in range(p)] # x^i, p copies, each [d] for t in range(steps): for i in range(p): x = xs[i].copy() if (t + i * tau // p) % tau == 0: # worker i talks to the master diff = alpha * (x - center) # elastic difference, [d] xs[i] -= diff # a) worker moves toward centre center += diff # b) centre moves toward worker xs[i] -= eta * grad(x) # one SGD step on a fresh batch return center # evaluate this one # EAMSGD: replace the SGD line by a Nesterov step (Algorithm 2) # v[i] = delta * v[i] - eta * grad(x + delta * v[i]); xs[i] += v[i]
This is Algorithm 1 almost line for line. It differs in one place: here the workers take turns inside one loop, where the paper runs them as separate processes with a real network between them.
Rohan Anil’s post lists this paper in its history of low-communication training, in the line “workers are loosely tied to a central copy, so they tolerate delay and drift”. Later work in that history takes many local steps and then averages, as Local SGD and federated averaging do. Those methods reset the workers to the average. EASGD instead pulls them part of the way, so each worker keeps its own path. The background lesson Local SGD and Model Averaging covers the reset-and-average family.
For the basics of splitting training over many chips, see Large-Scale Distributed Training, Parallelism II: Pipeline and FSDP and Distributed Training: Data, Tensor and Pipeline Parallelism. For gradient descent itself, see Optimization and Backpropagation.
Go back to the four workers at the top and try τ = 64 again. Then try Present to teach the idea back in your own words, or Teach to draw the springs on a whiteboard.
Credit. “Deep learning with Elastic Averaging SGD” by Sixin Zhang (Courant Institute, NYU), Anna Choromanska (Courant Institute, NYU) and Yann LeCun (NYU and Facebook AI Research), NIPS 2015, arXiv 1412.6651. DOWNPOUR is from Dean et al., “Large scale distributed deep networks”, NIPS 2012. This lesson re-teaches the ideas in its own words and devices, and every device number is either from the paper (with its table or figure) or marked as a toy. Read it next to the Core Automation post, The Hitchhiker’s Guide to Training on Compute Islands.