Repository navigation
Restore weighted preconditioning and tolerances for default Krylov solves - #4391
Conversation
60272a6 to
ab8f38d
Compare
|
Rebased onto current master |
ab8f38d to
5704cc8
Compare
|
Master advanced again during the first update. The branch is now rebased onto |
Just make InvPreconditioner public. |
|
Release-stack follow-up: I reran the reduced default KenCarp4 LinearSolve=5.14.1
mode=default elapsed=21.796816345 retcode=Success accepted=24 nf=446 nsolve=467
# exit 0The Julia process took 3m44.93s wall because switching from the path checkout rebuilt 11 dependencies for 196 seconds; the measured solve itself was 21.80 seconds. |
|
The original full-size regression case now passes with this PR plus the merged LinearSolve routing/forwarding fixes. Exact case: Observed on Julia 1.10.11: The same default case before the combined fix exceeded the 3,600-second external timeout inside This is direct evidence that SciML/LinearSolve.jl#1255, SciML/LinearSolve.jl#1263, and the weighted-default-preconditioner change here fix the benchmark regression. The exact |
5704cc8 to
d93a327
Compare
|
The failing Runic check is a clean-master failure unrelated to this PR's diff. Exact current master The separate mechanical repair is #4423. It passes the full Runic 1.10.0 check over all 1,091 tracked Julia files, Multirate Core (70/70), root QA (106/106), typos, and |
|
Three failed checks currently shown here are clean-master failures unrelated to this PR changed paths:
The checks affected by the KenCarp fix in Differentiation, QA, FIRK, and the completed nonlinear-solver checks remain green; the remaining matrix is still running. |
|
The downstream validation now covers the entire ten-page SimpleHandwrittenPDE folder with every original tolerance range restored, not only All ten pages returned This was run on Julia 1.10.11 with this exact PR head The unrelated clean-master Runic failure is now fixed by #4423; its hosted Runic and Runic Suggestions checks are green. |
|
Opened SciML/LinearSolve.jl#1272 to export the already documented |
Supply the nonlinear solver's diagonal weight preconditioners when LinearSolve selects the default matrix-free Krylov method. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
Keep the weight scaling finite when a rejected nonfinite step leaves a zero residual weight. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
Tell the shared tolerance helper when an implicit integrator requested LinearSolve default selection, so a selected Krylov solve does not retain sqrt(eps). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.151.0 Agent-Model: gpt-5.6-sol Agent-Session: local session ID 01a04fab-48db-7e03-9f47-20c69464527f
d93a327 to
46cec0b
Compare
|
Handled the review request in final head
GPU groups were not run locally. The PR body now contains the full commands and evidence. Agent: Codex CLI 0.151.0, model gpt-5.6-sol, local session ID |
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
|
Follow-up on the branch update: @ChrisRackauckas added $ GROUP=QA julia +1.11 --project=lib/OrdinaryDiffEqDifferentiation -e 'using Pkg; Pkg.test()'
JET Tests | 1/1
Aqua | 19/19
Testing OrdinaryDiffEqDifferentiation tests passed
Exit status: 0
$ julia +1.12 -m Runic --check <the two added files>
$ typos <the two added files>
$ git diff --check
runic=0 typos=0 diff_check=0The hosted matrix restarted for final head Agent: Codex CLI 0.151.0, model gpt-5.6-sol, local session ID |
- Fix StochasticDiffEqImplicit import ordering (#4408) - Fix TauLeaping JumpProblem initialization (#4409) - Fix dense output for the explicit multirate methods (#4233) - Let reinit! keep the step-size controller history (#4400) - Mark an operator Jacobian as updated when calc_W! moves it (#4354) - Restore weighted preconditioning and tolerances for default Krylov solves (#4391) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
What changed and why
LinearSolve now routes matrix-free
WOperators through its default Krylov solver. Two OrdinaryDiffEq setup gaps made that path regress badly on implicitSplitODEProblems:alg.linsolve === nothing, the nonlinear-solver cache supplied identity preconditioners instead of the integrator's diagonal error weights;sqrt(eps)relative tolerance instead of the scalar integrator tolerance.This PR supplies the same left/right weight scaling already used by explicit iterative solver choices and forwards scalar integrator tolerances into default LinearSolve caches. The left preconditioner now uses the public
LinearSolve.InvPreconditionerAPI requested in review, wrapping the local zero-safe weight operator; the removed local inverse wrapper no longer duplicates LinearSolve's interface. The OrdinaryDiffEqNonlinearSolve and OrdinaryDiffEqDifferentiation compat floors are LinearSolve 5.15, the first release exporting that API, andInvPreconditioneris removed from Differentiation's ExplicitImports exception list. Zero residual weights are treated as one so rejected nonfinite steps do not create singular preconditioners. Explicit user solvers, user preconditioners, direct-factorization paths, and vector tolerances keep their existing behavior.The required LinearSolve routing, preconditioner-forwarding, and public-wrapper changes are merged in SciML/LinearSolve.jl#1255, SciML/LinearSolve.jl#1263, and SciML/LinearSolve.jl#1272. They are available in LinearSolve 5.15.0.
Ignore this PR until it has been reviewed by @ChrisRackauckas.
Failing before / passing after
The default preconditioner behavior test fails on the original parent because both sides are identity:
The tolerance test fails on the original parent:
For the review-requested public wrapper, I added
@test linsolve.Pl isa InvPreconditionerbefore changing production code and ran the official Core harness against LinearSolve 5.15.0. It failed on the local wrapper:With the public wrapper change applied, the same testset passes:
The unchanged focused file also exited 0 on final rebased head
46cec0b41cin a disposable environment resolving LinearSolve 5.15.0.Benchmark verification
I tested current SciMLBenchmarks master plus SciML/SciMLBenchmarks.jl#1672, LinearSolve 5.14.1, and the earlier behavior-fix head. I restored the original KDV low-tolerance range (
abstol = 1e-8:1e-12,reltol = 1e-5:1e-9) rather than PR 1672's temporary cap. The five-point low-tolerance IMEX diagram emitted with nonempty curves for all six solvers; the chunk took 113.946 seconds on this host.The tightest original endpoint (
abstol=1e-12,reltol=1e-9,N=128) completed for every KenCarp method, and the default Krylov cache updated to1e-9:The exact page completed all chunks and emitted all figures:
One solve in the later cross-family low-tolerance chunk reported
Instability; that unrelated chunk still emitted all three five-point curves. The KenCarp low-tolerance chunk emitted without an instability warning.Package verification
Julia 1.11.9, with LinearSolve 5.15.0:
The full NonlinearSolve Core and QA runs were on source-identical review commit
ab0610b414before the final rebase.git range-diffreports those four PR commits unchanged after rebasing onto current master01e4cc6eac. The unchanged focused test, Runic, typos, andgit diff --checkwere rerun successfully on rebased head46cec0b41c. Chris then added commit17b957c381to floor OrdinaryDiffEqDifferentiation and remove the obsolete ExplicitImports exception; the Differentiation QA group and static checks passed on that exact final head.Earlier validation for the tolerance path also passed OrdinaryDiffEqDifferentiation Core and QA. The ten-page SimpleHandwrittenPDE benchmark validation is recorded at SciML/SciMLBenchmarks.jl#1672 (comment).
Not verified
GPU groups were not run locally. The docs build was not run because this review change adds no OrdinaryDiffEq public API, docstring, or documentation content. The public LinearSolve API was documented and its docs build passed in SciML/LinearSolve.jl#1272.
The downstream SciMLSensitivity and StochasticDiffEq failures visible on the older PR head reproduce on their unmodified default branches and are handled separately in SciML/SciMLSensitivity.jl#1627 and #4419.
Earlier implementation session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
🤖 Generated with Codex CLI 0.151.0 (model: gpt-5.6-sol; session: local session ID 01a04fab-48db-7e03-9f47-20c69464527f)