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

Refactor FIRK solvers #211

Merged
merged 5 commits into from
Sep 15, 2024
Merged

Conversation

ErikQQY
Copy link
Member

@ErikQQY ErikQQY commented Sep 12, 2024

  • Add precompilation options for Lobatto and Radau solvers, but precompiling all of them seems to take a long time, so just set them as false for now
  • Previous tolerance for nested nonlinear solving is bad, change it to nothing as default so that NonlinearSolve.jl can choose automatically
  • Some variables and functions in some functions are not used, so cleaned up a little
  • Some functions are not optimal, improve their performance
  • Unify the interpolant evaluation for MIRK and FIRK methods

Copy link
Contributor

github-actions bot commented Sep 12, 2024

Benchmark Results

master ac46c48... master/ac46c48389ac67...
Simple Pendulum/IIP/BoundaryValueDiffEq.MIRK2() 6.59 ± 0.22 ms 6.72 ± 0.28 ms 0.981
Simple Pendulum/IIP/BoundaryValueDiffEq.MIRK3() 2.37 ± 0.084 ms 2.39 ± 0.11 ms 0.99
Simple Pendulum/IIP/BoundaryValueDiffEq.MIRK4() 0.826 ± 0.033 ms 0.834 ± 0.038 ms 0.991
Simple Pendulum/IIP/BoundaryValueDiffEq.MIRK5() 0.875 ± 0.043 ms 0.888 ± 0.049 ms 0.986
Simple Pendulum/IIP/BoundaryValueDiffEq.MIRK6() 0.989 ± 0.038 ms 1.01 ± 0.041 ms 0.982
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 1.41 ± 0.13 ms 1.41 ± 0.13 ms 0.994
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 2.76 ± 0.25 ms 2.77 ± 0.23 ms 0.995
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.0375 ± 0.0063 s 0.0378 ± 0.0063 s 0.991
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.122 ± 0.0053 s 0.122 ± 0.0034 s 1
Simple Pendulum/IIP/Shooting(Tsit5()) 0.209 ± 0.0086 ms 0.209 ± 0.0077 ms 1
Simple Pendulum/OOP/BoundaryValueDiffEq.MIRK2() 0.0403 ± 0.0019 s 0.0419 ± 0.0011 s 0.962
Simple Pendulum/OOP/BoundaryValueDiffEq.MIRK3() 11.7 ± 0.25 ms 12.1 ± 0.24 ms 0.968
Simple Pendulum/OOP/BoundaryValueDiffEq.MIRK4() 3.4 ± 0.084 ms 3.49 ± 0.12 ms 0.974
Simple Pendulum/OOP/BoundaryValueDiffEq.MIRK5() 3.47 ± 0.098 ms 3.57 ± 0.11 ms 0.973
Simple Pendulum/OOP/BoundaryValueDiffEq.MIRK6() 3.63 ± 0.12 ms 3.69 ± 0.12 ms 0.984
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 3.71 ± 0.82 ms 3.58 ± 1.1 ms 1.04
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 6.58 ± 1.5 ms 6.34 ± 1.8 ms 1.04
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.135 ± 0.015 s 0.134 ± 0.01 s 1.01
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.419 ± 0.0067 s 0.413 ± 0.0052 s 1.01
Simple Pendulum/OOP/Shooting(Tsit5()) 0.798 ± 0.027 ms 0.749 ± 0.039 ms 1.06
time_to_load 6.44 ± 0.038 s 5.66 ± 0.043 s 1.14

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@ChrisRackauckas
Copy link
Member

You should probably just split it to a subpackage, i.e. lib/BoundaryDiffEqFIRK, and then you can set it to precompile, but it does not have to be in the standard BounaryDiffEq load. The plan should be to do this split with all of the solvers.

@ErikQQY
Copy link
Member Author

ErikQQY commented Sep 13, 2024

Yeah, splitting BoundaryValueDiffEq.jl into subpackages like what we've done in OrdinaryDiffEq.jl is on my TODO list, so let's leave the precompile stuff into splitting part and get the others in? Since the Shooting, MIRK and FIRK are separately implemented in BoundaryValueDiffEq.jl, I can get that done today

@ErikQQY ErikQQY changed the title Refactor FIRK methods solvers Refactor FIRK solvers Sep 13, 2024
Signed-off-by: ErikQQY <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit 0a2b4ac into SciML:master Sep 15, 2024
10 checks passed
@ErikQQY ErikQQY deleted the qqy/refactor_firk branch September 15, 2024 14:18
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.

2 participants