-
-
Notifications
You must be signed in to change notification settings - Fork 80
Feature/custom structs backsolve adjoint #1292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/custom structs backsolve adjoint #1292
Conversation
|
I've rebased this PR onto the latest master to resolve the merge conflicts. The rebased branch is available at: https://github.com/ChrisRackauckas-Claude/SciMLSensitivity.jl/tree/feature/custom_structs_backsolve_adjoint @simenhu To update your PR with the rebased changes, you can run: git remote add claude https://github.com/ChrisRackauckas-Claude/SciMLSensitivity.jl.git
git fetch claude feature/custom_structs_backsolve_adjoint
git checkout feature/custom_structs_backsolve_adjoint
git reset --hard claude/feature/custom_structs_backsolve_adjoint
git push --force origin feature/custom_structs_backsolve_adjointThe rebase resolved the following conflicts in
Co-Authored-By: Chris Rackauckas [email protected] |
|
Opened a rebased version of this PR at #1335. |
Minor optimization: cache the result of isscimlstructure(p) in a local variable to avoid calling it twice in the hot _vecjacobian! path. Co-Authored-By: Chris Rackauckas <[email protected]>
Performance optimization: use the pre-cached wrapped function (pf) from S.diffcache.pf instead of calling repack_ode_function in every _vecjacobian! call. The function wrapping is already done during setup in adjoint_common.jl, so we can reuse it directly. This avoids: - Closure creation in the hot path - Calling repack inside the closure on every ODE evaluation Co-Authored-By: Chris Rackauckas <[email protected]>
…ions The closure was only defined for inplace signature (du, u, p, t), but out-of-place functions need (u, p, t) signature. Added isinplace parameter to generate the correct closure based on the function type. Co-Authored-By: Chris Rackauckas <[email protected]>
For some sensitivity algorithms (QuadratureAdjoint, etc.), pf is set to nothing in adjointdiffcache. Fall back to the original behavior of using SciMLBase.Void(f) for inplace or f for out-of-place when pf is nothing. Co-Authored-By: Chris Rackauckas <[email protected]>
0e9e939 to
d7661ab
Compare
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
BacksolveAdjoint now works with SciMLStructures