-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Leaner serialization for solution types #629
Comments
For the first item, should it be |
yes, and traits go in |
It's just Verner and BS5 (low order RK) |
Where should the strip functions go? SciMLBase |
BTW I created the trait SciML/OrdinaryDiffEq.jl@9734f49 since I ended up needing it. It needs to get raised to the SciMLBase level.
yes that's fine. |
This adds a This adds Now I need to make a |
https://github.com/SciML/OrdinaryDiffEq.jl/blob/master/src/caches/rosenbrock_caches.jl doesn't exist it seems Or these caches for each implicit solver, e.g. https://github.com/SciML/OrdinaryDiffEq.jl/blob/master/lib/OrdinaryDiffEqRosenbrock/src/rosenbrock_caches.jl ? |
The latter |
It looks like SciML/OrdinaryDiffEq.jl#2320 will combine the cache types, so I'll only need to deal with |
Also, is there any way to tell whether an algorithm is implicit/has caches, other than looking at the docs? Would that be worth having as a trait? |
right |
@jClugstor what's the next step here? |
Figuring out how to handle the explicit and implicit solvers seperately, since the Rosenbrock caches have some function information. It looks like there are imminent changes to the Rosenbrock caches so I was planning on waiting on those before trying to implement the stripping. |
Alright, but do the other methods first? |
@jClugstor are you adding integration tests today? |
I was just going to ask about this.
|
|
Just needs docs. @jClugstor add to the solution interface page in DiffEqDocs |
The solution types contain functions, and things like JLD2 don't like functions. So it would be nice to have a "strip_solution` function that generates a much leaner form of the solution for simply doing easier serialization. Here's how that should look:
has_lazy_interpolation
in https://github.com/SciML/SciMLBase.jl/blob/master/src/alg_traits.jl which is then set to true on BS5 and VernX solvers.strip_solution
should then give an informative error message that these problems are not supported by this function. Just some proper error handling, and with that out of the way the other solvers should be free to go.prob
andalg
are nothing.sol.interp
holds some extra information as well. So in SciMLBase we needstrip_interp(::AbstractInterpolation)
. The SciMLBase ones are just the identity function, so that's easy https://github.com/SciML/SciMLBase.jl/blob/master/src/interpolation.jl .f
is only in there for the lazy interpolations, so set it tonothing
. You need to keep thecache
s because that's used for dispatch, but at this point you're done with explicit methods.jac_config
andgrad_config
, as those contain function information. As a simple thing, you can just create a new cache with everything nothing though since this is only used for dispatch (andaddsteps!
, but since you know these caches are non-lazy the interpolationaddsteps!
post solution is trivial so it won't use anything in the cache). We need to make good functionality for this anyways for better default solvers (CC @oscardssmith), so it might be a good time to do this now.With that done
strip_solution(sol)
should return a lean solution with no function information in it (or rather, any function information in it is in SciMLBase, which also defines the structure so that's a required import) and so it should work just fine with any BSON, JLD2, etc. package.The text was updated successfully, but these errors were encountered: