You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop convergence studies retaining the trajectories they are not measuring
`test_convergence` kept one full solution object per trajectory per step size.
A `RODESolution` carries the solver cache, the noise process, the problem and
its interpolation, none of which a convergence study needs — it wants the
per-trajectory errors and the endpoints the weak error is formed from. At the
trajectory counts the weak-convergence tests use, that gap is the difference
between passing and being OOM-killed: `SROCKC2WeakConvergence`,
`IIPWeakConvergence` and `OOPWeakConvergence` all died at 15.6 GiB in a 16 GiB
cgroup with no test output, which is the "runner lost communication with the
server" signature reported in #4036.
Trajectories are no longer retained by default. Three things compose:
- The `EnsembleProblem` is built with an `output_func` that reduces each
trajectory to a `ConvergenceTrajectory` as it is solved, so the full
solutions never coexist and the peak is bounded, not just the retention.
`ConvergenceTrajectory` stores one-tuples and a `NamedTuple` rather than
one-element `Vector`s and the solver's error `Dict`; indexing and key
lookup are unchanged, but the `Dict` alone dominated everything else
retained once a study runs to millions of trajectories.
- `calculate_ensemble_errors` moves inside the solve loop, so each step
size's ensemble is summarised and released before the next is solved
rather than all of them being held at once.
- `_drop_trajectories` strips the summarised ensemble to one representative,
since the reduced objects are dead weight once the errors are computed.
`retain_solutions = true` restores the old behaviour for callers that want the
paths themselves. The reduction is skipped, and the solutions retained, where
it cannot apply: a caller-supplied `EnsembleProblem` owns its own `output_func`,
`expected_value` forms the weak error from the trajectory values directly, and
`weak_timeseries_errors`/`weak_dense_errors` need the whole timeseries.
Drop `uEltype` from the `ConvergenceSimulation` constructor — it was assigned
and never used, and was the only thing requiring `solutions[i].u[j]` to be a
full solution.
Measured on the weak files, 16 GiB cgroup, JULIA_NUM_THREADS=2:
weak_srockc2.jl OOM 15.61 GiB @3m29s -> exit 0, 23m41s, 2.81 GiB
oop_weak.jl OOM 15.62 GiB @23m50s -> exit 0, 13m08s, 1.32 GiB
additive_weak.jl (same group) -> exit 0, 3m22s, 1.04 GiB
Order estimates are bit-identical with and without the reduction.
With no group needing more than 2.81 GiB, remove the `high-memory` runner pin
from all eight groups that carried it. The five StochasticDiffEqWeak groups
needed no change — they already reduce through their own `output_func` and peak
at 0.71-2.09 GiB, so the label was simply wrong for them.
BREAKING: DiffEqDevTools 3.1.5 -> 4.0.0. `ConvergenceSimulation.solutions` no
longer holds every trajectory for the Monte-Carlo method, and `sim[i, j]`
forwards into it, so `j > 1` now reaches past the representative. The field
documentation is updated and the compat pin moves "3" -> "4" in 40 Project.toml
files. The ODE/DAE methods do not take the keyword and are unchanged.
The reduce-by-default design and `drop_trajectories` are taken from #4056,
which is closed in favour of this.
Fixes#4037
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UwLXp5WY1uiqPun7qhwxeU
0 commit comments