Repository navigation
SRA1 iip: scale k₁ in-place to drop per-step allocation - #4822
Merged
ChrisRackauckas merged 1 commit intoOct 9, 2026
Merged
Conversation
`k₁ *= dt` rebound a new Vector every SRA1Cache step; `@.. k₁ *= dt` matches the existing k₂ path and removes the 96 B/step alloc. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-sde-sra1-alloc/log.txt on amdci2
ChrisRackauckas
marked this pull request as ready for review
October 9, 2026 06:27
This was referenced Oct 9, 2026
Merged
ChrisRackauckas
referenced
this pull request
Oct 14, 2026
…inaryDiffEqBDF, OrdinaryDiffEqExplicitRK, OrdinaryDiffEqFIRK, OrdinaryDiffEqFeagin, OrdinaryDiffEqHighOrderRK, OrdinaryDiffEqPDIRK, OrdinaryDiffEqRKN, OrdinaryDiffEqSDIRK, StochasticDiffEqHighOrder, StochasticDiffEqLowOrder, and StochasticDiffEqMilstein for release (#4871) Agent-Harness: Devin CLI 3000.11.3 Agent-Model: Fusion (Claude Opus 5.5 Medium + SWE-2 Medium) Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/flash-hour.json Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.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.
Summary
In
SRA1Cacheperform_step!,k₁ *= dtrebound a newVectorevery step (same size as the state), costing ~96 B/step for diagonal and non-diagonal additive noise. Switching to@.. k₁ *= dtmatches the existing in-placek₂scale and removes that allocation without changing the arithmetic.Regression test:
@allocated(perform_step!)is 80 B on unfixed code (n=3) and 0 with the fix; IIP/OOPu_endagree to2e-16. Same-seedu_endis bitwise identical before/after (perf-only change).Results (amdci2, Julia 1.12.4,
JULIA_NUM_THREADS=1,taskset -c 0)perform_step!@benchmarkminstep!B/stepu_end(seed=7, fixed dt)Failing before / passing after:
before.txtshowsEvaluated: 80 == 0;after.txtboth testsets Pass.Test-group tails
Core (
GROUP=Core,--check-bounds=auto,OPENBLAS_NUM_THREADS=1):QA (
GROUP=QA):Also: Runic + typos on touched files; regression test on Julia 1.10.12 Pass.
Not verified
StochasticDiffEqtest suite / other SRA tableau paths beyond SRA1 iip.@benchmarkminima above (shared machine).Reviewer pushback
@.. k₁ *= dtis preferred over@. k₁ *= dt/k₁ .*= dtgiven FastBroadcast usage elsewhere in this file.perform_step!only).Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
Independent review: pending
🤖 Generated with Cursor Agent 2026.10.01-14929f9 (model: unknown (Cursor auto)), transcript /home/crackauc/sandbox/goals/performance/jobs/pr-sde-sra1-alloc/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Made with Cursor
Risk assessment
SRA1Cacheperform_step!(k₁ *= dtbecomes@.. k₁ *= dt) inlib/StochasticDiffEqHighOrder, plus a new Core test file.cache.k₁is its ownzero(rate_prototype)buffer. Nothing aliases it, and nothing outside this step reads it (SDE dense output does not use it). It is overwritten byf(k₁, uprev, p, t)at the start of every step, so scaling it in place cannot leak into later steps, FSAL, or interpolation. No public API change.SciMLSensitivity.jl/Core1fails on the last 3 master IntegrationTest runs.GPU (julia 1)shows the same 3 QNDFdae_tests.jl:481failures as master. StochasticDiffEqHighOrder Core passes on Julia lts/1/pre (so the@allocated == 0test holds on all three), as do QA and all StochasticDiffEq umbrella groups. Locally (Julia 1.12, fresh env), the PR's test file givesEvaluated: 80 == 0(1 pass / 1 fail) on master src and 2/2 on PR src. With seed 11, diagonal and non-diagonal (3x2) additive noise, adaptive and fixed dt=1/64,sol.t,sol.u,nacceptandsol(0.37)are bitwise identical between master and PR.step!allocations drop by 80 B in every case.integ.t = mod(integ.t, 9.0)does nothing becauseperform_step!never advances t; and the IIP/OOPrtol = 2e-16check is tight enough that it could break if the two paths ever fuse differently)🤖 Risk assessment posted by an AI agent (fleet master) — harness: Claude Code 2.1.285 · model: claude-opus-5-5
Conversation: local session 3c311569-dda6-4687-bc9f-65febb212c33 (local transcript)