Guard Hegedüs warm starts with residual predictiveness - #1123
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Guard Hegedüs warm starts with residual predictiveness#1123ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Member
Author
|
Cross-repository CI note: any immediate OrdinaryDiffEq downstream resolver failure is the clean OrdinaryDiffEq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR should be ignored until reviewed by @ChrisRackauckas.
Companion to SciML/OrdinaryDiffEq.jl#4040 and SciML/OrdinaryDiffEq.jl#4034.
What changed
WarmStart.Hegedusnow uses its projected previous solution only when thatprojection reduces the raw initial residual by at least a factor of two. If the
previous direction is not predictive, the solve starts cold.
The public documentation now describes that fallback and no longer says that
OrdinaryDiffEq resolves
WarmStart.Autoto Hegedüs. It also says explicitly thatwarm starting is workload-dependent and should be benchmarked against a cold
start. The threshold remains an implementation detail; no public API was added.
This is a bug-fix release bump to 5.3.1.
Why
The Hegedüs scalar
minimizes the residual along the previous solution direction. When
Auisnearly orthogonal to
b, however, that direction predicts essentially none ofthe new solution. In the OrdinaryDiffEq index-1 DAE reproducer, the previous
Newton increment had converged to round-off,
|ξ|spanned roughly 63 orders ofmagnitude, and GMRES sometimes accepted the rescaled noise at iteration zero.
That made each Newton update depend on the entire prior solve history and
amplified a one-ulp input perturbation into a
3.73e-3solution change.For the least-squares scalar, the projected residual ratio is
The implementation therefore checks the equivalent cosine threshold using the
already-computed
Auand inner product. It adds no operator application orworkspace allocation. For an unpreconditioned solve it also reuses the RHS norm
that is already needed for the stopping criterion.
Robustness and performance evidence
On the small index-1 DAE that exposed the bug:
nf6.64e-83.73e-31.33e-15The guard both removes the round-off amplification and improves the iteration
count on that correlated tiny-DAE workload.
It is deliberately not used to re-enable OrdinaryDiffEq's
Autodefault.On a matrix-free 1D Brusselator (
n=800, default diagonal preconditioner),guarded Hegedüs still regressed against cold starts:
nfchangeThe guard makes explicit Hegedüs safer; it does not make warm starting a
universal speedup.
Local verification
test/Core/warm_start.jl: 41/41 assertions passed on Julia 1.12.6.GROUP=Core: passed.GROUP=QA: passed, including Allocation QA (48/48) and SupernodalLU Allocation QA (8/8).--check: passed.1.33e-15(nf=617), Hairer42 drift1.33e-15(nf=625), and Cash4drift
2.77e-9(nf=740).