Newton-Krylov integrators default to Hegedüs warm start (require LinearSolve 5.1)#3991
Conversation
Resolves a Krylov linear solver left at the new LinearSolve.WarmStart.Auto default to WarmStart.Hegedus on the Newton nonlinear-solver path, so implicit integrators using KrylovJL_GMRES()/KrylovJL_FGMRES() reuse the previous solution (Hegedus-scaled) across the correlated linear solves of a Newton iteration. Rosenbrock/W-method integrators never call the resolver, so their Auto solver stays a cold start -- warm starting is unsafe there (no outer Newton iteration absorbs the within-tolerance stage-solve perturbation, which can trigger step-rejection feedback loops). Explicit WarmStart.None/Previous/Hegedus are always respected. The resolver is guarded on isdefined(LinearSolve, :WarmStart), so it is a no-op on LinearSolve < 5.1 and this compiles unchanged there. Bumps the LinearSolve compat of the two touched sublibraries to allow 5; umbrella-wide activation additionally requires the OrdinaryDiffEq LinearSolve 5 compat migration across the remaining sublibraries. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
CI note: the The checks that actually exercise this PR — the OrdinaryDiffEqDifferentiation/OrdinaryDiffEqNonlinearSolve sublib test groups and Runic — are the ones to watch. 🤖 Generated with Claude Code |
Two stale minimum-version declarations were mutually unsatisfiable, which is what the Downgrade Sublibraries CI hits: - LinearSolve floor 3.75.0 was inconsistent with the NonlinearSolveBase 2.34.1 floor, which itself requires LinearSolve >= 4.3.0. Raised to 4.3.0. - OrdinaryDiffEqNonlinearSolve declared SciMLOperators >= 1.24.3 while its path dependency OrdinaryDiffEqDifferentiation requires >= 1.24.4. Raised to 1.24.4. Neither drops any actually-installable configuration. The warm-start resolver remains guarded on isdefined(LinearSolve, :WarmStart), so it still no-ops on LinearSolve 4.x and activates on 5.1+. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
579e6de to
fe761ce
Compare
|
CI verdict — the checks that exercise this PR are green:
Remaining red checks are all pre-existing on master, not introduced here:
🤖 Generated with Claude Code |
Makes the Newton-Krylov Hegedus warm-start default unconditionally live instead of silently dormant: - OrdinaryDiffEqNonlinearSolve and OrdinaryDiffEqDifferentiation require LinearSolve = "5.1" (where WarmStart exists), and default_krylov_warm_start drops its isdefined(LinearSolve, :WarmStart) guard. - Every other monorepo sublibrary that declared a LinearSolve compat is moved to "5.1" as well. These all depend (transitively) on NonlinearSolve/Differentiation, so they can never resolve with LinearSolve < 5.1 anyway; keeping a 3/4 lower bound would be dead metadata and would re-break the Downgrade CI (which floors deps to their minimum). Test sub-environments updated to match. - Minor version bumps for each sublibrary whose compat changed. Verified: fresh resolution pins LinearSolve 5.1.0; resolver unit test passes (7/7); FBDF and Rodas5P solve with a default KrylovJL_GMRES(); the resolver maps Auto -> Hegedus with the guard removed. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f21783d to
e7c538a
Compare
Important
Draft — please ignore until reviewed by @ChrisRackauckas.
Companion to SciML/LinearSolve.jl#1100 (now merged and released as LinearSolve v5.1.0), which added
WarmStart+ theWarmStart.Autodefault toKrylovJL. This makes the integrator-aware default unconditionally live on LinearSolve 5.1.What
OrdinaryDiffEqDifferentiation.default_krylov_warm_start(linsolve)resolves a Krylov solver left atLinearSolve.WarmStart.Auto(theKrylovJLdefault) toWarmStart.Hegedus, applied on the Newton nonlinear-solver path (NLNewton/NonlinearSolveAlg). Implicit integrators usingKrylovJL_GMRES()/KrylovJL_FGMRES()now reuse the previous solution (Hegedüs-scaled) across the correlated linear solves of a Newton iteration.Autosolver stays a cold start (warm starting is unsafe there — no outer Newton iteration absorbs the within-tolerance stage-solve perturbation; benchmarks showed 7–13× slowdowns and step-rejection loops).WarmStart.None/Previous/Hegedusare never overridden — onlyAutois resolved.Requires LinearSolve 5.1 (no guard, no dormancy)
WarmStartis a LinearSolve 5.1 feature. Rather than guard onisdefined(LinearSolve, :WarmStart)and be silently dormant on older LinearSolve, the WarmStart-using libraries now requireLinearSolve = "5.1"and the guard is removed, so the default is always live. Every other monorepo sublibrary that declared a LinearSolve compat is moved to"5.1"as well: they all depend transitively on OrdinaryDiffEqNonlinearSolve/Differentiation, so they can never resolve with LinearSolve < 5.1 anyway — keeping a 3/4 lower bound would be dead metadata and would re-break the Downgrade CI (which floors deps to their minimum). Test sub-environments updated to match. This is effectively the OrdinaryDiffEq LinearSolve-5 migration, done here because the require-5.1 floor depends on it.Minor version bumps for each sublibrary whose compat changed.
Verification (local, LinearSolve 5.1.0)
"5.1"— the registered NonlinearSolveBase/DiffEqBase/etc. chain already allows LinearSolve 5, so nothing caps it at 4.test/warm_start_default_tests.jl, Differentiation Core group): 7/7 pass — Auto→Hegedus, explicit values preserved, non-Krylov unchanged, other fields surviveremake.FBDF(linsolve = KrylovJL_GMRES())andRodas5P(linsolve = KrylovJL_GMRES())both solveSuccess; the resolver returnsHegedusforAutowith the guard removed.Noneon FBDF is cold (0), explicitHegeduson Rodas5P is honored (1528).CI validates the full umbrella resolution + all sublibrary test groups on LinearSolve 5.1.
🤖 Generated with Claude Code