The matrix a constraint makes

The step was coarser than the test

Conjugate gradients stopped at a residual tolerance hands back energy errors far below what was asked, and that was read as the fault of the test. So the inner solve here stops on an estimate of the error itself, which was predicted to make the outer step rule count within one on 180 of 198 runs. It counts 154, against 156 for the residual. The estimate is honest: with two steps of look-ahead no run overshoots tenfold. But on 82 of 132 runs the two tests land on the same iterate to within a factor of two, because on these blocks the error falls gently for nine or eleven steps and then drops by orders in the last. A second prediction fails too: a fixed perturbation on the three smallest eigenvectors matches the real solve on four systems of twelve, no more than one spread evenly, and under two per cent of the real error lies on them.

Worth reading first: Three eigenvalues, and two are the golden ratio · A parameter that counts steps · The spectrum that predicts nothing.

A tolerance is not an accuracy put a real inner iteration into the first block of a triangular saddle-point preconditioner, under flexible GMRES, in place of the fixed perturbation that had been standing in for one. It found that the number typed as a tolerance is not the error handed back. Conjugate gradients stopped at a relative residual τ\tau delivered energy errors ten to a billion times below τ\tau, and the outer residual followed the error it was actually given, with a constant ten to a hundred times the fixed model’s. The step rule that had counted the outer steps on nine runs in ten counted four in five.

That essay left two signed predictions. The first was about where the error lay: if the larger constant comes from conjugate gradients concentrating its error in a few eigenvectors of the block HH, then a fixed model with its perturbation placed on those eigenvectors should reproduce it, within a factor of three on at least nine of twelve systems. The second was about the test: stop on the error delivered instead of the residual, and the rule “written in η\eta” should count within one on at least 180 of 198 runs, “because the error each application delivers then sits within a factor of a few of the target instead of anywhere below it”.

Both fail, and for the same underlying reason, one that neither the prediction nor the essay before it had looked at. The reason is visible on a single inner solve, and the second half of this essay is mostly what follows from it.

An estimate that is already being computed

Conjugate gradients from a zero start carries an unusual identity. The squared error of its iterate in the block’s own norm is the sum of αj∥rj∥2\alpha_j \|r_j\|^2 over all the steps still to come, and the squared norm of the iterate itself is the sum of the same terms over the steps already taken. Hestenes and Stiefel wrote this down in the paper that introduced the method. So truncating the first sum after dd terms gives a lower bound on the error of the iterate dd steps back, and dividing by the second sum makes it relative. It needs no extra product, only the numbers the iteration already computes, and it pays dd further steps past the iterate it returns.

Here the inner solve runs until that estimate falls to a target η\eta, and returns the iterate it refers to. The look-ahead is one, two or four steps. Everything else is the same as the residual-stopped measurement: eighteen systems of three shapes, block condition numbers of 1, 10210^2 and 10410^4, constraint condition numbers of 10 and 10410^4, an exact Schur complement, eleven targets from 10−1210^{-12} to 10−210^{-2}. On the six systems where the block is the identity the inner solve is exact in one step whatever is asked, as before, so the comparisons use the other twelve.

As an estimate it does what is claimed. With two steps of look-ahead no run on any system at any target hands back a median error more than ten times the target, and the largest over all runs is 0.79 of it. With one step of look-ahead four runs do overshoot tenfold, and that is the known weakness of a one-term estimate, which can be misled by a single short step. So two is the setting used below, and it is honest in the direction that matters.

The two tests mostly land on the same iterate

The energy error each inner solve delivers over the target 0.000001, median over the solves of one run, under a stop on the estimated energy error and under a stop on the residual, for twelve systems12×5, κ(H) 10², κ(A) 10: energy stop 5.2e-1, residual stop 3.9e-4; 12×5, κ(H) 10², κ(A) 10⁴: energy stop 2.6e-2, residual stop 2.6e-2; 12×5, κ(H) 10⁴, κ(A) 10: energy stop 2.2e-2, residual stop 1.6e-2; 12×5, κ(H) 10⁴, κ(A) 10⁴: energy stop 3.9e-2, residual stop 3.9e-2; 9×6, κ(H) 10², κ(A) 10: energy stop 6.6e-4, residual stop 6.6e-4; 9×6, κ(H) 10², κ(A) 10⁴: energy stop 1.7e-3, residual stop 1.7e-3; 9×6, κ(H) 10⁴, κ(A) 10: energy stop 5.4e-2, residual stop 2.1e-2; 9×6, κ(H) 10⁴, κ(A) 10⁴: energy stop 2.6e-1, residual stop 2.6e-1; 14×2, κ(H) 10², κ(A) 10: energy stop 7.4e-3, residual stop 7.4e-3; 14×2, κ(H) 10², κ(A) 10⁴: energy stop 6.1e-2, residual stop 7.2e-3; 14×2, κ(H) 10⁴, κ(A) 10: energy stop 9.5e-2, residual stop 8.4e-2; 14×2, κ(H) 10⁴, κ(A) 10⁴: energy stop 2.3e-1, residual stop 2.3e-1.10⁻⁸10⁻⁶10⁻⁴10⁻²112×5, κ(H) 10², κ(A) 10: energy stopresidual stop12×5, κ(H) 10², κ(A) 10⁴: energy stopresidual stop12×5, κ(H) 10⁴, κ(A) 10: energy stopresidual stop12×5, κ(H) 10⁴, κ(A) 10⁴: energy stopresidual stop9×6, κ(H) 10², κ(A) 10: energy stopresidual stop9×6, κ(H) 10², κ(A) 10⁴: energy stopresidual stop9×6, κ(H) 10⁴, κ(A) 10: energy stopresidual stop9×6, κ(H) 10⁴, κ(A) 10⁴: energy stopresidual stop14×2, κ(H) 10², κ(A) 10: energy stopresidual stop14×2, κ(H) 10², κ(A) 10⁴: energy stopresidual stop14×2, κ(H) 10⁴, κ(A) 10: energy stopresidual stop14×2, κ(H) 10⁴, κ(A) 10⁴: energy stopresidual stopenergy error delivered over the targetfloored at 10⁻⁸ · one is exactly on targetmostly the same iterate
Fig. 1 The energy error delivered over the target, median over the solves of one run, under the energy stop (blue) and the residual stop (red), for twelve systems. The dial sets the target.

Now turn the dial on this figure. The prediction expects the blue dots to sit near one, a factor of a few below the target, and the red ones anywhere further left. At a target of 10−610^{-6} the two are on top of each other on most rows, and both are well to the left of one. The energy stop’s median over all runs is 0.054 of the target and its lowest is about 10−710^{-7} of it. It is true that this is a good deal tighter than the ten to a billion the earlier essay reported for its worst cases. But the red dots here are at the same place as the blue.

Counted across the twelve systems and eleven targets, 82 of 132 runs deliver the same median error under the two stops to within a factor of two. On 32 the energy stop returns a larger error, which is the behaviour it was meant to have, and on 18 a smaller one, which it was not. Replacing the test has changed the answer on barely a third of the runs, and in no consistent direction.

If two different tests stop at the same place, the reason is unlikely to be in either test. It has to be in what they are testing.

One inner solve's relative energy error against its step, for three blocks: conjugate gradients on a twelve-by-twelve or nine-by-nine block with one right-hand side12 unknowns, κ(H) 10⁴: 1e+0, 1e+0, 9e-1, 9e-1, 9e-1, 9e-1, 8e-1, 6e-1, 4e-1, 2e-1, 2e-1, 1e-1; 9 unknowns, κ(H) 10²: 9e-1, 8e-1, 6e-1, 4e-1, 3e-1, 2e-1, 1e-1, 5e-2, 1e-11; 12 unknowns, κ(H) 10²: 9e-1, 7e-1, 6e-1, 5e-1, 3e-1, 3e-1, 2e-1, 1e-1, 5e-2, 3e-2, 4e-3, 1e-7.02468101210⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1inner steprelative energy error12 unknowns, κ(H) 10⁴9 unknowns, κ(H) 10²12 unknowns, κ(H) 10²conjugate gradients from zerothe accuracy arrives in the last step
Fig. 2 One inner solve’s relative energy error against its step, on three blocks, one right-hand side each. The accuracy does not arrive gradually.

There it is. On the nine-by-nine block with a condition number of 100 the relative energy error is 0.9, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1 and 0.05 through eight steps, and at the ninth it is 10−1110^{-11}. On the twelve-by-twelve block the same pattern runs for eleven steps to 0.004 and the twelfth is 10−710^{-7}. On a block with a condition number of 10410^4 there is no fall at all to speak of until the last few steps. These blocks have a dozen distinct eigenvalues spread evenly in the logarithm, and conjugate gradients finds the answer exactly when it has found all of them, up to rounding. Its error is a smooth descent into a cliff, and the cliff is the end of the space.

So any test at all, with a target anywhere from 10−210^{-2} to 10−1010^{-10}, is deciding between “before the cliff” and “after the cliff”. The residual and the energy error both read large on one side and tiny on the other. That is what “a tolerance is not an accuracy” was seeing, and the sentence is still true, but the blame it implied was misplaced: a stop asked for 10−610^{-6} and handed back 10−1110^{-11} has not been fooled by a residual. It has been offered 0.05 and 10−1110^{-11} and nothing in between. Finite termination is the mechanism the first block’s small size imposes, and it is the same one the outer iteration relies on when it stops in two steps.

What the rule’s misses were

On how many of 18 systems the step rule misses the outer count by more than one, at each target, under each stoptarget 1e-12: 1 under the energy stop, 3 under the residual stop; target 1e-11: 1 under the energy stop, 2 under the residual stop; target 1e-10: 0 under the energy stop, 1 under the residual stop; target 1e-9: 1 under the energy stop, 0 under the residual stop; target 1e-8: 1 under the energy stop, 0 under the residual stop; target 1e-7: 1 under the energy stop, 1 under the residual stop; target 0.000001: 4 under the energy stop, 2 under the residual stop; target 0.00001: 5 under the energy stop, 5 under the residual stop; target 0.0001: 8 under the energy stop, 6 under the residual stop; target 0.001: 11 under the energy stop, 8 under the residual stop; target 0.01: 11 under the energy stop, 12 under the residual stop.061218target 10⁻¹²: energy stop1residual stop3target 10⁻¹¹: energy stop1residual stop2target 10⁻¹⁰: energy stop0residual stop1target 10⁻⁹: energy stop1residual stop0target 10⁻⁸: energy stop1residual stop0target 10⁻⁷: energy stop1residual stop1target 10⁻⁶: energy stop4residual stop2target 10⁻⁵: energy stop5residual stop5target 10⁻⁴: energy stop8residual stop6target 10⁻³: energy stop11residual stop8target 10⁻²: energy stop11residual stop12systems of 18 the rule missesthe rule's constant read at 10⁻⁶tight targets count; loose ones do not
Fig. 3 On how many of 18 systems the step rule misses the outer count by more than one, at each target, under each stop. Its constant is read at 10−610^{-6}.

The prediction’s number was 180 of 198. The rule written in η\eta counts within one on 154. The residual stop had counted 156 written in its tolerance and 158 written in the accuracy delivered, so the improvement has a slightly negative sign. The claim of 180 is false by twenty-six runs.

What the figure adds is where the misses are. The rule is excellent at tight targets: at 10−710^{-7} and below it misses 5 of 108 under the energy stop and 7 of 108 under the residual stop. And it falls off a shelf above that: 39 of 90 under the first and 33 of 90 under the second, reaching eleven or twelve of eighteen at the two loosest targets. So the difference between the two stops is noise, and the real division is between tight targets and loose ones.

The outer residual of flexible GMRES against the step at three targets, on the twelve-by-five system with κ(H) ten thousand and κ(A) ten, with each inner solve stopped on its estimated energy errorat 1e-8: 1e+0, 1e+0, 4e-6, 1e-6, 2e-12; at 0.0001: 1e+0, 1e+0, 1e-2, 2e-3, 1e-8, 2e-9, 1e-12; at 0.01: 1e+0, 1e+0, 1e+0, 7e-1, 3e-2, 9e-6, 2e-6, 1e-7, 4e-8, 2e-11.024681010⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²1outer steprelative residualtarget 10⁻⁸target 10⁻⁴target 10⁻²12 × 5 · κ(H) 10⁴ · κ(A) 10the pairs are gone by the loose target
Fig. 4 The outer residual against the step at three targets on one system, with the energy stop. The rule assumes one factor every two steps.

The rule ⌈2log⁡tol/log⁡cτ⌉\lceil 2 \log \mathrm{tol} / \log c\tau \rceil assumes the residual falls by one factor of cτc\tau every two steps. At a target of 10−810^{-8} on this system that is what happens: 11, 11, 4⋅10−64 \cdot 10^{-6}, 10−610^{-6}, 2⋅10−122 \cdot 10^{-12}, and the pairs are plain to see, one large drop for each two steps. A square root the residual does not pay derived that from the double root at one in GMRES’s polynomial. At 10−410^{-4} the pairs still exist, but they are no longer equal: the first drop is to 10−210^{-2}, and the second takes it to 10−810^{-8}, a factor of a million where the rule expects another hundred. At 10−210^{-2} they have gone: the residual sits at one for three steps and then falls irregularly for six more. By then an inner solve is not close to the block’s inverse at all, the eigenvalue pairs the argument counted on have no remaining reason to stay paired, and the rule’s reasoning does not apply. No choice of stopping test would change that, and the same collapse occurs whichever test is used.

The perturbation in chosen directions

The other prediction asked where in the block the error lies, and whether a fixed model that puts its perturbation there reproduces what a real solve does. It started from a plausible idea: conjugate gradients removes the error along the large, well-separated eigenvalues first, so what is left should sit on the small ones.

A fixed perturbation's two-step residual over the real solve's, at the energy error the real solve delivers, with the perturbation on the three smallest eigenvectors of H, spread evenly, or on the three largest, for twelve systems12×5, κ(H) 10², κ(A) 10: smallest 1.2e-2, spread 9.5e-4, largest 1.3e-4; 12×5, κ(H) 10², κ(A) 10⁴: smallest 2.2e-1, spread 3.2e-1, largest 9.7e-3; 12×5, κ(H) 10⁴, κ(A) 10: smallest 2.4e+0, spread 5.6e-1, largest 6.4e-4; 12×5, κ(H) 10⁴, κ(A) 10⁴: smallest 1.3e+0, spread 7.2e-1, largest 2.4e-2; 9×6, κ(H) 10², κ(A) 10: smallest 2.5e+0, spread 4.3e-1, largest 1.4e-1; 9×6, κ(H) 10², κ(A) 10⁴: smallest 2.1e-1, spread 2.6e-1, largest 6.6e-2; 9×6, κ(H) 10⁴, κ(A) 10: smallest 2.5e+0, spread 1.1e+0, largest 9.3e-3; 9×6, κ(H) 10⁴, κ(A) 10⁴: smallest 2.6e-2, spread 4.1e-2, largest 1.0e-3; 14×2, κ(H) 10², κ(A) 10: smallest 6.6e-2, spread 4.4e-2, largest 1.7e-2; 14×2, κ(H) 10², κ(A) 10⁴: smallest 2.4e-5, spread 6.2e-5, largest 2.7e-5; 14×2, κ(H) 10⁴, κ(A) 10: smallest 1.3e-1, spread 2.6e-2, largest 6.5e-4; 14×2, κ(H) 10⁴, κ(A) 10⁴: smallest 1.1e-4, spread 1.2e-3, largest 1.0e-4. Within a factor of three: 4, 4 and 0 of twelve.10⁻⁵10⁻³10⁻¹110¹12×5, κ(H) 10², κ(A) 10smallest threeevenly spreadlargest three12×5, κ(H) 10², κ(A) 10⁴smallest threeevenly spreadlargest three12×5, κ(H) 10⁴, κ(A) 10smallest threeevenly spreadlargest three12×5, κ(H) 10⁴, κ(A) 10⁴smallest threeevenly spreadlargest three9×6, κ(H) 10², κ(A) 10smallest threeevenly spreadlargest three9×6, κ(H) 10², κ(A) 10⁴smallest threeevenly spreadlargest three9×6, κ(H) 10⁴, κ(A) 10smallest threeevenly spreadlargest three9×6, κ(H) 10⁴, κ(A) 10⁴smallest threeevenly spreadlargest three14×2, κ(H) 10², κ(A) 10smallest threeevenly spreadlargest three14×2, κ(H) 10², κ(A) 10⁴smallest threeevenly spreadlargest three14×2, κ(H) 10⁴, κ(A) 10smallest threeevenly spreadlargest three14×2, κ(H) 10⁴, κ(A) 10⁴smallest threeevenly spreadlargest threefixed model's two-step residual over the real solve'swithin three: 4, 4 and 0 of twelveno placement stands in for a real solve
Fig. 5 A fixed perturbation’s two-step residual over the real solve’s, at the energy error the real solve delivers, placed on the three smallest eigenvectors of the block (blue), spread evenly (green) or on the three largest (red), for twelve systems. One would be a perfect match.

The three smallest eigenvectors match within a factor of three on four of twelve systems. An evenly spread perturbation also manages four. The three largest manage none. The prediction wanted nine against under half for the spread one, and what it got is no separation at all. And where they fail the model is usually too small, by as much as a factor of 10410^4 to 10510^5 on the two systems of fourteen unknowns and two constraints whose constraint condition number is 10410^4.

The location itself has been measured, and the premise fails there as well. On every one of the twelve systems at three tolerances, 10−310^{-3}, 10−610^{-6} and 10−910^{-9}, under two per cent of the energy error lies on the three smallest eigenvectors. Part of that is the norm: a component along an eigenvector with a small eigenvalue is weighted by that eigenvalue, and the smallest ones here are ten thousand times smaller than the largest. So in the block’s own energy the small directions cannot hold much, however much conjugate gradients has left there. On 20 of those 36 readings more than half of the energy error is on the three largest, and on the rest it sits in the middle of the spectrum, moving between tolerances in no pattern a fixed perturbation could follow.

The deeper failure is one the fixed model cannot be repaired against. It applies the same operator to every vector, and the earlier essay had already identified that a real inner solve hands back a different error for each vector. Its error depends on the right-hand side it was given. A perturbation of the block is linear in that vector. So however it is placed, it will agree with a real solve only on the systems where the difference between those two things happens not to matter, and that is what four of twelve looks like.

Which number the outer iteration reads

The prediction assumed that the energy error is the right quantity to control, because the fixed model’s τ\tau measures a perturbation in the block’s own norm. The real solve offers a way to check that, since each run has both numbers: the inner residual it delivered and the energy error it delivered. If the outer two-step residual is proportional to one of them with a steadier constant, that is the one the outer iteration is reading.

On the 66 readable runs with a constraint condition number of 10, the two-step residual is a median 4.4 times the largest inner residual delivered, and 320 times the median energy error. With a constraint condition number of 10410^4 those become 180 and 990. In both cases the residual is the nearer reading, by a factor of five to seventy, and the mechanism is simple enough to write down. Applying the preconditioner solves the first block approximately, and when the Krylov relation is formed the part of the outer residual left in the first block is exactly the inner residual. It enters directly, with no condition number attached. An energy error has to be converted into a residual by the block itself, and a small component along a large eigenvalue is a large residual, which is where most of the error is. So the test the earlier essay was criticising is measuring the quantity the outer iteration actually receives. Its failing was only ever that it can overshoot.

That also says why the two stops so seldom differ in effect. When they do select different iterates, the outer residual follows the residual of whichever iterate was returned, and an estimate of the energy adds nothing about that number.

What the look-ahead costs and what loosening saves

The median total of inner conjugate gradient steps over twelve systems against the target, under each stop, with two look-ahead steps counted against the energy stop1e-12: 56.5 under the energy stop and 50 under the residual stop; 1e-11: 58.5 under the energy stop and 51.5 under the residual stop; 1e-10: 59 under the energy stop and 50 under the residual stop; 1e-9: 59 under the energy stop and 50 under the residual stop; 1e-8: 58 under the energy stop and 50.5 under the residual stop; 1e-7: 57.5 under the energy stop and 51.5 under the residual stop; 0.000001: 67 under the energy stop and 55 under the residual stop; 0.00001: 65.5 under the energy stop and 58.5 under the residual stop; 0.0001: 64.5 under the energy stop and 57 under the residual stop; 0.001: 74.5 under the energy stop and 68.5 under the residual stop; 0.01: 105 under the energy stop and 100 under the residual stop.10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²020406080100120targetinner steps in the whole solve, medianenergy stopresidual stoptwo look-ahead steps per solve are countedloosening still saves nothing
Fig. 6 The median total of inner conjugate gradient steps against the target under each stop, with the look-ahead steps counted against the energy stop.

The look-ahead itself is not what is deciding the count. At one step, two and four the rule counts 152, 154 and 157 of 198: four steps of look-ahead buy three more runs and take the delivered error further from the target, since a return four steps back is below it by more.

The energy stop costs a fairly steady six to twelve extra inner steps in a whole solve of fifty or sixty, about what two steps of look-ahead per application come to over the four or so outer steps, and it buys nothing that shows up in the outer count. If a code wanted a proper error bound for some other reason, then that is its price, and it is a small one. As a replacement stop for a preconditioner it has no case on these systems.

The result that the previous measurement reported also survives under the new test. Loosening the target never lowers the total. The median under both stops is flat around fifty to sixty down to about 10−410^{-4} and then climbs, to about a hundred at 10−210^{-2}, where the extra outer steps cost more than the inner steps saved per application. The cheapest setting anybody could choose on these systems is the tightest one measured, and the inner solve should run to the bottom of its cliff and stay there. That advice is a property of a block with a dozen eigenvalues, and it is the sentence most likely to change on a larger one.

One eigenvalue and two steps and where the augmentation puts the cost both priced the inner solve against the outer steps at other settings, and neither found a saving from loosening either. The same conclusion now rests on two kinds of test. And in a preconditioner that need not know the constraint the block itself is what gets replaced, which is another way of avoiding the inner solve altogether, at the cost of a different set of eigenvalues.

What small blocks do not show

Everything measured here is on blocks of nine to fourteen unknowns, and that turns out to be the main finding. It would be easy to read this as “the stopping test does not matter”, and that is a reading only these blocks support. On a block of ten thousand unknowns with a smooth spectrum, conjugate gradients converges geometrically for hundreds of steps. A target there is reached by a small overshoot and not a cliff, and the difference between a residual and an energy error is a real multiple of the block’s condition number, which has room to show. The rate the condition number predicts and the answer that arrives when the space runs out are those two regimes, and these blocks live in the second.

The eigenvalues here are spread evenly in the logarithm, which is itself a choice, and it is what makes the descent so gentle before the cliff. Clustered eigenvalues would produce an earlier cliff and a narrower target range in which anything can happen. The right-hand sides are the ones flexible GMRES generates, so they are correlated with the system in ways a random vector would not be. And the Schur complement remains exact throughout, so the other half of the preconditioner has contributed nothing to the outer residual.

Still open: a block large enough to have a rate

A block with room. The measurement above says the two tests agree because no intermediate iterate exists. The prediction with a sign is that on blocks of 400 unknowns with a condition number of 10410^4, with eigenvalues evenly spread, the energy stop delivers within a factor of three of the target on nine runs in ten, while the residual stop delivers something further from it by at least a factor of ten on most, and that there the step rule written in the delivered error reaches 180 of 198 after all. If so, the earlier prediction was right about large systems and wrong only about small ones.

A floor for the rule. The misses begin where the two-step factor stops being small. The prediction is that restricting the rule to targets whose measured first drop is below 10−310^{-3} raises its count on these eighteen systems to at least 95 per cent of those runs, and that this domain can be read in advance from a single outer step, so that a code can state when to trust it.

What links here

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

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.

Block preconditionerConjugate gradientsFinite terminationGMRESSaddle-point systemsStopping criterionTolerance