Skip to content
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

Draft: trial better ode wrapper #859

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

oscardssmith
Copy link
Contributor

This is a prototype of a replacement for FunctionWrappersWrappers specialization of ODEs. It works by not specializing the function, and wrapping the p and t fields to prevent them from needing to be boxed. This still has some overhead, and doesn't work for derivatives with respect to t or p, but it will work with arbitrary chunksizes for the jacobians.

julia> prob = ODEProblem{true}(lorenz!, [1.0; 0.0; 0.0], (0,100.0)) # FunctionWrapperWrapper
julia> @btime  solve(prob, Tsit5(), save_everystep=false);
  221.112 μs (74 allocations: 3.98 KiB)
julia> prob2 = ODEProblem(lorenz!, [1.0; 0.0; 0.0], (0,100.0)) # new wrapper
julia> @btime  solve(prob2, Tsit5(), save_everystep=false);
  254.728 μs (61 allocations: 3.48 KiB)

@oscardssmith oscardssmith changed the title trial better ode wrapper Draft: trial better ode wrapper Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant