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

Chunk size 1 when eltype is already dual #1544

Merged
merged 4 commits into from
Dec 13, 2021
Merged

Chunk size 1 when eltype is already dual #1544

merged 4 commits into from
Dec 13, 2021

Conversation

chriselrod
Copy link
Contributor

@chriselrod chriselrod commented Dec 11, 2021

Would probably be worth actually running a variety of benchmarks here and picking between strategies.

For now, I'm setting the chunk size to 1 if sizeof(eltype(u0)) > 24, which would (for example) mean the element type are duals of Float64 with 3 or more partials.

Pumas hasn't been eager to merge any of the chunk size PRs as they cause a few regressions when applied globally.
But we can apply it more selectively here when choosing the chunk size as a function of the eltype.

src/alg_utils.jl Outdated
@@ -181,12 +182,6 @@ function DiffEqBase.prepare_alg(alg::Union{OrdinaryDiffEqAdaptiveImplicitAlgorit
end
end
end
function DiffEqBase.prepare_alg(alg::Union{OrdinaryDiffEqAdaptiveImplicitAlgorithm{0,AD,FDT},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to change the approach to not set chunk size 1 for small enough duals.

@ChrisRackauckas
Copy link
Member

Need to exclude or fix the extrapolation methods.

@chriselrod
Copy link
Contributor Author

Need to exclude or fix the extrapolation methods.

Done.

@ChrisRackauckas
Copy link
Member

@chriselrod
Copy link
Contributor Author

chriselrod commented Dec 13, 2021

Only remaining failure

Non-diagonal SDE Tests |    2      2
└ @ SciMLBase ~/.julia/packages/SciMLBase/OpCVa/src/integrator_interface.jl:345
 61.386006 seconds (108.90 M allocations: 6.584 GiB, 3.04% gc time, 97.67% compilation time)
┌ Warning: Instability detected. Aborting
└ @ SciMLBase ~/.julia/packages/SciMLBase/OpCVa/src/integrator_interface.jl:351
No Index Tests: Test Failed at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:806
  Expression: isempty(stderr_content)
   Evaluated: isempty("┌ Warning: Instability detected. Aborting\n└ @ SciMLBase ~/.julia/packages/SciMLBase/OpCVa/src/integrator_interface.jl:351\n")
Stacktrace:
 [1] macro expansion
   @ /opt/hostedtoolcache/julia/1.7.0/x64/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] top-level scope
   @ ~/work/OrdinaryDiffEq.jl/OrdinaryDiffEq.jl/downstream/test/noindex_tests.jl:48
Test Summary:  | Pass  Fail  Total
No Index Tests |    5     1      6

@ChrisRackauckas
Copy link
Member

Ignore that. It's part of SciML/StochasticDiffEq.jl#445

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.

None yet

3 participants