The answer that depends on the machine

A stopping test is a race

One matrix, one right-hand side, one tolerance, thirteen partition counts — and eleven different iteration counts between 674 and 690. Every run converged, every answer is right to the accuracy asked for, and what differs is the bill.

Worth reading first: The same program, twice · A parameter that counts steps.

Everything the field has measured so far moves a number in its last digits. This is where the last digits stop being where the answer is.

One system, one tolerance, and 11 different amounts of workConjugate gradients on a 200 × 200 symmetric positive definite matrix with κ = 10⁴, stopped when the relative residual falls below 10⁻¹⁰, run at each of 13 partition counts. The only thing that differs between the runs is how many pieces the two global inner products were summed in — which on a real machine is the number of workers. Iteration counts run from 674 to 690, 11 of them distinct, a spread of 2.4% of the work. Every run converged and every answer is right to the accuracy asked for; the forward errors span 6.31·10⁻¹¹ to 1.08·10⁻¹⁰, a factor of 1.72. What differs is not a digit at the end of an answer — it is the bill, and it is an integer.110¹670673676679682685688691694pieces the inner products were summed initerations to the tolerance674, the cheapest run690, the dearestthe same solve, pricedpartitionings run13distinct counts11spread, per cent2.4best forward error6.3·10⁻¹¹worst1.1·10⁻¹⁰one matrix, one toleranceand the cost is the machine's
Fig. 1 Conjugate gradients on one 200 × 200 matrix with κ = 10⁴, stopped at a relative residual of 10⁻¹⁰, run at thirteen partition counts. The only thing that differs is how many pieces the two global inner products were summed in.

Iteration counts from 674 to 690, eleven of the thirteen distinct. Every run converged. Every answer is correct to the accuracy that was asked for — the forward errors run from 6.3·10⁻¹¹ to 1.1·10⁻¹⁰, a factor of 1.72, all of them comfortably under the tolerance.

What differs is an integer, it is 2.4% of the work, and it is a property of the machine.

That number is the field’s first result that a scheduler would notice. A disagreement in the eighth digit of a residual is invisible to everything outside the arithmetic; a solve that takes a different number of synchronising steps changes the shape of a parallel program’s execution, and does so for a reason that is not in the program.

Where the reductions are

The instrument is worth describing because it is unusually honest about what it changes.

The conjugate gradient method performs, per step: one matrix–vector product, three vector updates, and two inner products — rᵀz for the residual update and pᵀAp for the step length. Those two are where a parallel implementation synchronises, they are the all-reduces the communication field counts in the message and the word, and they are the only places in the method where every worker has to agree about a number.

So the experiment replaces the arithmetic context’s inner product with a p-way partitioned reduction and changes nothing else. Addition, multiplication and division stay binary64. The matrix–vector product stays sequential. The method is this site’s own cg, unmodified, and the two ar.dot calls inside it are exactly the two quantities a distributed implementation computes differently.

Those two numbers are also where every scalar in the method comes from: α = rz/pAp is the step length and β = rz’/rz is the direction update. A disagreement of a few hundred ulps in either produces a slightly different iterate, which produces a slightly different residual, which produces a slightly different next step.

Why a few hundred ulps becomes sixteen iterations

The chain is short and each link is measurable.

The reductions disagree by about κ_sum·u. For pᵀAp the summation condition number is a few hundred — the vector that hides it measures 4.1·10² for a curvature — so the disagreement is around 10⁻¹³ relative. Small.

The iterates diverge geometrically. Conjugate gradients is not a contraction in the way a stationary iteration is; two runs that differ at step k differ by more at step k + 1, because the search directions are built from the residuals and the residuals are built from the directions. By step 600 two runs that started 10⁻¹³ apart are apart by whatever the method’s own error level is.

And the stopping test is a threshold crossing. The residual falls, crosses 10⁻¹⁰ once, and the step at which it does is decided by where the curve happens to be relative to the line. Two curves that differ by a per cent cross a horizontal line at slightly different places, and the difference is quantised to whole steps.

So the mechanism turns a relative 10⁻¹³ into a difference of sixteen steps by two amplifications: a geometric one over hundreds of iterations, and a quantisation at the end.

The part that is not the machine’s fault

An important qualification, because this figure is easy to over-read.

Conjugate gradients loses its finite-termination property in floating point for reasons that have nothing to do with reductions. The residual vectors stop being orthogonal, the method takes more steps than it should, and how many more is exquisitely sensitive to everything — which is an orthogonalisation nobody calls one’s subject, and the reason the rate the condition number predicts has to be measured against a method that does not terminate when the theory says it will.

So the sensitivity being exploited here is the method’s, not the machine’s. The machine supplies a perturbation of 10⁻¹³ and the method supplies the amplification. A different iterative method with a less chaotic trajectory would show a smaller spread from the same perturbation.

That does not weaken the finding — the perturbation is real, unavoidable and outside the program’s control — but it locates it correctly. The reduction is the cause and the method’s chaos is the amplifier, in exactly the sense the site’s identity separates a backward error from a condition number.

What the spread is a function of

The drag says it plainly: at κ = 10² every partitioning takes the same number of steps and the field has nothing to show. The spread appears with the conditioning.

That is not a coincidence, it is the same κ twice. A badly conditioned matrix gives a residual whose terms cancel more — so the reductions disagree by more — and gives a method that takes many more steps for the disagreement to be amplified over. Both factors point the same way, and the refusal in this essay’s refutation is the check: on a matrix with κ = 4 the assertion that any problem shows a spread of iteration counts is fed the case and must reject, which it does at 21 steps for every partitioning.

So the operational reading is: a well-conditioned solve is reproducible for the same reason it is accurate, and a badly conditioned one is neither. There is no separate diagnosis to make.

What this costs, and what it does not

The 2.4% is worth putting in proportion, because it is easy to read the figure as alarming and easier to read it as trivial, and it is neither.

It is not an accuracy problem. Every answer is right. A user who wanted a solution to 10⁻¹⁰ got one, thirteen times.

It is a cost problem, and a small one. Sixteen extra steps out of 674 is 2.4% of a solve. Nobody’s budget turns on that.

It is a scheduling problem, and that one is not small. In a parallel program every worker has to take the same number of iterations, because the reductions are synchronisation points. If a solve is one stage of a pipeline and its length varies by 2.4% between runs, every downstream stage’s timing moves with it, and a system with a deadline has to budget for the worst case rather than the mean.

And it is a reproducibility problem, which is the one that bites. Two runs that took different numbers of steps returned different answers — not just different in the last digits, but arrived at by different trajectories. A test suite comparing an answer with a stored one is comparing across that, which is what a regression test can ask for’s subject.

The residual the test reads is not the residual

One further mechanism deserves naming, because it interacts with this one and the two are easy to confuse.

Conjugate gradients does not recompute b − Ax at every step. It updates the residual by a recurrence, r ← r − αAp, which costs nothing extra and is exact in exact arithmetic. In floating point the recurrence’s residual drifts away from the true one, and the stopping test is written in the recurrence’s — which is the residual the method reports, and the gap it measures is a quantity no stopping test can see.

So the number the test compares with a tolerance is doubly removed from what anyone wants: it is the residual of the recurrence rather than of the matrix, and it is computed by a reduction whose value depends on the partition. The two are independent and they compose. The drift is a systematic quantity bounded by a multiple of u·max‖xⱼ‖; the disagreement is a random quantity of size κ_sum·u. A run that stops early because its recurrence has drifted low is a different failure from a run that stops early because its reduction landed low, and only the first has a repair inside the method — residual replacement, one extra product every few steps.

Measured together they are why two runs of the same solve return answers a factor of 1.72 apart rather than a factor of 1.0000001. Neither mechanism alone would do it.

Two repairs, and one that looks like a repair

A fixed iteration count. Deciding in advance to run 700 steps and not to test at all removes the race completely: every machine does the same work in the same order and the only variation left is the last digits of the answer. It costs the difference between 700 and however many the problem needs, and it requires knowing the number in advance, which a rate that is known in advance says is available for the model problem and for very little else.

An order-independent reduction. Pre-rounded accumulation on the two inner products makes both of them functions of the vectors rather than of the partition, so every machine follows the same trajectory and stops at the same step. What determinism costs prices it: on a dense matrix, 5% of a step for exact accumulation and 1% for pre-rounding; on a five-point stencil, 122% and 22%. The sparse case is where the trade is real, and it is the case where the reductions are also the smallest part of the answer’s accuracy.

And the one that looks like a repair: tightening the tolerance. It does not work, and the measurement is the next essay’s: the tolerance that buys no agreement runs the same sweep at four tolerances and finds the ratio between the best and worst run at 1.34, 1.48, 1.71 and 1.17 while the accuracy improves by a factor of 1.5 million.

What a caller sees, and what they conclude

Worth walking through, because the observed symptom is not the one this essay describes and the wrong conclusion is easy to reach.

A caller does not see thirteen partition counts. They see a job that took 4 minutes 12 on Tuesday and 4 minutes 18 on Wednesday, on the same input, with the same binary. If they look at the iteration count they see 674 and 690. Nothing in either run reports a partitioning, because the partitioning is chosen inside a runtime that has no reason to mention it.

The available explanations, in the order people reach for them:

The machine was busier. Reasonable, and testable by looking at the wall-clock per iteration rather than the total — which will be flat, because the iteration count moved rather than the speed.

The input changed. Testable, and usually the first thing checked.

The library was updated. Sometimes true, and the one explanation that is both plausible and verifiable — which is why it absorbs a great deal of investigation that belongs elsewhere.

Floating point is non-deterministic. Reached last, stated as folklore, and treated as a non-explanation because it comes without a number.

The contribution of this field is the number. The two reductions in this solve have summation condition numbers of about 4·10² and 1, so their answers differ between partitionings by about 10⁻¹³, which the method amplifies over 674 steps into a residual curve that crosses the tolerance up to sixteen steps away from where it did yesterday. That is a statement somebody can act on: it says which quantity to make order-independent, what it will cost, and what to expect if they do nothing.

What a stopping test is, restated

The essay’s title is not a metaphor and it is worth ending on the literal reading.

A stopping test compares a computed number with a constant. The computed number is a reduction whose value depends on how the work was divided. The constant does not. So the comparison’s outcome depends on a division of work that no part of the program chose, and the first step at which the comparison comes out true is the outcome of a race between the residual’s fall and the arithmetic’s disagreement.

Every iterative method on this site has one. The essay that measures what a tolerance actually obtains — a tolerance that reads its own residual — asks what accuracy a given stopping value buys, and answers with a number that this field now qualifies: the accuracy obtained is what that essay says, and which step obtains it is what this one says.

The same race in three other methods

Conjugate gradients is the clean case because it has exactly two reductions and both matter. The shape recurs wherever a method’s control flow reads a computed number.

GMRES. Every step orthogonalises against every previous vector, so the reductions are a Gram–Schmidt’s worth rather than two, and the residual is available from the Hessenberg least-squares problem rather than from a recurrence. More reductions, at inner products whose κ is the orthogonality check’s — which is at the top of the census — and the same threshold crossing at the end.

Lanczos with a convergence test on the Ritz values. The test asks whether a Ritz value has settled, which is a comparison of two computed numbers rather than of one number with a constant, and the arithmetic that produces them is what an orthogonalisation nobody calls one shows is already fragile. Two builds converge different eigenvalues at different steps, which changes what the method returns rather than only when.

An inexact Newton method. The inner solve’s stopping test decides how accurate a step is, and the outer iteration reads the step. A difference of one inner iteration is a different step, which is a different linearisation point, which is a different problem for the next inner solve — the accuracy that is thrown away is the essay about how much of that inner accuracy survives, and the answer there is not much, which is the reassuring half: an outer loop that discards its inner accuracy also discards the machine’s disagreement about it.

That last point generalises, and it is the field’s one genuinely comforting result. A loop that recomputes its residual from the matrix at every step forgets what the previous step got wrong, so the disagreement does not accumulate across an outer iteration. It accumulates within one, which is what the sixteen steps here are.

At other settings

One system, one tolerance, and 2 different amounts of workConjugate gradients on a 200 × 200 symmetric positive definite matrix with κ = 100, stopped when the relative residual falls below 10⁻¹⁰, run at each of 13 partition counts. The only thing that differs between the runs is how many pieces the two global inner products were summed in — which on a real machine is the number of workers. Iteration counts run from 104 to 105, 2 of them distinct, a spread of 1.0% of the work. Every run converged and every answer is right to the accuracy asked for; the forward errors span 7.09·10⁻¹¹ to 8.48·10⁻¹¹, a factor of 1.19. What differs is not a digit at the end of an answer — it is the bill, and it is an integer.110¹100102104106108pieces the inner products were summed initerations to the tolerance104, the cheapest run105, the dearestthe same solve, pricedpartitionings run13distinct counts2spread, per cent0.96best forward error7.1·10⁻¹¹worst8.5·10⁻¹¹one matrix, one toleranceand the cost is the machine's
Fig. 2 At κ = 100 every partitioning takes the same number of steps.
One system, one tolerance, and 9 different amounts of workConjugate gradients on a 200 × 200 symmetric positive definite matrix with κ = 10⁵, stopped when the relative residual falls below 10⁻¹⁰, run at each of 13 partition counts. The only thing that differs between the runs is how many pieces the two global inner products were summed in — which on a real machine is the number of workers. Iteration counts run from 1641 to 1655, 9 of them distinct, a spread of 0.9% of the work. Every run converged and every answer is right to the accuracy asked for; the forward errors span 7·10⁻¹¹ to 7.43·10⁻¹¹, a factor of 1.06. What differs is not a digit at the end of an answer — it is the bill, and it is an integer.110¹16371640164316461649165216551658pieces the inner products were summed initerations to the tolerance1641, the cheapest run1655, the dearestthe same solve, pricedpartitionings run13distinct counts9spread, per cent0.85best forward error7·10⁻¹¹worst7.4·10⁻¹¹one matrix, one toleranceand the cost is the machine's
Fig. 3 And at 10⁵, where the method takes thousands of steps and the spread grows with them.
Asking for more accuracy buys accuracy, and buys no agreement at allConjugate gradients on a 200 × 200 matrix with κ = 10⁴, solved at four tolerances, seven partition counts each. The bar at each tolerance spans the smallest and largest forward error the seven runs produced. The bars fall by 1.5·10⁶ across the sweep, which is the tolerance doing exactly what it is for. The ratio between the top and bottom of each bar is 1.34, 1.48, 1.71, 1.17, which does not fall with the tolerance. So the disagreement between machines is not a residue of an insufficiently converged answer that a tighter tolerance would remove; it is proportional to whatever accuracy was reached, and the runs stay a fixed factor apart all the way down.-12-10-8-610⁻¹³10⁻¹¹10⁻⁹10⁻⁷log₁₀ of the residual tolerance asked forforward error of the answer1.34×1.48×1.71×1.17×the band does not closetolerances swept4runs at each7accuracy gained1.5·10⁶ratio at 10⁻⁶1.3ratio at 10⁻¹²1.2the bars falland they keep their height
Fig. 4 The same sweep at four tolerances, which is where the obvious repair is tested.
The smallest defect a regression test can catch, on a machine that will not repeat itselfA 150 × 150 system with κ = 10⁴, solved by conjugate gradients to 10⁻¹⁰ on six partitionings. The shaded band is how far the answer moves across those six when nothing at all is wrong: 3.24·10⁻¹², relative. Each pair of dots is one defect — a single entry of the matrix changed by a relative δ, an assembly slip or a stale coefficient — solved on the same six machines, showing its nearest and furthest run. A defect is catchable only when its nearest run clears the band, because a test whose threshold sits inside the band fails a correct build. Everything at or below 10⁻¹³ overlaps and is invisible; 10⁻¹² is the smallest that separates, at 4.61·10⁻¹². So the tolerance exists, it is bracketed between 3.24·10⁻¹² and 4.61·10⁻¹² — a factor of 1.42 — and it is neither zero nor the 10⁻⁸ that usually gets typed.-15-13-11-910⁻¹³10⁻¹¹10⁻⁹10⁻⁷log₁₀ of the defect, relative to the entry it sits inhow far the answer movedthe machine, on its owna tolerance with two sidesmachine band3.2·10⁻¹²smallest caught10⁻¹²its nearest run4.6·10⁻¹²defects hidden3window, factor1.4below the band nothing is visibleand above it everything is
Fig. 5 And what a test suite can ask for once the trajectory is not stable.
The numerical rank of one matrix is 10, 12, or somewhere betweenSingular values of one 60 × 14 matrix whose spectrum falls by a fixed factor per index, so there is no gap anywhere and the threshold decides the rank. Each curve is the same matrix, its Gram matrix formed with the inner products summed in a different number of pieces. The curves lie on top of each other for the first several values and separate below about 7.3·10⁻¹³, which is where forming AᵀA has put the rounding. The dashed line is the threshold, σ₁ · 10⁻¹⁴. Counting the values above it gives 12 at p = 1, 12 at p = 2, 12 at p = 4, 10 at p = 8, 10 at p = 16, 11 at p = 32, 11 at p = 60 — the rank of one matrix, as a function of how many workers were available. Not a digit of an answer: the number of columns a model built from this matrix would have.13579111310⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹index ksingular valueσ₁ · 10⁻¹⁴, the thresholdone matrix, three rankspartitionings7lowest rank10highest rank12threshold7.3·10⁻¹⁴σ₁7.3the curves separate in the noiseand the threshold is drawn through it
Fig. 6 The same mechanism deciding a rank rather than a step count.
The same 4096 numbers, added up 26 ways, 21 different answersEach dot is one reduction of one vector of 4096 binary64 numbers whose summation condition number is 1.01·10⁸: the vector is cut into p contiguous pieces, each piece summed left to right, and the pieces combined in a tree. The vertical position is the distance from the exactly rounded sum, relative. Filled dots are the static split a fixed thread count gives; open dots are unequal splits, which is what a work-stealing scheduler produces at the same p. 21 of the 26 runs returned distinct values, spanning 1.55·10⁻¹³ — 2.3·10⁷ ulps of the answer. The dashed line is the classical bound γ₍ₙ₋₁₎Σ|xᵢ|, which every one of them satisfies with 2.58·10⁴ to spare, and which is the same number for all of them: it contains n and Σ|xᵢ| and nothing about the order.110¹10⁻¹¹10⁻⁸10⁻⁵pieces the vector was divided intodistance from the exact sum, relativethe published boundκ · uone vector, one algorithmdistinct answers21runs26spread, in ulps2.3·10⁷κ of the sum10⁸bound ÷ worst error2.6·10⁴nobody chose pand no answer is the answer
Fig. 7 The disagreement that starts the chain.
The summation condition number of six inner products this site already computesκ = Σ|xᵢ| ÷ |Σxᵢ| for six reductions taken from computations elsewhere on this site, at 64 terms: an orthogonality check between two columns of a Q, one component of a residual b − Ax on an ill-conditioned system, a nearly degenerate 2 × 2 determinant, a Hutchinson trace probe zᵀAz, a residual norm rᵀr, and a curvature pᵀAp. The range is 1 to 1.01·10¹⁷. The two at the safe end are sums of squares, where no term can cancel another; the three above 10¹⁰ are the orthogonality check, the residual and the determinant — which is to say every quantity a stopping test, an orthogonality test or an orientation test is written in. The reductions that are reproducible are the ones nobody makes a decision from.κ of the suma component of b − Ax1.01·10¹⁷ad − bc, near-degenerate3.6·10¹⁶qᵢᵀqⱼ, an orthogonality check7.39·10¹⁵pᵀAp, a curvature409zᵀAz, a trace probe41.8rᵀr, a residual norm1measured, not assumedhighest10¹⁷lowest1above 10¹⁰3terms64sums of squares are safeand nobody decides anything from one
Fig. 8 Where this method’s two reductions sit among the site’s others.
Five summation policies, 400 permutations each, and how many answers each returnedThe same 1,024 numbers, summation condition number 10⁸, presented in 400 different orders. The bar is the number of distinct binary64 values the policy returned; the figure beside it is the worst relative error it made. A single accumulator returns 303 values and eight pieces return 72; Kahan's compensated loop is the most accurate of the three at 4.96·10⁻¹⁰ and still returns 119. Pre-rounded summation returns one value, at an error of 4.91·10⁻⁶ — four orders worse than the compensated loop and the same on every machine. Exact accumulation returns one value and the right one. The comparison is bitwise because the claim is bitwise: a tolerance here would pass everything.distinct answersone accumulator303eight pieces72compensated119pre-rounded1exact1worst error 1.17·10⁻⁸worst error 4.61·10⁻⁹worst error 4.96·10⁻¹⁰worst error 4.91·10⁻⁶worst error 0bitwise, or not at allpermutations400one accumulator303pre-rounded1its error4.9·10⁻⁶compensated error5·10⁻¹⁰accuracy and agreement are different propertiesand the accurate one is not the agreed one
Fig. 9 The policies that would remove it.
Six ways to add up a vector, priced against what they returnBinary64 operations per element on the horizontal axis and relative error on the vertical, for one vector of 2,048 numbers with a summation condition number of 1.05·10⁶. Filled markers are the policies whose answer does not depend on the order the terms arrive in; open markers are the ones whose answer does. The cheapest order-independent policy costs 3 operations an element — a divide, a round and an add — and is 2.29·10⁻⁷ wrong; the most accurate policy here is pre-rounded, two passes at 7. Nothing sits in the bottom left. The cost of an answer that is the same on every machine is between three and twelve times the cost of an answer that is not, and the two-pass pre-rounded policy is the one worth knowing about: seven operations, order-independent, and accurate.02468101210⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸binary64 operations per elementrelative errorruntime orderfixed partitionpre-rounded, one passpre-rounded, two passescompensated (Kahan)exact accumulationwhat determinism costsreproducible policies3cheapest, ops/element3its error2.3·10⁻⁷two passes10⁻¹⁷ordinary, 8 pieces2.7·10⁻¹¹nothing is cheap and exactthe middle of the figure is the answer
Fig. 10 And what they cost.
Conjugate gradients at κ = 104, against the bound κ permitsA semi-logarithmic plot of the relative A-norm error against iteration count. The measured curve falls below a smooth dashed curve showing the classical condition-number bound.0408012016020024010⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹iteration‖e‖_A / ‖e₀‖_Ameasuredκ bound119 steps40×40, spectrum spread evenly in logbound permits 1417
Fig. 11 The convergence this figure counts the steps of.
The residual basis of conjugate gradients, at κ = 106A semi-logarithmic plot against iteration count showing the loss of orthogonality among the residual vectors rising while the relative residual falls.05101520253010⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹iteration‖RᵀR − I‖ and ‖r‖/‖b‖step n‖RᵀR − I‖residual30×30, run for exactly n stepsexact arithmetic would end here
Fig. 12 The loss of orthogonality that supplies the amplification.
The accuracy asked for, against the accuracy obtained, for two kernels on one partitionε is applied to each block against that block's own largest singular value; the error is then reported against the whole matrix's norm. The two are not the same number and the dashed diagonal is where they would be. For 1/r the obtained error is 29 times smaller than the tolerance asked for; for log r on the identical partition it is 13 times smaller. Both curves are straight and parallel to the diagonal, so the knob does what a knob should — a decade in buys a decade out — and neither of them sits on it. The factor is how much of the matrix's mass lives off the diagonal, which is a property of the kernel; it is not the number of blocks, which is 112 and would put the curves on the other side of the diagonal.10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10⁻¹⁵10⁻¹²10⁻⁹10⁻⁶10⁻³ε asked for, per block‖A − A_H‖ ⁄ ‖A‖ obtainedasked = obtainedlog r1 ⁄ rtwo numbers, not one1/r, obtained at 10⁻⁸3.4·10⁻¹⁰log r, obtained at 10⁻⁸7.8·10⁻¹⁰1/r, obtained ⁄ asked0.034log r, obtained ⁄ asked0.078blocks in the partition112the tolerance is per blockand the error is per matrix
Fig. 13 What a stopping value actually obtains, which this essay qualifies rather than contradicts.
The residual conjugate gradients reports and the residual of the vector it holds, along one runA 50×50 diagonal matrix with one eigenvalue at 10⁻¹⁰ and the rest between 1 and 50, so every product with it is exact to a rounding and nothing below can be blamed on the operator. The lower curve is r ← r − αAp, updated by the recurrence, which is what a stopping test reads. The upper curve is ‖b − Ax‖/‖b‖, recomputed from the iterate. They start as the same vector and end 8.6·10⁸ apart, with the reported one at 6.89·10⁻²¹ — below the unit roundoff of 1.11·10⁻¹⁶, which is the shortest proof available that it is not the residual of anything.0122436486072849610⁻²²10⁻¹⁸10⁻¹⁴10⁻¹⁰10⁻⁶10⁻²conjugate gradient iterationrelative residualthe unit roundoff, 1.11·10⁻¹⁶the answer's residualthe residual reportedtwo residuals, one runreported, at its best6.9·10⁻²¹the answer's, at its best5.9·10⁻¹²unit roundoff1.1·10⁻¹⁶largest iterate on the way9.3·10⁹iterations drawn96the recurrence remembers every roundingand the stopping test is written in it
Fig. 14 Two residuals for one iteration, only one of which a stopping test can see.
Backward and forward error against the condition numberA log–log plot over twelve decades of condition number. The backward error is a flat line at ten to the minus sixteen; the forward error rises in proportion to the condition number.110²10⁴10⁶10⁸10¹⁰10¹²10¹⁴10⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹condition number κ(A)relative errorforward errorbackward errorpredicted: κ · u8×8, 20 seeds per κ; dashed is the worstthe problem worsens, not the method
Fig. 15 And the gap between what it sees and what it is about.
Communication for a 512×12 factorisation on 16 processorsTwo counts for the same factorisation. Rounds on the critical path: 48 for the column sweep, 4 for the reduction tree, 4 for Cholesky QR — a factor of n between the first and the other two. Words sent: 1170, 1170 and 2160 — the sweep and the tree send the same number, and the method with the fewest rounds sends the most.rounds on the critical pathHouseholder sweep48reduction tree4Cholesky QR4words sentHouseholder sweep1170reduction tree1170Cholesky QR2160two counts, two rankingsrounds, sweep ÷ tree12words, Cholesky ÷ tree1.8arithmetic, tree ÷ sweep1.5the rounds separate the threeand the words do not
Fig. 16 The synchronisation points these two reductions are.
Error of a difference quotient for J(x)v against ε, on the Bratu problem at n = 64The Jacobian of this problem is a formula, so the error of each quotient is measured against a derivative that is exact rather than against a better quotient. The forward difference falls with a slope of 1.01 — first order — reaches 1.28·10⁻¹⁰ at ε = 10^-6, and rises again with a slope of -1.00 as cancellation takes over. The central difference falls with a slope of 2.00 and bottoms at 1.11·10⁻¹² for two residual evaluations instead of one. Neither gets near the unit roundoff at any ε.10⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³10⁻¹10⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1εrelative error in J(x)vforwardcentralcancellationtruncationagainst a derivative that is exactforward floor1.3·10⁻¹⁰central floor1.1·10⁻¹²truncation slope, forward1truncation slope, central2no ε reaches the roundoffand the analytic derivative is free of the choice
Fig. 17 A floor under a computed difference, which is what the stopping test is reading near convergence.
A determinant of one, computed as zero by the expression that is written downThe matrix [[x+2, x+1], [x+3, x+2]] at x = 2ᵏ has determinant exactly 1 at every k. The two products are x² + 4x + 4 and x² + 4x + 3, so they differ by one part in x², and above k = 26 they round to the same binary64 number. Relative error of two evaluations: ad − bc as written, which is exact until k = 27 and then returns zero at every larger size; and Kahan's form, w = bc, e = bc − w recovered by the fusion, (ad − w) − e, which is exact throughout. The difference between them is one rounding of one product — a relative 10⁻¹⁶ — and it is the whole of the answer, because the subtraction that follows removes everything else. Both forms are IEEE-754 conforming and a compiler may emit either from the same source.2022242628303210⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²k, where the entries are near 2ᵏrelative error of the determinantas writtenfused: exactproducts need 54 bitsone rounding, the whole answertrue determinant1naive, k = 300fused, k = 301first wrong at k27sizes returning 06both forms conformand the source does not say which
Fig. 18 The field’s other cause, one instruction wide.
Two conforming builds, one matrix, and 26 different verdicts in 200 triesForty 6 × 6 Gram matrices at each of five conditionings, each formed exactly from a tall matrix whose last column is nearly the sum of its first two. Every one of them is asked *are you positive definite* by a Cholesky, once with the inner products accumulated with a single rounding per term and once with each product rounded before it is subtracted. The bar is how many of the forty came back with different verdicts: 7 at 10⁻⁸, 2 at 10⁻⁹, 4 at 10⁻¹⁰, 10 at 10⁻¹¹, 3 at 10⁻¹². The two shaded parts split those by which build was right, settled by the signs of the leading principal minors computed in BigInt rationals — 9 to the fused form and 17 to the rounded one. So neither is the correct implementation. The verdict is a property of the build, and the answer to which build is right is a property of the matrix.-12-11-10-9-8024681012log₁₀ of how nearly dependent the columns areverdicts that disagreed, of 40724103which one is correctmatrices tested200verdicts disagreed26fused was right9unfused was right17lower part: thefused build was righta sign has no last digitso a verdict has nowhere to hide
Fig. 19 And the verdict it decides.
What the runs disagree by, and what the bound says they mightOver ten decades of summation condition number, on vectors of 2048 numbers: the measured spread between seven partitioned reductions of the same vector, the quantity κu, and the classical error bound γ₍ₙ₋₁₎Σ|xᵢ| relative to the sum. The measured spread and κu are one curve times a constant — the ratio runs from 0.253 to 0.258 across the whole sweep, a spread of 1.021 while both quantities move by ten orders. The bound sits 7932 to 8100 above the disagreement and is identical for every ordering, which is what makes it useless for the question a reader actually has: not how wrong is this, but will the next run say the same.10²10⁴10⁶10⁸10¹⁰10¹²10⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹κ of the sumrelative sizethe boundκ · umeasured spreadtwo curves and one constantspread ÷ κu, low0.25spread ÷ κu, high0.26bound ÷ spread, low7932decades swept10the spread is computablethe bound cannot see the order
Fig. 20 The size of the perturbation this whole chain amplifies.
Forward error of a 6×6 Hilbert solve at eight precisionsA bar for each significand width from 12 to 53 bits showing the relative error in the computed solution, with the condition number times the unit roundoff marked as a prediction.κ = 1.5·10⁷ · the exact answer is (1, 2, …, 6)12 bits3.316 bits0.8620 bits4.324 bits0.09330 bits7.6·10⁻⁴36 bits6.2·10⁻⁶43 bits2·10⁻⁷53 bits4.5·10⁻¹¹dashed: κ · unit roundoffone matrix, eight arithmeticsmeasured against a known answer
Fig. 21 The knob that moves the accuracy of every run and none of their disagreement.
The spectrum of C⁻¹T against T's own, n = 64, ρ = 0.8Two sorted spectra on a linear vertical axis. The unpreconditioned Toeplitz matrix spreads its eigenvalues across its whole range; the preconditioned operator puts 97% of them within a tenth of 1, with 0 below zero.08162432404856640123456789index, sortedeigenvalueT aloneC⁻¹Teigenvalues, not singular valuesfraction within 0.1 of 10.97eigenvalues below zero0λ_min of the preconditioner0.11the dashed line is 1, where the cluster formsthe solid line is zero
Fig. 22 A spectrum whose clustering decides a rate, computed from sums of exactly this kind.
Two condition numbers of one 8×8 system, as its rows are put into different unitsFour curves against the spread of the row units, in decades. κ_∞ of the scaled matrix rises from 9.83 to 1.9·10¹⁰ while the componentwise condition number stays at 6.98 throughout — the same system, the same solution, and one of the two numbers is a fact about the units. Hilbert's two numbers are drawn flat beside them at 3.4·10¹⁰ and 1.2·10¹⁰: a matrix whose sensitivity no scaling repairs.0246810110²10⁴10⁶10⁸10¹⁰10¹²spread of the row units (decades)condition numberκ_∞(DA)cond(DA)Hilbert κ_∞Hilbert condone system, two numbersκ_∞ at no spread9.8κ_∞ at 10 decades1.9·10¹⁰cond, either end7Hilbert, equilibrated1.3·10¹⁰the solution is the same at every spreadand one of these curves knows it
Fig. 23 Units, which are an author of error wearing its usual disguise.
Backward and forward error of two routes to x, on 30×30 systems across eight decades of κBoth routes start from the same LU factorisation. The LU solve's backward error is 2.2·10⁻¹⁷ at every conditioning — a flat line at the unit roundoff. Multiplying by the explicitly formed inverse gives 4.5·10⁻⁵ at κ = 10¹⁴, a slope of 0.94 against κ. The two forward errors, drawn above them, are 2.8·10⁻⁴ and 0.015 — within a factor of 54, which is why the difference between the two methods is invisible to anyone measuring how wrong the answer is.10²10⁴10⁶10⁸10¹⁰10¹²10¹⁴10⁻¹⁸10⁻¹⁵10⁻¹²10⁻⁹10⁻⁶10⁻³1κ₂(A)relative errorforward, A⁻¹bforward, A\bbackward, A⁻¹bbackward, A\bat κ = 10¹⁴η, LU solve2.2·10⁻¹⁷η, via the inverse4.5·10⁻⁵forward, LU solve2.8·10⁻⁴forward, via the inverse0.015one factorisation, two ways to use itand one of them forfeits the backward error
Fig. 24 Two routes to one answer, differing by orders in the backward error.
What 12 members of a sequence cost, by what changes between themEvery bar is 12 solves of an 120×120 system, costed in multiplications with a dense Cholesky at n³/3 and a solve at 4n². When nothing changes the answer is reused and the cost is one factorisation. When only the right-hand side changes, one factorisation serves every member — 16.5 per cent of the independent cost, with every solve still at a relative residual of 1.54·10⁻¹³. When the matrix drifts, the factorisation is reusable for a while and the while has to be measured: 4 factorisations for 12 members. When everything changes, nothing carries.nothing8.3%the right-hand side16.5%the matrix, slowly85.9%everything100.0%what can be reused: the answerwhat can be reused: the factorisationwhat can be reused: the factorisation, for a whilewhat can be reused: nothingshare of the cost of a sequence that shares nothingwhat 12 members cost in factorisationssame: factorisations1rhs: factorisations1drift: factorisations4independent: factorisations12what changes between the membersdecides what may be carried
Fig. 25 The cost of solving the same problem again, where a spread in step counts is paid repeatedly.
160 single-probe estimates of one 40×40 trace, from the two standard probe distributionsTwo clouds of points, each one estimate of the trace from one random vector. Both are centred on the true value of 171.14 — the estimator has no bias at all — and the dashed bands are the standard deviation each distribution is known in closed form to have: 59.14 for the ±1 probe and 72.01 for the normal one. Measured over these draws they come out 56.68 and 68.57.027548110813544119.306194.613269.919345.226420.532drawzᵀAz from one probenormal±1two routes to one spreadthe trace171±1 spread, predicted59±1 spread, measured57normal ÷ ±11.2no bias in either cloudand one of them is narrower for a reason
Fig. 26 A spread that comes from a deliberate random draw rather than from a scheduler.
Four pivot rules on [[ε, 1], [1, 1]] with ε = 10⁻¹², before and after its first row is scaled by 1/εEight bars of forward error. On the matrix as given, no pivoting loses the answer entirely and all three pivot rules return it to rounding. Multiply the first row by 1/ε — which does not change the solution — and partial pivoting makes no interchange at all and returns the same wrong answer that no pivoting does. Scaled partial pivoting and complete pivoting are unmoved.forward error, relative to a solution of exactly (1, 1)no pivoting · as given1.3·10⁻⁴ 0 interchangesno pivoting · rows scaled1.2·10⁻⁴ 0 interchangespartial · as given2.2·10⁻¹⁶ 1 interchangepartial · rows scaled1.2·10⁻⁴ 0 interchangesscaled partial · as given2.2·10⁻¹⁶ 1 interchangescaled partial · rows scaled2.2·10⁻¹⁶ 1 interchangecomplete · as given1.1·10⁻¹⁶ 1 interchangecomplete · rows scaled2.2·10⁻¹⁶ 1 interchangethe same problem twicepartial, as given2.2·10⁻¹⁶partial, rows scaled1.2·10⁻⁴its relative residual1.2·10⁻¹⁶complete, rows scaled2.2·10⁻¹⁶the two systems have the same solutionand one pivot rule cannot see it
Fig. 27 A decision that looks like an algorithm and is a scaling.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

All reduceConjugate gradientsReduction orderResidualRun-to-run variationStopping criterionSynchronisationTolerance