-
-
Notifications
You must be signed in to change notification settings - Fork 54
Migrate solve
dispatches from DiffEqBase to NonlinearSolveBase
#669
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
Conversation
8dbacdd
to
d6e39bd
Compare
|
||
using CommonSolve: CommonSolve | ||
using DiffEqBase: DiffEqBase # Needed for `init` / `solve` dispatches | ||
#using DiffEqBase: DiffEqBase # Needed for `init` / `solve` dispatches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a comment, just delete.
lib/NonlinearSolveBase/src/solve.jl
Outdated
@@ -1,3 +1,449 @@ | |||
const allowedkeywords = (:dense, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The utilities at the top here are reused by DiffEqBase, NonlinearSolveBase, OptimizationBase (in the near future), etc. Let's move these to SciMLBase and share them across the different repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The allowedkwargs handling, the special error types, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too, but I figured it might be nice for each to have a separate list of acceptable keywords, so if you tried to pass e.g. dtmin
in to a NonlinearSolve it would give a nice error. Also the messages right now are specific to DiffEqs, they point to the DiffEq docs. I made it so that if there's a mismatch kwarg for a nonlinear solve it points to the NonlinearSolve docs.
But yeah if these are better in SciMLBase I can just put them there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a lot of small utility functions that live in DiffEqBase right now, e.g.
get_concrete_problem
, extract_alg
, promote_u0
, anyeltypedual
etc. that get used in the solve functions. I'm thinking those should also be moved to SciMLBase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list of acceptable kwargs, yes that one should be problem specific, that would be a nice improvement.
But the others yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the definitions for functions like promote_u0
and anyeltypedual
etc. are in different extensions in DiffEqBase. I'm thinking I should create corresponding extensions in SciMLBase for those packages and move the functions to those. But I'll keep the parts of the extensions specific to DiffEqs in the extensions in DiffEqBase.
258520a
to
a312925
Compare
0983668
to
3978e7e
Compare
@ChrisRackauckas I've tested this locally with a branch of DiffEqBase with the NonlinearSolve stuff removed and it works going through the new solve dispatches. I also added simple adjoint tests to make sure that the new extensions work. Those use SciMLSensitivity, Enzyme, and Mooncake so I put those in |
sources should handle that on v1 |
87a2957
to
bc97510
Compare
@ChrisRackauckas The tests for 1.11 are all using a branch of DiffEqBase without solve for NonlinearProblems (https://github.com/jClugstor/DiffEqBase.jl/tree/remove_nonlinear), so they should be going through the correct code path. The downgrade errors are weird, is it just trying to get a version of NonlinearSolveBase that doesn't exist in the registry yet, since I bumped the version of NonlinearSolveBase and it's compat bounds for the other subpackages? Other than that all of the core and downstream tests appear to be good. Integration tests appear to be unrelated, the MTK initialization one makes me nervous, but it looks like it has something to do with the DEOptions. |
Project.toml
Outdated
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
BandedMatrices = "aae01518-5342-5314-be14-df237901396f" | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed in tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, it's not used anywhere in the tests, so not needed anymore.
) | ||
Aqua.test_stale_deps(NonlinearSolveBase; ignore = [:TimerOutputs]) | ||
Aqua.test_piracies(NonlinearSolveBase) | ||
#ENSEMBLE PROBLEM SHOULD BE REMOVED, THIS IS TEMPORARY FOR TESTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
Just a few small comments. |
Alright, there is now absolutely zero dependency on DiffEqBase. |
Now give a pull request that sets up all of the version bumps that are required for this. |
Actually I got this |
Following the merge of PR SciML#669 which migrated solve dispatches from DiffEqBase to NonlinearSolveBase and updated NonlinearSolveBase to v1.15.0, this PR bumps the minor versions of all dependent packages that had their compat requirements updated to require NonlinearSolveBase v1.15: - NonlinearSolve: 4.10.1 → 4.11.0 - BracketingNonlinearSolve: 1.3.1 → 1.4.0 - SimpleNonlinearSolve: 2.7.1 → 2.8.0 - NonlinearSolveFirstOrder: 1.8.1 → 1.9.0 - NonlinearSolveQuasiNewton: 1.8.1 → 1.9.0 - NonlinearSolveSpectralMethods: 1.3.1 → 1.4.0 - NonlinearSolveHomotopyContinuation: 0.1.6 → 0.2.0 - NonlinearSolveSciPy: 1.0.1 → 1.1.0 - SCCNonlinearSolve: 1.4.1 → 1.5.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Following the merge of PR #669 which migrated solve dispatches from DiffEqBase to NonlinearSolveBase and updated NonlinearSolveBase to v1.15.0, this PR bumps the minor versions of all dependent packages that had their compat requirements updated to require NonlinearSolveBase v1.15: - NonlinearSolve: 4.10.1 → 4.11.0 - BracketingNonlinearSolve: 1.3.1 → 1.4.0 - SimpleNonlinearSolve: 2.7.1 → 2.8.0 - NonlinearSolveFirstOrder: 1.8.1 → 1.9.0 - NonlinearSolveQuasiNewton: 1.8.1 → 1.9.0 - NonlinearSolveSpectralMethods: 1.3.1 → 1.4.0 - NonlinearSolveHomotopyContinuation: 0.1.6 → 0.2.0 - NonlinearSolveSciPy: 1.0.1 → 1.1.0 - SCCNonlinearSolve: 1.4.1 → 1.5.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context