Skip to content

Commit bf34fd8

Browse files
Merge pull request #1353 from ChrisRackauckas-Claude/add-simd-methods-nonstiff
Add SIMD RK methods to NonStiffODE benchmarks
2 parents 747d591 + 2ff571a commit bf34fd8

File tree

7 files changed

+65
-31
lines changed

7 files changed

+65
-31
lines changed

benchmarks/NonStiffODE/EnrightPryce_wpd.jmd

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The purpose of this benchmark is to test explicit Runge-Kutta methods on the Enr
1010
```julia
1111
using OrdinaryDiffEq, ParameterizedFunctions, ODEInterface,
1212
ODEInterfaceDiffEq, LSODA, Sundials, DiffEqDevTools,
13-
StaticArrays
13+
StaticArrays, OrdinaryDiffEqSIMDRK
1414
using Plots
1515
gr()
1616

@@ -21,17 +21,14 @@ abstols = 1.0 ./ 10.0 .^ (6:13)
2121
reltols = 1.0 ./ 10.0 .^ (3:10)
2222
```
2323

24-
### SIMD Algorithms (Currently Disabled)
25-
26-
Note: The SIMD RK methods will be added once the OrdinaryDiffEqSIMDRK package is publicly available.
24+
### SIMD Algorithms
2725

2826
```julia
29-
# simdrkalgs = [
30-
# Dict(:alg=>MER5v2()),
31-
# Dict(:alg=>MER6v2()),
32-
# Dict(:alg=>RK6v4())
33-
# ]
34-
simdrkalgs = []
27+
simdrkalgs = [
28+
Dict(:alg=>MER5v2()),
29+
Dict(:alg=>MER6v2()),
30+
Dict(:alg=>RK6v4())
31+
]
3532
```
3633

3734
### Low Order Setup

benchmarks/NonStiffODE/FitzhughNagumo_wpd.jmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The purpose of this is to see how the errors scale on a standard nonlinear probl
1010
```julia
1111
using OrdinaryDiffEq, ParameterizedFunctions, ODEInterface,
1212
ODEInterfaceDiffEq, LSODA, Sundials, DiffEqDevTools,
13-
StaticArrays
13+
StaticArrays, OrdinaryDiffEqSIMDRK
1414
using Plots;
1515
gr()
1616

@@ -46,7 +46,10 @@ setups = [Dict(:alg=>DP5())
4646
Dict(:alg=>Tsit5())
4747
Dict(:alg=>Vern6())
4848
Dict(:alg=>Tsit5(), :prob_choice => 2)
49-
Dict(:alg=>Vern6(), :prob_choice => 2)]
49+
Dict(:alg=>Vern6(), :prob_choice => 2)
50+
Dict(:alg=>MER5v2(), :prob_choice => 2)
51+
Dict(:alg=>MER6v2(), :prob_choice => 2)
52+
Dict(:alg=>RK6v4(), :prob_choice => 2)]
5053
wp = WorkPrecisionSet(probs, abstols, reltols, setups; appxsol = test_sol,
5154
save_everystep = false, numruns = 100, maxiters = 1000)
5255
plot(wp)

benchmarks/NonStiffODE/LotkaVolterra_wpd.jmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The purpose of this problem is to test the performance on easy problems. Since i
99

1010
```julia
1111
using OrdinaryDiffEq, ParameterizedFunctions, ODEInterfaceDiffEq, LSODA,
12-
Sundials, DiffEqDevTools, StaticArrays
12+
Sundials, DiffEqDevTools, StaticArrays, OrdinaryDiffEqSIMDRK
1313

1414
f = @ode_def LotkaVolterra begin
1515
dx = a*x - b*x*y
@@ -43,7 +43,10 @@ setups = [Dict(:alg=>DP5())
4343
Dict(:alg=>Tsit5())
4444
Dict(:alg=>Vern6())
4545
Dict(:alg=>Tsit5(), :prob_choice => 2)
46-
Dict(:alg=>Vern6(), :prob_choice => 2)]
46+
Dict(:alg=>Vern6(), :prob_choice => 2)
47+
Dict(:alg=>MER5v2(), :prob_choice => 2)
48+
Dict(:alg=>MER6v2(), :prob_choice => 2)
49+
Dict(:alg=>RK6v4(), :prob_choice => 2)]
4750
wp = WorkPrecisionSet(probs, abstols, reltols, setups; appxsol = test_sol,
4851
save_everystep = false, maxiters = 10000, numruns = 100)
4952
plot(wp)

benchmarks/NonStiffODE/Manifest.toml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.10.10"
44
manifest_format = "2.0"
5-
project_hash = "65282984342ab67ee881191028a5586e6f0b8834"
5+
project_hash = "fedc28d1f200e9777f20b0ae68e6b540ef1f551b"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "60665b326b75db6517939d0e1875850bc4a54368"
@@ -367,10 +367,10 @@ uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
367367
version = "1.9.1"
368368

369369
[[deps.DiffEqBase]]
370-
deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "FastPower", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "Setfield", "Static", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "TruncatedStacktraces"]
371-
git-tree-sha1 = "1b1e070e57681d1176d99a5ec455717e24686612"
370+
deps = ["ArrayInterface", "ConcreteStructs", "DocStringExtensions", "EnzymeCore", "FastBroadcast", "FastClosures", "FastPower", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "Setfield", "Static", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "TruncatedStacktraces"]
371+
git-tree-sha1 = "529087a10b502502201c7bf4e8769e40d7c15a17"
372372
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
373-
version = "6.183.2"
373+
version = "6.184.0"
374374

375375
[deps.DiffEqBase.extensions]
376376
DiffEqBaseCUDAExt = "CUDA"
@@ -560,9 +560,9 @@ version = "1.6.0"
560560

561561
[[deps.DynamicPolynomials]]
562562
deps = ["Future", "LinearAlgebra", "MultivariatePolynomials", "MutableArithmetics", "Reexport", "Test"]
563-
git-tree-sha1 = "98c4bb95af37e5d980129261fdd6dab0392c6607"
563+
git-tree-sha1 = "ca693f8707a77a0e365d49fe4622203b72b6cf1d"
564564
uuid = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
565-
version = "0.6.2"
565+
version = "0.6.3"
566566

567567
[[deps.DynamicQuantities]]
568568
deps = ["DispatchDoctor", "PrecompileTools", "TestItems", "Tricks"]
@@ -884,6 +884,12 @@ git-tree-sha1 = "9e13b8d8b1367d9692a90ea4711b4278e4755c32"
884884
uuid = "eafb193a-b7ab-5a9e-9068-77385905fa72"
885885
version = "0.5.3"
886886

887+
[[deps.HostCPUFeatures]]
888+
deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"]
889+
git-tree-sha1 = "8e070b599339d622e9a081d17230d74a5c473293"
890+
uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0"
891+
version = "0.1.17"
892+
887893
[[deps.HypergeometricFunctions]]
888894
deps = ["LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"]
889895
git-tree-sha1 = "68c173f4f449de5b438ee67ed0c9c748dc31a2ec"
@@ -892,9 +898,9 @@ version = "0.3.28"
892898

893899
[[deps.IJulia]]
894900
deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Logging", "Markdown", "Pkg", "PrecompileTools", "Printf", "REPL", "Random", "SHA", "Sockets", "UUIDs", "ZMQ"]
895-
git-tree-sha1 = "2004107fe26a14a37c7bd9b51c006809b177b913"
901+
git-tree-sha1 = "66b1f8d8b870814a079da381dd20416c53e73839"
896902
uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
897-
version = "1.30.0"
903+
version = "1.30.1"
898904

899905
[[deps.IfElse]]
900906
git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1"
@@ -1728,6 +1734,12 @@ git-tree-sha1 = "6b941dba1c669f8dbb24faf951e5ec8665ff5019"
17281734
uuid = "2d112036-d095-4a1e-ab9a-08536f3ecdbf"
17291735
version = "1.6.0"
17301736

1737+
[[deps.OrdinaryDiffEqSIMDRK]]
1738+
deps = ["MuladdMacro", "OrdinaryDiffEqCore", "Reexport", "SLEEFPirates", "Static", "UnPack", "VectorizationBase"]
1739+
git-tree-sha1 = "fb521b8b352d534b7ac2558e8ffda9e2d3378090"
1740+
uuid = "dc97f408-7a72-40e4-9b0d-228a53b292f8"
1741+
version = "1.1.0"
1742+
17311743
[[deps.OrdinaryDiffEqSSPRK]]
17321744
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static", "StaticArrays"]
17331745
git-tree-sha1 = "af955c61407631d281dd4c2e8331cdfea1af49be"
@@ -2075,11 +2087,17 @@ git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c"
20752087
uuid = "94e857df-77ce-4151-89e5-788b33177be4"
20762088
version = "0.1.0"
20772089

2090+
[[deps.SLEEFPirates]]
2091+
deps = ["IfElse", "Static", "VectorizationBase"]
2092+
git-tree-sha1 = "456f610ca2fbd1c14f5fcf31c6bfadc55e7d66e0"
2093+
uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa"
2094+
version = "0.6.43"
2095+
20782096
[[deps.SciMLBase]]
20792097
deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Moshi", "PreallocationTools", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"]
2080-
git-tree-sha1 = "a06d451a6d0fa6e6da34d047d61af8beb187b0f1"
2098+
git-tree-sha1 = "33786c33502a6652fba239d3062ccc5e4cdd30c4"
20812099
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2082-
version = "2.112.0"
2100+
version = "2.114.0"
20832101

20842102
[deps.SciMLBase.extensions]
20852103
SciMLBaseChainRulesCoreExt = "ChainRulesCore"
@@ -2561,6 +2579,12 @@ git-tree-sha1 = "ca0969166a028236229f63514992fc073799bb78"
25612579
uuid = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d"
25622580
version = "0.2.0"
25632581

2582+
[[deps.VectorizationBase]]
2583+
deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"]
2584+
git-tree-sha1 = "4ab62a49f1d8d9548a1c8d1a75e5f55cf196f64e"
2585+
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
2586+
version = "0.21.71"
2587+
25642588
[[deps.VersionParsing]]
25652589
git-tree-sha1 = "58d6e80b4ee071f5efd07fda82cb9fbe17200868"
25662590
uuid = "81def892-9a0e-5fdd-b105-ffc91e053289"

benchmarks/NonStiffODE/Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
33
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
44
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
5-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
65
LSODA = "7f56f5a3-f504-529b-bc02-0b1fe5e64312"
6+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
77
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
88
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
99
ODEInterfaceDiffEq = "09606e27-ecf5-54fc-bb29-004bd9f985bf"
1010
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
11+
OrdinaryDiffEqSIMDRK = "dc97f408-7a72-40e4-9b0d-228a53b292f8"
1112
ParameterizedFunctions = "65888b18-ceab-5e60-b2b9-181511a3b968"
1213
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1314
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -24,7 +25,7 @@ LSODA = "0.7"
2425
ModelingToolkit = "9"
2526
ODEInterface = "0.5"
2627
ODEInterfaceDiffEq = "3.10"
27-
OrdinaryDiffEq = "6.19"
28+
OrdinaryDiffEq = "6"
2829
ParameterizedFunctions = "5.3"
2930
Plots = "1.4"
3031
SciMLBenchmarks = "0.1"

benchmarks/NonStiffODE/RigidBody_wpd.jmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: Chris Rackauckas
55

66
```julia
77
using OrdinaryDiffEq, ParameterizedFunctions, ODEInterfaceDiffEq, LSODA,
8-
Sundials, DiffEqDevTools, StaticArrays
8+
Sundials, DiffEqDevTools, StaticArrays, OrdinaryDiffEqSIMDRK
99

1010
k(t) = 0.25*sin(t)^2
1111

@@ -40,7 +40,10 @@ setups = [Dict(:alg=>DP5())
4040
Dict(:alg=>Tsit5())
4141
Dict(:alg=>Vern6())
4242
Dict(:alg=>Tsit5(), :prob_choice => 2)
43-
Dict(:alg=>Vern6(), :prob_choice => 2)]
43+
Dict(:alg=>Vern6(), :prob_choice => 2)
44+
Dict(:alg=>MER5v2(), :prob_choice => 2)
45+
Dict(:alg=>MER6v2(), :prob_choice => 2)
46+
Dict(:alg=>RK6v4(), :prob_choice => 2)]
4447
wp = WorkPrecisionSet(probs, abstols, reltols, setups; appxsol = test_sol,
4548
save_everystep = true, numruns = 100, maxiters = 10000)
4649
plot(wp)

benchmarks/NonStiffODE/linear_wpd.jmd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ rapid development has its advantages.
2323
## Setup
2424

2525
```julia
26-
using OrdinaryDiffEq, Sundials, DiffEqDevTools, Plots, ODEInterfaceDiffEq, LSODA
26+
using OrdinaryDiffEq, Sundials, DiffEqDevTools, Plots, ODEInterfaceDiffEq, LSODA, OrdinaryDiffEqSIMDRK
2727
using Random
2828
Random.seed!(123)
2929
gr()
@@ -56,9 +56,12 @@ setups = [Dict(:alg=>DP5())
5656
Dict(:alg=>ode45())
5757
Dict(:alg=>dopri5())
5858
Dict(:alg=>ARKODE(Sundials.Explicit(), etable = Sundials.DORMAND_PRINCE_7_4_5))
59-
Dict(:alg=>Tsit5())]
59+
Dict(:alg=>Tsit5())
60+
Dict(:alg=>MER5v2())
61+
Dict(:alg=>MER6v2())
62+
Dict(:alg=>RK6v4())]
6063
solnames = ["OrdinaryDiffEq"; "ODE"; "ODEInterface"; "Sundials ARKODE";
61-
"OrdinaryDiffEq Tsit5"]
64+
"OrdinaryDiffEq Tsit5"; "MER5v2"; "MER6v2"; "RK6v4"]
6265
wp = WorkPrecisionSet(
6366
prob, abstols, reltols, setups; names = solnames, save_everystep = false, numruns = 100)
6467
plot(wp)

0 commit comments

Comments
 (0)