Repository navigation
Accumulation for ODEProblem - #1036
Closed
DhairyaLGandhi wants to merge 12 commits into
Closed
DhairyaLGandhi wants to merge 12 commits into
DhairyaLGandhi wants to merge 12 commits into
Conversation
ChrisRackauckas
marked this pull request as ready for review
May 26, 2025 11:49
AayushSabharwal
requested changes
May 26, 2025
Comment on lines
+309
to
+315
| error() | ||
| dx = (; Zygote.nt_nothing(x)..., pair(Val(f), Δ, x)...) | ||
| (_project(x, dx), nothing) | ||
| else | ||
| dx = Zygote.grad_mut(__context__, x) | ||
| dx[] = (; dx[]..., pair(Val(f), Zygote.accum(getfield(dx[], f), Δ))...) | ||
| return (dx,nothing) |
Member
There was a problem hiding this comment.
What's the point of this block if the first line is error()?
| end | ||
| Zygote.unwrap(val), back | ||
| end | ||
| Zygote.accum(::Tuple{}, ::NamedTuple{}) = () |
Member
There was a problem hiding this comment.
Isn't this type piracy?
Member
Author
There was a problem hiding this comment.
yeah... FluxML/Zygote.jl#1574 is definitely the safer bet.
Why are problem types mutable? Do they need to be?
| nlsol2 = prob.f.initialization_data.initializeprob | ||
| if initdata.initializeprobmap !== nothing | ||
| u0 = initdata.initializeprobmap(choose_branch(nlsol)) | ||
| u02 = initdata.initializeprobmap(nlsol2) |
Member
There was a problem hiding this comment.
This doesn't make sense - we solve initialization, but calculate the new u0 from the unsolved problem?
Member
Author
There was a problem hiding this comment.
This has contains some of the changes we had made previously to resolve the error. It is possible to remove the changes to initialization.jl, just the Zygote patch should be sufficient.
Member
Author
|
Closing in favour of FluxML/Zygote.jl#1574 |
This was referenced Jul 23, 2026
ChrisRackauckas
added a commit
that referenced
this pull request
Jul 24, 2026
Observed symbols in save_idxs were already rejected, but with a generic "variables and timeseries parameters" message that did not distinguish observed quantities from other invalid symbols. Detect is_observed and raise a dedicated ArgumentError with workarounds and a pointer to DifferentialEquations.jl#1036. Document the limitation on the symbolic save_idxs and common-keywords pages. Add unit and MTK downstream tests. Full observed save_idxs support is intentionally not implemented: solver save paths are integer u[idxs] indexing, and eval-at-save observed columns need SavedSubsystem + OrdinaryDiffEqCore design work beyond a small PR. Co-authored-by: ChrisRackauckas-Claude <[email protected]>
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.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Sister PR for FluxML/Zygote.jl#1574 which would have much narrower dispatch for
getfield.