SciML / PSOGPU.jl

GPU accelerated Particle Swarm Optimization
MIT License
13 stars 1 forks source link

[WIP] Add more benchmarks #44

Closed utkarsh530 closed 6 months ago

utkarsh530 commented 7 months ago

Checklist

Additional context

Add any other context about the problem here.

utkarsh530 commented 7 months ago

Fitzhugh Nagamo Benchmarks https://docs.sciml.ai/SciMLBenchmarksOutput/stable/ParameterEstimation/FitzHughNagumoParameterEstimation/:

BenchmarkTools.Trial: 28 samples with 1 evaluation.
 Range (min … max):  170.824 ms … 211.453 ms  ┊ GC (min … max): 0.00% … 11.76%
 Time  (median):     179.649 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   180.377 ms ±   9.862 ms  ┊ GC (mean ± σ):  1.84% ±  2.55%

  █                     ▁▁                                       
  █▄▆▆▁▁▁▁▁▁▁▄▁▁▄▁▁▁▁▁▁▁██▄▄▁▁▁▁▁▁▄▄▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▄ ▁
  171 ms           Histogram: frequency by time          211 ms <

 Memory estimate: 2.06 MiB, allocs estimate: 42709.
julia> @show gsol
gsol = PSOGPU.SPSOGBest{SVector{4, Float32}, Float32}(Float32[1.4175674, 0.934993, 0.049795125, 0.5001013], 3.5554986f-5)
PSOGPU.SPSOGBest{SVector{4, Float32}, Float32}(Float32[1.4175674, 0.934993, 0.049795125, 0.5001013], 3.5554986f-5)
utkarsh530 commented 7 months ago

Lotka Volterra https://docs.sciml.ai/SciMLSensitivity/stable/tutorials/parameter_estimation_ode/ :

julia> @benchmark PSOGPU.parameter_estim_ode!($prob, $(deepcopy(solver_cache)),
           $lb,
           $ub, Val(adaptive); saveat = t, dt = 0.1, backend = CUDABackend())
BenchmarkTools.Trial: 57 samples with 1 evaluation.
 Range (min … max):  78.997 ms … 117.178 ms  ┊ GC (min … max): 0.00% … 21.38%
 Time  (median):     80.868 ms               ┊ GC (median):    0.00%
 Time  (mean ± σ):   87.706 ms ±  10.700 ms  ┊ GC (mean ± σ):  3.43% ±  4.84%

  █▃▃                                                           
  ███▆▄▃▁▁▁▃▁▁▃▁▄▁▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▆▇▃▃▁▃▃▃▁▃▁▃▁▃▁▁▁▁▁▁▃▁▁▁▁▁▁▃ ▁
  79 ms           Histogram: frequency by time          114 ms <

 Memory estimate: 2.13 MiB, allocs estimate: 43106.
julia> @time gsol = PSOGPU.parameter_estim_ode!(prob, solver_cache,
           lb,
           ub, Val(adaptive); saveat = t, dt = 0.1, maxiters = 100)
  0.079444 seconds (43.10 k allocations: 2.124 MiB)
PSOGPU.SPSOGBest{SVector{4, Float64}, Float64}([1.8749830934479235, 1.874982914866944, 2.1886256202246708, 2.18862664910988], 4.5790030071118923e-11)
ChrisRackauckas commented 6 months ago

Why not make these SciMLBenchmarks runs?

utkarsh530 commented 6 months ago

Yeah, I plan to do it once I tag the release and populate some docs.