ForceFreeStates - PERF! - Default to Vern7 with an explicit absolute tolerance and pin BLAS in the sweep - #445
Draft
d-burg wants to merge 4 commits into
Draft
ForceFreeStates - PERF! - Default to Vern7 with an explicit absolute tolerance and pin BLAS in the sweep#445d-burg wants to merge 4 commits into
d-burg wants to merge 4 commits into
Conversation
…tolerance and pin BLAS in the sweep A brute-force comparison of 20 OrdinaryDiffEq solvers on the Euler-Lagrange propagator chunks (shipped DIII-D-like case plus ten IDA_run geqdsks) showed that error control was dominated by the OrdinaryDiffEq default abstol of 1e-6, and that once a real absolute tolerance is set Vern9 rejects two of every three steps near the rational surfaces while fifth-to-seventh-order methods reach the same accuracy for about half the RHS evaluations. - Add `ode_solver` (default "Vern7") and `ode_abstol` (default 1e-8) to ForceFreeStatesControl and use them at every Euler-Lagrange solve site. On the corpus Vern7 is 1.5-4.7x faster than Vern9 at equal tolerances, with Δ′ closer to the converged solution in every case; the shipped case's Force-Free States stage is ~13 % faster than before while its eigenvalue and Δ′ errors against a 1e-13/1e-15 reference drop from 5e-8/1e-4 to 2e-9/1.5e-5. - Pin BLAS to one thread inside the sweep and the Δ′ BVP: the mpert×mpert blocks lose more to BLAS synchronization than they gain (RHS cost 263 → 73 µs at mpert=35). - Add the benchmark scripts used for the comparison: a chunk-level work-precision harness, a whole-stage driver that scores δW and Δ′ against a converged reference, and a cold/warm stage profiler. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nd the geqdsk corpus runner Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
|
This pull request is missing an assignee and a reviewer. If you are not ready to name them, mark this pull request as a draft. |
…lizable Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ck workers Read nw/nh as the last two header integers, so TokaMaker-written geqdsks parse, and SIGKILL a worker that outlives its wall-clock cap instead of letting the failed shutdown end the sweep. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Release note
ode_solver/ode_abstoldefaults); no interface removed (harness @ a09f6bf)ode_solver = "Vern9",ode_abstol = 1e-6in[ForceFreeStates]restores the previous integration exactlyThe Euler-Lagrange sweep now integrates with Vern7 at an explicit absolute tolerance of 1e-8 (previously Vern9 at the OrdinaryDiffEq default 1e-6), and BLAS is pinned to one thread inside the sweep and the Δ′ BVP. Same δW and Δ′ to better than the old run's own error, in about half the RHS evaluations.
Regression report
Evidence
Shipped DIII-D-like case (N=35, 5 rational surfaces), 4 Julia threads, Apple M1 Max. Errors are relative distances from a Vern9 reltol 1e-13 / abstol 1e-15 reference.
Why the old setting was fast: with abstol 1e-6 the error stopped responding to reltol below ~1e-8 (Vern9 at reltol 1e-13 took exactly the same 1667 steps as at 1e-10). With a real abstol, Vern9 rejects 68 % of its steps near the rational surfaces:
Whole-stage Δ′ and δW error vs wall time, 20 solvers × 3 reltol × 4 abstol (star = develop):
Ten IDA_run geqdsks (EFIT, CAKE, TokaMaker; 65×65 to 257×257; H- and L-mode), reltol 1e-10 / abstol 1e-10 for every solver, 4 threads:
Vern7 vs Vern9 integration speedup: min 1.48×, median 1.81×, max 4.7×; δW within 2e-10 of the reference on all; Δ′ closer on 10/10.
Full IDA_run corpus (226 unique geqdsks) sweep, this PR vs develop vs STRIDE: running, figure and table to be added.
Notes for reviewers
benchmarks/(chunk-level work-precision, whole-stage driver, stage profiler, corpus runner); their outputs are not committed.🤖 Generated with Claude Code