Repository navigation
Support DynamicalODEFunction and SecondOrderODEProblem in EnsembleGPUArray - #592
sasmith-14 wants to merge 2 commits into
Conversation
`generate_problem` read `prob.f.f`, which a `DynamicalODEFunction` doesn't have, so `DynamicalODEProblem` and `SecondOrderODEProblem` failed with the array ensembles. Split each batched `[v; u]` column and call `f1` and `f2`. Fixes SciML#109
Independent review (devin / fusion-gpt-6-1-sol-high-sidekick-swe-2-medium), reviewer session unknown, reviewed head 6aa6606
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. CI: green Risklow (L6: fixes a missing-field error for dynamical problems; ordinary ODE dispatch and numerical algorithms remain unchanged). The CUDA defect below is a merge blocker independently of blast-radius classification. Blocking findings
Non-blocking findingsNone. The new analytic oscillator oracle is independent of the implementation; no assertions were deleted, skipped, or loosened in the diff. No dependency, licensing, public-export, controller, or stepper-inlining changes appear. What I ranAll paths below are relative to the reviewed checkout unless stated otherwise. Exported
What I did not verify
🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Concatenating the two halves with vcat is generic array code, which doesn't compile for GPUs when a half returns a view of the state (e.g. dx(v, x, p, t) = v, and every out-of-place SecondOrderODEProblem). Write each half into its slice of du instead, through the in-place kernel, and run the DynamicalODEFunction tests on the CUDA, AMDGPU and Metal groups too, with allocation-free out-of-place cases.
|
thanks for the review! fixed in b72a36d: the out-of-place halves are now written into their slices of the dynamical tests now also run in the CUDA, AMDGPU and Metal groups, with out-of-place on Metal (M5), those out-of-place cases fail with the same |
PR: #592 Reviewed head: b72a36d Risk assessment
Review reportVERDICT: MERGE Risklow (L6: fixes errors on dynamical-problem paths, with failing-before/passing-after evidence; ordinary ODE dispatch and numerical algorithms remain unchanged). Blocking findingsNone. The round-one blocker is resolved: both allocation-free out-of-place reproducers now compile on CUDA and match independent analytic solutions. The delta adds GPU regression coverage without deleting, skipping, or loosening assertions.
Non-blocking findingsNone found in the delta or unresolved prior findings. What I ranAI reviewer: Codex CLI 0.164.0, model gpt-6.1-sol. Reviewed the supplied previous-head review, delta, whole PR diff, surrounding source, tests, and root instructions. No author risk rating was read. Exported the requested
What I did not verify
AUTHOR_GRADE: {"task": "bugfix", "score": 5, "difficulty": 3, "rounds": 2, "author_harness": "unknown", "author_model": "unknown", "note": "The delta fixes both independently reproduced CUDA compilation failures and adds backend regression coverage. The full CPU group, 24 CUDA regression assertions, 186 targeted assertions on each of CPU and CUDA, and 55 CUDA ordinary-ODE controls pass. Broader CUDA verification is limited by device memory. The newest commit has no Agent-Harness or Agent-Model trailers."} Head link: b72a36d 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
fixes #109
DynamicalODEProblemandSecondOrderODEProblemfail withEnsembleGPUArrayandEnsembleCPUArray, becausegenerate_problemreadsprob.f.fand aDynamicalODEFunctiononly hasf1andf2:each column of the batched state is one trajectory's
ArrayPartition(v, u)flattened to[v; u], so this wrapsf1/f2in a small callable that splits the column and calls both (in-place and out-of-place). other problems still go throughprob.f.f.tests: a new CPU testset with in-place and out-of-place
DynamicalODEProblems and aSecondOrderODEProblem, checked against the exact solution andEnsembleSerial. it errors on master and passes with the change. the fullGROUP=CPUsuite and the QA group pass locally. i also ran the in-place case withEnsembleGPUArray(MetalBackend())on an M-series mac, and it matchesEnsembleSerial.claude helped me write and test this; I reviewed the changes.
notes:
[v; u]vectors like other array-ensemble results, not asArrayPartitions. happy to change that if you prefer.SplitODEFunctionisn't covered here.du .= ...) inside an in-placeffails on the CPU backend on master (no method matching elsize(::Type{Base.Experimental.Const{Float32, 2}})from the aliasing check), so the test uses loops.