Definition · Amdahl's LawLet p be the fraction of a job’s single-machine runtime that can be executed in parallel, so 1 − p is the serial fraction. On n machines the runtime becomes (1 − p) + p/n of the original, and the speedup is
S(n) = 1/((1 − p) + p/n).
The model assumes the parallel part divides perfectly, the machines are identical, and coordinating them is free. All three are optimistic, which is why this curve is an upper bound.
Normalise the one-machine runtime to 1. The serial part takes 1 − p no matter how many machines are present; the parallel part takes p on one machine and p/n on n. Add them, and the speedup is the ratio of the old runtime to the new one.
one machine (1 − p) + p = 1
n machines (1 − p) + p/n
S(n) = 1 / ((1 − p) + p/n)
p = 19/20, n = 32:
(1/20) + (19/20)/32 = 32/640 + 19/640 = 51/640
S(32) = 640/51 = 12.549…×
Theorem · The ceilingAs n grows without bound, p/n → 0, so
S(n) → 1/(1 − p),
and because p/n > 0 for every finite n, S(n) is strictly below 1/(1 − p) at every machine count. The bound depends on the serial fraction alone: the hardware does not appear in it.
This is the whole point of the law and the reason it is worth a lesson. A curve that climbs more and more slowly could be climbing toward anything; this one is climbing toward a number you can write down before you buy a single machine. The reciprocal of the serial fraction is the answer, and “Graphs and Asymptotes” on the Algebra path is where reading a limit off a curve was set up.
Example · Five per cent serial, and a fleet that cannot helpp = 19/20 gives a ceiling of 20×. Two machines reach 40/21 = 1.905×; four reach 80/23 = 3.478×; eight reach 160/27 = 5.926×; thirty-two reach 640/51 = 12.549×. Each doubling adds less than the one before, and the sequence is converging on 20 rather than on anything larger. A team that has measured the first three rows and extrapolated a line through them will budget for a speedup that does not exist.
Reaching a stated fraction of the ceiling
Since the ceiling is never reached, the useful question is how many machines it takes to get a given share of the way there. Write the target as a fraction f of the ceiling and solve the inequality: the algebra is one cross-multiplication and it leaves no root and no logarithm behind.
want S(n) ≥ f · 1/(1 − p)
1/((1 − p) + p/n) ≥ f/(1 − p)
(1 − p) ≥ f·(1 − p) + f·p/n
(1 − p)(1 − f) ≥ f·p/n
n ≥ (f/(1 − f)) · (p/(1 − p))
f = 9/10, p = 19/20: 9 × 19 = 171 machines
and S(171) = 1/(1/20 + 19/3420) = 1/(190/3420) = 18 = 0.9 × 20
The two factors are worth reading separately. f/(1 − f) is the odds of the target — nine for ninety per cent, ninety-nine for ninety-nine — and p/(1 − p) is the ratio of parallel work to serial work. The machine count is their product, so tightening the target from ninety to ninety-nine per cent costs eleven times as many machines against the same code.
The lab finds 171 twice: once by scanning integer n until the speedup clears the target, and once by evaluating the product above and rounding up. Two routes to one integer is the check, and the scan is the one that carries the claim — a closed form that happens to agree is a check on the algebra, not a substitute for it.
What efficiency says about the same point
S(n)/n is the fraction of a machine each machine contributes. It starts at 1 and falls monotonically: 95.2% at two machines, 74.1% at eight, 39.22% at thirty-two, 10.5% at the one hundred and seventy-one that reach ninety per cent of the ceiling. Every one of those machines is paid for in full.
Example · What the second thirty-two machines buyAt p = 19/20, thirty-two machines give 640/51 = 12.549× and sixty-four give 1280/83 = 15.422×. The second block of thirty-two adds a factor of 1.23, and everything still unbought above it is the 20/12.549 = 1.59× between here and the ceiling — which no purchase can close. That is the arithmetic a “double the fleet, halve the runtime” plan is up against.
One caution about p itself. It is a share of time measured on one machine, not a share of code or of functions: a lock held for a tenth of the runtime is a tenth of the serial fraction even if it is two lines. This course takes p as given. Measuring it is “Measuring Systems”, and it is harder than this lesson.