Skip to content

fix stats of stabilized RK methods #2753

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

Merged
merged 4 commits into from
Jul 15, 2025
Merged

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Jul 15, 2025

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

I was wondering why an algorithm became so much slower when supplying an eigen_est although both the number of steps and the number of function evaluations reported in the stats reduced significantly 🙈

@ranocha ranocha added the bug label Jul 15, 2025
Copy link
Contributor

github-actions bot commented Jul 15, 2025

Benchmark Results (Julia v1)

Time benchmarks
master a0eae4b... master / a0eae4b...
construction/linear_N50 27.1 ± 0.78 μs 28 ± 14 μs 0.966 ± 0.48
construction/lotka_volterra 18 ± 0.22 μs 18.1 ± 0.27 μs 0.993 ± 0.019
construction/rober 17.9 ± 0.19 μs 18.1 ± 0.23 μs 0.989 ± 0.016
nonstiff/fitzhugh_nagumo/BS3 0.143 ± 0.0097 ms 0.147 ± 0.011 ms 0.975 ± 0.096
nonstiff/fitzhugh_nagumo/DP5 0.0973 ± 0.0093 ms 0.0986 ± 0.0097 ms 0.987 ± 0.13
nonstiff/fitzhugh_nagumo/Tsit5 0.116 ± 0.0081 ms 0.117 ± 0.0092 ms 0.994 ± 0.1
nonstiff/fitzhugh_nagumo/Vern6 0.166 ± 0.0085 ms 0.171 ± 0.0083 ms 0.973 ± 0.069
nonstiff/fitzhugh_nagumo/Vern7 0.112 ± 0.0081 ms 0.117 ± 0.0087 ms 0.957 ± 0.099
nonstiff/lotka_volterra/BS3 0.287 ± 0.01 ms 0.293 ± 0.011 ms 0.979 ± 0.051
nonstiff/lotka_volterra/DP5 0.0466 ± 0.016 ms 0.0465 ± 0.016 ms 1 ± 0.48
nonstiff/lotka_volterra/Tsit5 0.0623 ± 0.023 ms 0.0628 ± 0.024 ms 0.992 ± 0.52
nonstiff/lotka_volterra/Vern6 0.0822 ± 0.011 ms 0.0818 ± 0.011 ms 1.01 ± 0.19
nonstiff/lotka_volterra/Vern7 0.0499 ± 0.021 ms 0.0508 ± 0.021 ms 0.983 ± 0.59
nonstiff/pleiades/BS3 0.0862 ± 0.012 s 0.0865 ± 0.0091 s 0.997 ± 0.17
nonstiff/pleiades/DP5 1.25 ± 0.11 ms 1.27 ± 0.096 ms 0.988 ± 0.11
nonstiff/pleiades/Tsit5 16.2 ± 5.3 ms 15.6 ± 5.9 ms 1.04 ± 0.52
nonstiff/pleiades/Vern6 6.65 s 7.43 s 0.895
nonstiff/pleiades/Vern7 7.87 s 7.96 s 0.988
scaling/brusselator_2d/16x16 0.302 ± 0.029 s 0.306 ± 0.021 s 0.986 ± 0.12
scaling/brusselator_2d/32x32 7.05 s 7.23 s 0.975
scaling/brusselator_2d/8x8 11.1 ± 0.17 ms 11.3 ± 0.27 ms 0.985 ± 0.028
scaling/linear/N10 0.0375 ± 0.017 ms 0.0374 ± 0.017 ms 1 ± 0.64
scaling/linear/N100 0.789 ± 0.016 ms 0.798 ± 0.023 ms 0.989 ± 0.034
scaling/linear/N50 0.213 ± 0.011 ms 0.216 ± 0.01 ms 0.985 ± 0.068
stiff/pollution/FBDF 0.593 ± 0.015 ms 0.599 ± 0.013 ms 0.991 ± 0.033
stiff/pollution/KenCarp4 0.552 ± 0.011 ms 0.553 ± 0.011 ms 0.998 ± 0.027
stiff/pollution/Rodas4 0.764 ± 0.017 ms 0.779 ± 0.013 ms 0.981 ± 0.027
stiff/pollution/Rosenbrock23 1.35 ± 0.033 ms 1.38 ± 0.024 ms 0.981 ± 0.029
stiff/pollution/TRBDF2 0.513 ± 0.012 ms 0.521 ± 0.012 ms 0.985 ± 0.032
stiff/rober/FBDF 0.604 ± 0.01 ms 0.629 ± 0.011 ms 0.961 ± 0.023
stiff/rober/KenCarp4 0.753 ± 0.02 ms 0.749 ± 0.019 ms 1.01 ± 0.037
stiff/rober/Rodas4 0.402 ± 0.012 ms 0.401 ± 0.01 ms 1 ± 0.039
stiff/rober/Rosenbrock23 0.275 ± 0.0096 ms 0.276 ± 0.0094 ms 0.995 ± 0.049
stiff/rober/TRBDF2 1.74 ± 0.012 ms 1.74 ± 0.015 ms 1 ± 0.011
stiff/van_der_pol/FBDF 9.87 ± 0.079 ms 9.9 ± 0.1 ms 0.997 ± 0.013
stiff/van_der_pol/KenCarp4 4.61 ± 0.069 ms 4.68 ± 0.068 ms 0.986 ± 0.02
stiff/van_der_pol/Rodas4 7.31 ± 0.047 ms 7.23 ± 0.089 ms 1.01 ± 0.014
stiff/van_der_pol/Rosenbrock23 21.9 ± 0.17 ms 21.5 ± 0.19 ms 1.02 ± 0.012
stiff/van_der_pol/TRBDF2 2.99 ± 0.087 ms 2.93 ± 0.093 ms 1.02 ± 0.044
time_to_load 3.22 ± 0.027 s 3.3 ± 0.092 s 0.977 ± 0.029
Memory benchmarks
master a0eae4b... master / a0eae4b...
construction/linear_N50 0.071 k allocs: 0.0411 MB 0.071 k allocs: 0.0411 MB 1
construction/lotka_volterra 0.065 k allocs: 2.45 kB 0.065 k allocs: 2.45 kB 1
construction/rober 0.065 k allocs: 2.42 kB 0.065 k allocs: 2.42 kB 1
nonstiff/fitzhugh_nagumo/BS3 3.69 k allocs: 0.164 MB 3.69 k allocs: 0.164 MB 1
nonstiff/fitzhugh_nagumo/DP5 2.63 k allocs: 0.127 MB 2.63 k allocs: 0.127 MB 1
nonstiff/fitzhugh_nagumo/Tsit5 4 k allocs: 0.182 MB 4 k allocs: 0.182 MB 1
nonstiff/fitzhugh_nagumo/Vern6 4.54 k allocs: 0.207 MB 4.54 k allocs: 0.207 MB 1
nonstiff/fitzhugh_nagumo/Vern7 3.91 k allocs: 0.165 MB 3.91 k allocs: 0.165 MB 1
nonstiff/lotka_volterra/BS3 7.88 k allocs: 0.365 MB 7.88 k allocs: 0.365 MB 1
nonstiff/lotka_volterra/DP5 1.21 k allocs: 0.0543 MB 1.21 k allocs: 0.0543 MB 1
nonstiff/lotka_volterra/Tsit5 2.17 k allocs: 0.093 MB 2.17 k allocs: 0.093 MB 1
nonstiff/lotka_volterra/Vern6 2.24 k allocs: 0.0986 MB 2.24 k allocs: 0.0986 MB 1
nonstiff/lotka_volterra/Vern7 1.65 k allocs: 0.0736 MB 1.65 k allocs: 0.0736 MB 1
nonstiff/pleiades/BS3 0.685 M allocs: 0.0675 GB 0.685 M allocs: 0.0675 GB 1
nonstiff/pleiades/DP5 6.63 k allocs: 0.51 MB 6.63 k allocs: 0.51 MB 1
nonstiff/pleiades/Tsit5 0.186 M allocs: 20.4 MB 0.186 M allocs: 20.4 MB 1
nonstiff/pleiades/Vern6 0.038 G allocs: 4.05 GB 0.038 G allocs: 4.05 GB 1
nonstiff/pleiades/Vern7 0.044 G allocs: 4.63 GB 0.044 G allocs: 4.63 GB 1
scaling/brusselator_2d/16x16 3.58 k allocs: 0.152 GB 3.58 k allocs: 0.152 GB 1
scaling/brusselator_2d/32x32 3.4 k allocs: 2.22 GB 3.4 k allocs: 2.22 GB 1
scaling/brusselator_2d/8x8 2.62 k allocs: 8.76 MB 2.62 k allocs: 8.76 MB 1
scaling/linear/N10 0.752 k allocs: 0.0514 MB 0.752 k allocs: 0.0514 MB 1
scaling/linear/N100 2.27 k allocs: 0.901 MB 2.27 k allocs: 0.901 MB 1
scaling/linear/N50 1.66 k allocs: 0.348 MB 1.66 k allocs: 0.348 MB 1
stiff/pollution/FBDF 1.5 k allocs: 0.288 MB 1.5 k allocs: 0.288 MB 1
stiff/pollution/KenCarp4 0.516 k allocs: 0.134 MB 0.516 k allocs: 0.134 MB 1
stiff/pollution/Rodas4 1.28 k allocs: 0.363 MB 1.28 k allocs: 0.363 MB 1
stiff/pollution/Rosenbrock23 2.77 k allocs: 0.819 MB 2.77 k allocs: 0.819 MB 1
stiff/pollution/TRBDF2 0.783 k allocs: 0.168 MB 0.783 k allocs: 0.168 MB 1
stiff/rober/FBDF 2.89 k allocs: 0.137 MB 2.89 k allocs: 0.137 MB 1
stiff/rober/KenCarp4 1.3 k allocs: 0.0575 MB 1.3 k allocs: 0.0575 MB 1
stiff/rober/Rodas4 2.19 k allocs: 0.106 MB 2.19 k allocs: 0.106 MB 1
stiff/rober/Rosenbrock23 2.51 k allocs: 0.117 MB 2.51 k allocs: 0.117 MB 1
stiff/rober/TRBDF2 7.72 k allocs: 0.36 MB 7.72 k allocs: 0.36 MB 1
stiff/van_der_pol/FBDF 0.0444 M allocs: 2.2 MB 0.0444 M allocs: 2.2 MB 1
stiff/van_der_pol/KenCarp4 4.27 k allocs: 0.184 MB 4.27 k allocs: 0.184 MB 1
stiff/van_der_pol/Rodas4 0.0377 M allocs: 1.86 MB 0.0377 M allocs: 1.86 MB 1
stiff/van_der_pol/Rosenbrock23 0.213 M allocs: 9.09 MB 0.213 M allocs: 9.09 MB 1
stiff/van_der_pol/TRBDF2 5.02 k allocs: 0.212 MB 5.02 k allocs: 0.212 MB 1
time_to_load 0.159 k allocs: 11.2 kB 0.159 k allocs: 11.2 kB 1

@ChrisRackauckas
Copy link
Member

I was wondering why an algorithm became so much slower when supplying an eigen_est although both the number of steps and the number of function evaluations reported in the stats reduced significantly 🙈

I've seen this before and started looking into the adaptivity algorithm and thought it must have possible improvements but couldn't figure out why it was behaving like that. This explains a lot 😅

@ranocha
Copy link
Member Author

ranocha commented Jul 15, 2025

Thanks for your review - and for catching the debug statement I forgot.

@ChrisRackauckas ChrisRackauckas merged commit d0284e7 into master Jul 15, 2025
141 of 153 checks passed
@ChrisRackauckas ChrisRackauckas deleted the hr/fix_stats_stabilized_rk branch July 15, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants