Parallel Speedup, Efficiency and Gustafson's Law
On cores, the parallel part of a job splits ways but the serial part doesn't, so a fixed-size job's speedup flattens at (Amdahl). If instead the job grows to use the extra cores in the same time, the speedup is , close to (Gustafson). Which story applies depends on whether the problem is fixed or grows.
What the symbols mean
- One-core time
How long the job takes on a single core.
- p-core time
How long the same job takes on p cores.
- Efficiency
Speedup per core: 1 means every core is fully useful.
What the symbols mean
- Parallel fraction
In Amdahl's law: the fraction of the ONE-core time that can be split across cores.
What the symbols mean
- Parallel fraction of the parallel run
In Gustafson's law: the fraction of the p-core run's time spent in parallel work.
Explanation
Parallel speedup is simply how many times faster a job runs on processor cores than on one. Ideally that's : four cores, four times faster. Two things get in the way: some work can't be split (reading the input, combining the results), and Amdahl's law from the last lesson says that serial part caps everything. The formulas here are Amdahl's law with , plus a second view, Gustafson's law, that asks a different question. They look like they disagree, but they're answering two different questions, and both are just bookkeeping about time.
Speedup and efficiency. compares one core to cores. Efficiency says how much of each core you're really getting: on 8 cores is , so a quarter of the hardware is effectively idle.
Amdahl with cores (strong scaling). Keep the job fixed. On one core it takes time 1, with a fraction that can be split. On cores that part takes and the serial part still takes :
Efficiency falls steadily. Divide by and simplify:
With : 16 cores give (), 64 cores give (), and nothing ever beats 20.
Gustafson (weak scaling). In practice, people with more cores usually run bigger problems: a finer weather grid, a larger simulation, more training data. So fix the time instead. Measure a run on cores and call its length 1: a fraction is serial and is parallel work spread over all cores. How long would one core take for that same work? The serial part still takes , but the parallel part was cores' worth of work, so one core needs :
That's a straight line in with slope , so it never flattens. With serial, 64 cores give .
Why they don't contradict each other. Look at where each fraction is measured. Amdahl's is a share of the one-core time for a fixed job. Gustafson's is a share of the -core time for a job that grew. As the problem grows, the parallel work grows with it while the serial work (say, setup) stays about the same, so the serial share of the one-core time keeps shrinking. Amdahl answers "how much faster will this job get?" Gustafson answers "how much more work can I do in the same time?"
A common mistake. It's tempting to plug a measured serial fraction into whichever formula is handy. A serial share measured on a 64-core run is Gustafson's ; using it as Amdahl's predicts when the true scaled speedup is . Always ask which run the fraction was measured on. And real machines add a third cost neither law includes: communication between cores, which can make go back up past some (the last practice problem works this out).
There's a graph further down that puts the ideal line, Gustafson's line and Amdahl's curve side by side.
See it
Worked examples
A fixed-size job is parallel ( of the one-core time). What are its speedup and efficiency on cores?
- 1
This is a fixed job, so use Amdahl's law with : .
A climate model runs on cores, and a profile of that run shows of its time is serial. Using Gustafson's law, what is the scaled speedup compared with doing the same work on one core?
- 1
The serial share was measured on the 32-core run, and the model was sized to use all 32 cores. That's Gustafson's setting: , , .
Practice
Type your answer and check it. Solve them all to complete the lesson.
A job takes s on one core and s on cores. What is the parallel efficiency, as a percent?
A fixed-size job is parallel. What is its Amdahl speedup on cores? Give 3 decimal places.
A job is scaled up to fill cores, and on that -core run of the time is parallel work (). What is Gustafson's scaled speedup?
A render farm job is sized to fill cores, and on that run only of the time is serial. What scaled speedup does it get over a single core doing the same work?
A fixed-size job runs times faster on cores. Assuming Amdahl's law holds, predict its speedup on cores.
A fixed-size job is parallel. What is the largest number of cores that keeps the efficiency at or more?
A weather service runs its forecast once an hour. When it gets a machine with times as many cores, it uses a finer grid so the forecast still takes an hour. Which law describes its speedup?
The hardest one here. Get it, and you've got this lesson.
A fixed-size job is parallel, but coordinating the cores adds overhead. Measured as a fraction of the one-core time, the -core time is . How many cores give the largest speedup, and what is that speedup? Enter the number of cores (a whole number), then the speedup to 2 decimal places.
Where it's used
Cloud teams use these formulas to decide how many machines to rent. Measure the speedup at 4 and 8 cores, back out the serial fraction, and the efficiency formula says where extra machines stop paying for themselves. Supercomputer centers report weak-scaling results (Gustafson) because their users run ever-bigger simulations, while a game engine that must render one frame in 16 ms lives in Amdahl's fixed-size world.