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

Faster Precompilation #155

Merged
merged 24 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
style = "sciml"
annotate_untyped_fields_with_any = false
format_markdown = true
format_docstrings = true
join_lines_based_on_source = false
15 changes: 8 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
group:
- Shooting
- MIRK
- Others
os:
- ubuntu-latest
- macos-latest
- windows-latest
version:
- '1'
- '~1.10.0-0'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand All @@ -42,7 +41,9 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
GROUP: ${{ matrix.group }}
GROUP: "CPU"
RETESTITEMS_NWORKERS: 4
RETESTITEMS_NWORKER_THREADS: 2
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.5.0]
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
Expand Down
69 changes: 37 additions & 32 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "BoundaryValueDiffEq"
uuid = "764a87c0-6b3e-53db-9096-fe964310641d"
version = "5.6.3"
version = "5.7.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand All @@ -10,10 +10,13 @@ BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e"
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Expand All @@ -23,57 +26,59 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
Tricks = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
TruncatedStacktraces = "781d530d-4396-4725-bb49-402e4bee1e77"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[weakdeps]
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"

[extensions]
BoundaryValueDiffEqODEInterfaceExt = "ODEInterface"
BoundaryValueDiffEqOrdinaryDiffEqExt = "OrdinaryDiffEq"

[compat]
ADTypes = "0.2"
Adapt = "3, 4"
Aqua = "0.7"
ArrayInterface = "7"
BandedMatrices = "1"
ConcreteStructs = "0.2"
DiffEqBase = "6.145"
FastAlmostBandedMatrices = "0.1"
ForwardDiff = "0.10"
LinearAlgebra = "1.9"
LinearSolve = "2.20"
NonlinearSolve = "2.6.1, 3"
ADTypes = "0.2.6"
Adapt = "4"
Aqua = "0.8"
ArrayInterface = "7.7"
BandedMatrices = "1.4"
ConcreteStructs = "0.2.3"
DiffEqBase = "6.146"
DiffEqDevTools = "2.44"
FastAlmostBandedMatrices = "0.1.1"
FastClosures = "0.3"
ForwardDiff = "0.10.36"
JET = "0.8"
LinearAlgebra = "1.10"
LinearSolve = "2.21"
Logging = "1.10"
NonlinearSolve = "3.8.1"
ODEInterface = "0.5"
OrdinaryDiffEq = "6"
OrdinaryDiffEq = "6.63"
PreallocationTools = "0.4"
PrecompileTools = "1"
Preferences = "1"
RecursiveArrayTools = "2.38.10, 3"
Reexport = "0.2, 1.0"
SciMLBase = "2.6.2"
PrecompileTools = "1.2"
Preferences = "1.4"
Random = "1.10"
ReTestItems = "1.23.1"
RecursiveArrayTools = "3.4"
Reexport = "1.2"
SciMLBase = "2.31"
Setfield = "1"
SparseArrays = "1.9"
SparseDiffTools = "2.9"
Tricks = "0.1"
TruncatedStacktraces = "1"
UnPack = "1"
julia = "1.9"
SparseArrays = "1.10"
SparseDiffTools = "2.14"
StaticArrays = "1.8.1"
Test = "1.10"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["StaticArrays", "Random", "DiffEqDevTools", "OrdinaryDiffEq", "Test", "SafeTestsets", "ODEInterface", "Aqua", "LinearSolve"]
test = ["Aqua", "DiffEqDevTools", "JET", "LinearSolve", "ODEInterface", "OrdinaryDiffEq", "Random", "ReTestItems", "RecursiveArrayTools", "StaticArrays", "Test"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ functionality should check out [DifferentialEquations.jl](https://github.com/Jul

## API

BoundaryValueDiffEq.jl is part of the JuliaDiffEq common interface, but can be used independently of DifferentialEquations.jl. The only requirement is that the user passes a BoundaryValueDiffEq.jl algorithm to solve. For example, we can solve the [BVP tutorial from the documentation](https://docs.sciml.ai/DiffEqDocs/stable/tutorials/bvp_example/) using the `MIRK4()` algorithm:
BoundaryValueDiffEq.jl is part of the SciML common interface, but can be used independently of DifferentialEquations.jl. The only requirement is that the user passes a BoundaryValueDiffEq.jl algorithm to solve. For example, we can solve the [BVP tutorial from the documentation](https://docs.sciml.ai/DiffEqDocs/stable/tutorials/bvp_example/) using the `MIRK4()` algorithm:

```julia
using BoundaryValueDiffEq
Expand Down Expand Up @@ -46,18 +46,18 @@ For the list of available solvers, please refer to the [DifferentialEquations.jl
Precompilation can be controlled via `Preferences.jl`

- `PrecompileMIRK` -- Precompile the MIRK2 - MIRK6 algorithms (default: `true`).
- `PrecompileShooting` -- Precompile the single shooting algorithms (default: `false`). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileMultipleShooting` -- Precompile the multiple shooting algorithms (default: `false`). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileMIRKNLLS` -- Precompile the MIRK2 - MIRK6 algorithms for under-determined and over-determined BVPs (default: `false`).
- `PrecompileShootingNLLS` -- Precompile the single shooting algorithms for under-determined and over-determined BVPs (default: `false`). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileMultipleShootingNLLS` -- Precompile the multiple shooting algorithms for under-determined and over-determined BVPs (default: `false` ). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileShooting` -- Precompile the single shooting algorithms (default: `true`).
- `PrecompileMultipleShooting` -- Precompile the multiple shooting algorithms (default: `true`).
- `PrecompileMIRKNLLS` -- Precompile the MIRK2 - MIRK6 algorithms for under-determined and over-determined BVPs (default: `true`).
- `PrecompileShootingNLLS` -- Precompile the single shooting algorithms for under-determined and over-determined BVPs (default: `true`).
- `PrecompileMultipleShootingNLLS` -- Precompile the multiple shooting algorithms for under-determined and over-determined BVPs (default: `true` ).

To set these preferences before loading the package, do the following (replacing `PrecompileShooting` with the preference you want to set, or pass in multiple pairs to set them together):

```julia
using Preferences, UUIDs
Preferences.set_preferences!(UUID("764a87c0-6b3e-53db-9096-fe964310641d"),
"PrecompileShooting" => false)
Preferences.set_preferences!(
UUID("764a87c0-6b3e-53db-9096-fe964310641d"), "PrecompileShooting" => false)
```

## Running Benchmarks Locally
Expand Down
18 changes: 6 additions & 12 deletions benchmark/simple_pendulum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,36 @@ function create_simple_pendulum_benchmark()

if @isdefined(MultipleShooting)
iip_suite["MultipleShooting(100, Tsit5; grid_coarsening = true)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_iip,
$MultipleShooting(100, Tsit5()))
$SimplePendulumBenchmark.prob_iip, $MultipleShooting(100, Tsit5()))
iip_suite["MultipleShooting(100, Tsit5; grid_coarsening = false)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_iip,
$MultipleShooting(100, Tsit5(); grid_coarsening = false))
iip_suite["MultipleShooting(10, Tsit5; grid_coarsening = true)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_iip,
$MultipleShooting(10, Tsit5()))
$SimplePendulumBenchmark.prob_iip, $MultipleShooting(10, Tsit5()))
iip_suite["MultipleShooting(10, Tsit5; grid_coarsening = false)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_iip,
$MultipleShooting(10, Tsit5(); grid_coarsening = false))
end
if @isdefined(Shooting)
iip_suite["Shooting(Tsit5())"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_iip,
$Shooting(Tsit5()))
$SimplePendulumBenchmark.prob_iip, $Shooting(Tsit5()))
end

if @isdefined(MultipleShooting)
oop_suite["MultipleShooting(100, Tsit5; grid_coarsening = true)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_oop,
$MultipleShooting(100, Tsit5()))
$SimplePendulumBenchmark.prob_oop, $MultipleShooting(100, Tsit5()))
oop_suite["MultipleShooting(100, Tsit5; grid_coarsening = false)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_oop,
$MultipleShooting(100, Tsit5(); grid_coarsening = false))
oop_suite["MultipleShooting(10, Tsit5; grid_coarsening = true)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_oop,
$MultipleShooting(10, Tsit5()))
$SimplePendulumBenchmark.prob_oop, $MultipleShooting(10, Tsit5()))
oop_suite["MultipleShooting(10, Tsit5; grid_coarsening = false)"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_oop,
$MultipleShooting(10, Tsit5(); grid_coarsening = false))
end
if @isdefined(Shooting)
oop_suite["Shooting(Tsit5())"] = @benchmarkable solve(
$SimplePendulumBenchmark.prob_oop,
$Shooting(Tsit5()))
$SimplePendulumBenchmark.prob_oop, $Shooting(Tsit5()))
end

return suite
Expand Down
Loading
Loading