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

Use DifferentiationInterface for AD in Implicit Solvers #2567

Merged
merged 158 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
e2c017b
import DI
jClugstor Nov 18, 2024
cd3c838
switch calc_t_derivative
jClugstor Nov 18, 2024
a3ccbca
derivative wrappers
jClugstor Nov 18, 2024
5dd9834
change the derivatives in rosenbrock steps
jClugstor Nov 13, 2024
7c174ef
try to fix tags
jClugstor Nov 18, 2024
dceb116
add DI to deps
jClugstor Nov 20, 2024
42aac9f
update compat to DI patch
jClugstor Nov 20, 2024
50048f7
move tag wrangling to prepare_alg
jClugstor Nov 20, 2024
c79a2cd
move the tag
jClugstor Nov 20, 2024
0720731
make sure calc_tderivative sees alg
jClugstor Nov 20, 2024
8268b92
add fallback for scalar x
jClugstor Nov 20, 2024
670284f
get rid of println
jClugstor Nov 20, 2024
4241f14
add prepare_ADType dispatches for FiniteDiff and ForwardDiff
jClugstor Nov 22, 2024
797272f
add Enzyme, SparseConnectivityTracer, SparsematrixColorings
jClugstor Nov 25, 2024
1e0e30d
imports
jClugstor Nov 25, 2024
b79633f
sparse attempts at sparsity
jClugstor Nov 25, 2024
6dc27c0
fix the tagging for ForwardDiff
jClugstor Nov 26, 2024
26d09b9
need ADTypes specifier
jClugstor Nov 27, 2024
c484938
unwrapped_f in preparation
jClugstor Nov 27, 2024
346cea5
fix Rosenbrock time derivative
jClugstor Nov 27, 2024
876e507
another calc_tderivative
jClugstor Nov 27, 2024
9881d91
add needed stuffs
jClugstor Nov 27, 2024
0667740
add Jac operators
jClugstor Jan 14, 2025
fe5b19f
import and use for operators
jClugstor Jan 14, 2025
89481fb
add dispatch for jacobians using StaticArrays
jClugstor Jan 15, 2025
74a333a
add setproperties for DAEResidualJacobianWrapper
jClugstor Jan 15, 2025
6b49a0e
handle static and complex u0
jClugstor Jan 15, 2025
ea13c17
no need for dispatches
jClugstor Jan 15, 2025
98cdb3a
Duals can't use sparsity either
jClugstor Jan 15, 2025
8fd8e16
check if already dense
jClugstor Jan 15, 2025
1fccfaf
check if sparse for operators
jClugstor Jan 15, 2025
390e631
make W sparse if AutoSparse
jClugstor Jan 15, 2025
0e9a7f4
correct inplace checking for operator
jClugstor Jan 15, 2025
7c8e141
fix linres iters counting
jClugstor Jan 15, 2025
83c786d
import SparseMatrixColorings
jClugstor Jan 16, 2025
3cf32fa
use prob.f
jClugstor Jan 16, 2025
d058eb3
if sparsity isa matrix operator, use A
jClugstor Jan 17, 2025
84453ee
massage some tests
jClugstor Jan 17, 2025
ec1e006
stats, setproperties
jClugstor Jan 17, 2025
68dff31
update stats, make jacobian take advantage of prep from cache
jClugstor Jan 24, 2025
e8fa63c
fixing stats tests
jClugstor Jan 30, 2025
b4d6c7d
no prep for nonmutating jacobian
jClugstor Jan 30, 2025
72317bd
cleanup
jClugstor Jan 30, 2025
ffaa4ed
set up resizing
jClugstor Jan 30, 2025
91f300c
use densesparsity for DAEs
jClugstor Feb 3, 2025
293d1e8
fix DAEResidualwrappers for other ADTypes
jClugstor Feb 3, 2025
316ae78
get rid of default automatic sparsity detection
jClugstor Feb 3, 2025
85bccaa
update the jac_prototype if it exists
jClugstor Feb 3, 2025
acfa33b
test check
jClugstor Feb 4, 2025
0f5ff5e
make sure to convert t when calculating tgrad with AutoForwardDiff
jClugstor Feb 4, 2025
96bd3c0
add update_coefficients! function for StatefulJacobian operators, fix…
jClugstor Feb 5, 2025
6eb7088
add the FirstAutodiff errors back
jClugstor Feb 5, 2025
bd7eb9e
no conversion in oop calc_tderivative
jClugstor Feb 5, 2025
2fa2076
scalar "jacobian" should also throw FirstAutodiffJacError if applicable
jClugstor Feb 5, 2025
44c3289
use DI.derivative instead
jClugstor Feb 6, 2025
77feb10
bump compat buounds for ADTypes and DI
jClugstor Feb 10, 2025
76bd0b6
make sure diffdir is used
jClugstor Feb 10, 2025
91c4081
use dense
jClugstor Feb 10, 2025
339923e
remove Enzyme from deps
jClugstor Feb 11, 2025
ab1ed0b
use sparsity pattern for J if is sparse
jClugstor Feb 11, 2025
148742b
test Enzyme forward, and test more paths
jClugstor Feb 11, 2025
230ab1e
use ADTypes in time derivative tests
jClugstor Feb 11, 2025
16c07fd
promote dt in WOperator construction
jClugstor Feb 12, 2025
73aca68
add Enzyme to test deps, add more tests for BDF and Rosenbrock forwar…
jClugstor Feb 12, 2025
6e5d5fa
put Enzyme in right spot
jClugstor Feb 12, 2025
ea89157
actually return sparse autodiff
jClugstor Feb 12, 2025
779c890
correct sparsity pattern for rosenbrock caches autosparse detection
jClugstor Feb 12, 2025
6bfc376
add tests for automatic sparsity detection
jClugstor Feb 12, 2025
547f137
fix the tests
jClugstor Feb 13, 2025
d0cd416
sparsediff test fix
jClugstor Feb 13, 2025
8f8b958
rearrange so that build_J_W can use jac_config for sparsity pattern
jClugstor Feb 13, 2025
aef8d80
add test deps for autosparse detection tests
jClugstor Feb 13, 2025
6d9da63
wrong nowarn
jClugstor Feb 13, 2025
db872ad
fix stiff addsteps
jClugstor Feb 13, 2025
c642425
fix direction in stiff_addsteps
jClugstor Feb 13, 2025
1425836
cleanup
jClugstor Feb 13, 2025
b43d5a5
using Enzyme for convergence tests
jClugstor Feb 13, 2025
26d3b03
test rosenbrocks with unique caches
jClugstor Feb 13, 2025
6d77a2c
fix tests, update error message
jClugstor Feb 13, 2025
b0904d3
add LinearSolve for BDF test
jClugstor Feb 14, 2025
633ae54
account for bool sparsity pattern
jClugstor Feb 14, 2025
1738b87
add LinearSolve to BDF test and extras
jClugstor Feb 17, 2025
71fd0bf
Update lib/OrdinaryDiffEqDifferentiation/Project.toml
jClugstor Feb 18, 2025
33c441f
add warning, clean up
jClugstor Feb 19, 2025
13c036b
create JVPCache operator and use it
jClugstor Feb 19, 2025
d14517b
fix resize tests
jClugstor Feb 19, 2025
e830958
use ncolors instead
jClugstor Feb 19, 2025
c1c0d2e
split up sparsity ADType preparation
jClugstor Feb 19, 2025
dd4ecc9
make JVPCache mutable
jClugstor Feb 20, 2025
c209a03
get rid of redundant definition
jClugstor Feb 20, 2025
9746e6e
use build_J_W with nothing jac_config where appropriate
jClugstor Feb 20, 2025
0692083
make sure FIRK caches use jac_config version of build_J_W
jClugstor Feb 20, 2025
b3a6808
fix alg_utils
jClugstor Feb 20, 2025
ffc2231
clean up
jClugstor Feb 24, 2025
c1c58c4
use two grad/jac configs for the dir finitediff kwarg
jClugstor Feb 27, 2025
282e076
fix tests
jClugstor Feb 27, 2025
80a6562
fix autosparse
jClugstor Feb 27, 2025
120d600
fix the stripping tests
jClugstor Feb 27, 2025
ae9281b
fix resize tests
jClugstor Feb 27, 2025
9c6fafd
fix resize
jClugstor Feb 27, 2025
c886534
fix resize again
jClugstor Feb 27, 2025
8453052
fix resizing for JVPCache
jClugstor Feb 28, 2025
14f4bef
get rid of SparseDiffTools here
jClugstor Feb 28, 2025
93ef9e8
fix addsteps
jClugstor Feb 28, 2025
3236bd9
import DI
jClugstor Mar 3, 2025
a4a13a4
require DI
jClugstor Mar 3, 2025
d262516
fix incorrect dirs for finitediff
jClugstor Mar 4, 2025
b10871f
Delete OrdinaryDiffEqRosenbrock/Project.toml
jClugstor Mar 4, 2025
c828155
make the chunksize stuff work
jClugstor Mar 4, 2025
3703b7f
fix remake so chunksize is only used if not default ADType
jClugstor Mar 4, 2025
17a47fc
fix handling for autosparse
jClugstor Mar 4, 2025
95b4f9e
fix handling for other ADTypes
jClugstor Mar 4, 2025
52affcd
fix resizing even more, correct even more dirs
jClugstor Mar 4, 2025
85899d7
fix remake some more, use type stable constructor for AutoForwardDiff
jClugstor Mar 5, 2025
7441aa4
the algs won't be equal because of the tags, that's fine
jClugstor Mar 5, 2025
bdb9c07
rename to forward and revers
jClugstor Mar 6, 2025
ed0d140
boolean algebra distributivity
jClugstor Mar 6, 2025
ca5851f
erroneous assignment
jClugstor Mar 6, 2025
a998113
simplify resizing
jClugstor Mar 6, 2025
6678565
bump ADTypes
jClugstor Mar 6, 2025
8b310cb
fix resizing for JVPCache, add a test to catch it
jClugstor Mar 6, 2025
590dda7
get rid of commented out code
jClugstor Mar 6, 2025
4af00f4
use new dense_ad identity
jClugstor Mar 6, 2025
7d9af83
no sparse needed here
jClugstor Mar 6, 2025
9c14ee9
allow for OOP
jClugstor Mar 6, 2025
c8b8023
bump DI version
jClugstor Mar 6, 2025
3ac1516
better rounding for chunk_size
jClugstor Mar 6, 2025
320f6f8
bring in LinearSolve for resize tests
jClugstor Mar 6, 2025
9709dc4
fix docstring, T doesn't need to be Real
jClugstor Mar 10, 2025
36e6f2e
fix JVPCache
jClugstor Mar 10, 2025
32e80d5
fix sparsity for build_J_W
jClugstor Mar 10, 2025
c16dcfd
no jac_config because of the linsolve
jClugstor Mar 10, 2025
7dfa338
add ADTypes to time_derivative test
jClugstor Mar 11, 2025
012c9e6
sparse zeromatrix instead of undefmatrix
jClugstor Mar 15, 2025
f374ec0
rm sparseconnectivitytracer
jClugstor Mar 15, 2025
316dd8e
rm SparseConnectivityTracer for real
jClugstor Mar 15, 2025
d4c13b3
another zeromatrix
jClugstor Mar 17, 2025
44ed85e
use spzeros instead of zeromatrix
jClugstor Mar 18, 2025
10981f4
closures instead of DI.Constant
jClugstor Mar 18, 2025
17d656a
use du for pushforward too
jClugstor Mar 18, 2025
d73e1e1
another spzeros
jClugstor Mar 18, 2025
50c1134
add tests for large sparse jacobians
jClugstor Mar 18, 2025
a1cd959
add huge diagonal test
jClugstor Mar 19, 2025
7a496ce
Bump DI version
jClugstor Mar 19, 2025
ec1b9f4
Use ConstantOrCache for parameters in JVPCache
jClugstor Mar 19, 2025
6371246
fix pushforward! tuple
jClugstor Mar 20, 2025
5ce12a0
add getsize
jClugstor Mar 20, 2025
0b224ec
remove SparseDiffTools
jClugstor Mar 20, 2025
cde88ea
rm more SparseDiffTools
jClugstor Mar 20, 2025
bb29f56
bump DI for Enzyme fix
jClugstor Mar 20, 2025
c98c023
use SparseMatrixColorings instead of SparseDiffTools
jClugstor Mar 20, 2025
9f05adf
make sure SparseMatrixColorings import is correct
jClugstor Mar 20, 2025
29c9780
fix huge sparse matrix test in autosparse detection
jClugstor Mar 21, 2025
fe391b6
make sure sparse matrix is constructed with eltype(u)
jClugstor Mar 22, 2025
a337e60
allow Dual numbers with sparsity
jClugstor Mar 24, 2025
00c9c24
Update test/regression/time_derivative_test.jl
ChrisRackauckas Mar 25, 2025
514d731
update JVPCache docstring
jClugstor Mar 25, 2025
57ea0bc
fix time_derivative test
jClugstor Mar 25, 2025
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
9 changes: 5 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ SciMLStructures = "53ae85a6-f571-4167-b2af-e1d143709226"
SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TruncatedStacktraces = "781d530d-4396-4725-bb49-402e4bee1e77"

[compat]
ADTypes = "0.2, 1"
ADTypes = "1.13"
Adapt = "3.0, 4"
ArrayInterface = "7"
DataStructures = "0.18"
Expand Down Expand Up @@ -138,7 +137,6 @@ SciMLOperators = "0.3"
SciMLStructures = "1"
SimpleNonlinearSolve = "1, 2"
SimpleUnPack = "1"
SparseDiffTools = "2"
Static = "0.8, 1"
StaticArrayInterface = "1.2"
StaticArrays = "1.0"
Expand All @@ -153,6 +151,7 @@ ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Expand All @@ -167,11 +166,13 @@ RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["Calculus", "ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "InteractiveUtils", "ParameterizedFunctions", "PoissonRandom", "Printf", "Random", "ReverseDiff", "SafeTestsets", "SparseArrays", "Statistics", "StructArrays", "Test", "Unitful", "ModelingToolkit", "Pkg", "NLsolve", "RecursiveFactorization"]
test = ["Calculus", "ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "InteractiveUtils", "ParameterizedFunctions", "PoissonRandom", "Printf", "Random", "ReverseDiff", "SafeTestsets", "SparseArrays", "Statistics", "StructArrays", "Test", "Unitful", "ModelingToolkit", "Pkg", "NLsolve", "RecursiveFactorization", "Enzyme", "SparseConnectivityTracer", "SparseMatrixColorings"]
4 changes: 3 additions & 1 deletion lib/OrdinaryDiffEqBDF/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ julia = "1.10"

[extras]
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["DiffEqDevTools", "ForwardDiff", "Random", "SafeTestsets", "Test", "ODEProblemLibrary", "StaticArrays"]
test = ["DiffEqDevTools", "ForwardDiff", "Random", "SafeTestsets", "Test", "ODEProblemLibrary", "StaticArrays", "Enzyme", "LinearSolve"]
23 changes: 22 additions & 1 deletion lib/OrdinaryDiffEqBDF/test/bdf_convergence_tests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This definitely needs cleaning
using OrdinaryDiffEqBDF, ODEProblemLibrary, DiffEqDevTools
using OrdinaryDiffEqBDF, ODEProblemLibrary, DiffEqDevTools, ADTypes, Enzyme, LinearSolve
using OrdinaryDiffEqNonlinearSolve: NLFunctional, NLAnderson, NonlinearSolveAlg
using Test, Random
Random.seed!(100)
Expand Down Expand Up @@ -39,6 +39,27 @@ dts3 = 1 .// 2 .^ (12:-1:7)
@test sim.𝒪est[:l2]≈1 atol=testTol
@test sim.𝒪est[:l∞]≈1 atol=testTol

sim = test_convergence(dts, prob, QNDF1(autodiff = AutoFiniteDiff()))
@test sim.𝒪est[:final]≈1 atol=testTol
@test sim.𝒪est[:l2]≈1 atol=testTol
@test sim.𝒪est[:l∞]≈1 atol=testTol

sim = test_convergence(dts,
prob,
QNDF1(autodiff = AutoEnzyme(mode = set_runtime_activity(Enzyme.Forward),
function_annotation = Enzyme.Const)))
@test sim.𝒪est[:final]≈1 atol=testTol
@test sim.𝒪est[:l2]≈1 atol=testTol
@test sim.𝒪est[:l∞]≈1 atol=testTol

sim = test_convergence(dts,
prob,
QNDF1(autodiff = AutoEnzyme(mode = set_runtime_activity(Enzyme.Forward),
function_annotation = Enzyme.Const), linsolve = LinearSolve.KrylovJL()))
@test sim.𝒪est[:final]≈1 atol=testTol
@test sim.𝒪est[:l2]≈1 atol=testTol
@test sim.𝒪est[:l∞]≈1 atol=testTol

sim = test_convergence(dts3, prob, QNDF2())
@test sim.𝒪est[:final]≈2 atol=testTol
@test sim.𝒪est[:l2]≈2 atol=testTol
Expand Down
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqCore/src/OrdinaryDiffEqCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import DiffEqBase: calculate_residuals,

import Polyester
using MacroTools, Adapt
import ADTypes: AutoFiniteDiff, AutoForwardDiff, AbstractADType
import ADTypes: AutoFiniteDiff, AutoForwardDiff, AbstractADType, AutoSparse
import Accessors: @reset

using SciMLStructures: canonicalize, Tunable, isscimlstructure
Expand Down
1 change: 1 addition & 0 deletions lib/OrdinaryDiffEqCore/src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ _get_fwd_chunksize(::Type{<:AutoForwardDiff{CS}}) where {CS} = Val(CS)
_get_fwd_chunksize_int(::Type{<:AutoForwardDiff{CS}}) where {CS} = CS
_get_fwd_chunksize(AD) = Val(0)
_get_fwd_chunksize_int(AD) = 0
_get_fwd_chunksize_int(::AutoForwardDiff{CS}) where {CS} = CS
_get_fwd_tag(::AutoForwardDiff{CS, T}) where {CS, T} = T

_get_fdtype(::AutoFiniteDiff{T1}) where {T1} = T1
Expand Down
9 changes: 8 additions & 1 deletion lib/OrdinaryDiffEqCore/src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ function DiffEqBase.remake(
},
DAEAlgorithm{CS, AD, FDT, ST, CJ}};
kwargs...) where {CS, AD, FDT, ST, CJ}

if haskey(kwargs, :autodiff) && kwargs[:autodiff] isa AutoForwardDiff
chunk_size = _get_fwd_chunksize(kwargs[:autodiff])
else
chunk_size = Val{CS}()
end

T = SciMLBase.remaker_of(thing)
T(; SciMLBase.struct_as_namedtuple(thing)...,
chunk_size = Val{CS}(), autodiff = thing.autodiff, standardtag = Val{ST}(),
chunk_size = chunk_size, autodiff = thing.autodiff, standardtag = Val{ST}(),
concrete_jac = CJ === nothing ? CJ : Val{CJ}(),
kwargs...)
end
Expand Down
12 changes: 11 additions & 1 deletion lib/OrdinaryDiffEqCore/src/misc_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ end
function _process_AD_choice(
ad_alg::AutoForwardDiff{CS}, ::Val{CS2}, ::Val{FD}) where {CS, CS2, FD}
# Non-default `chunk_size`
if CS2 != 0
if (CS2 != 0) && (isnothing(CS) || (CS2 !== CS))
@warn "The `chunk_size` keyword is deprecated. Please use an `ADType` specifier. For now defaulting to using `AutoForwardDiff` with `chunksize=$(CS2)`."
return _bool_to_ADType(Val{true}(), Val{CS2}(), Val{FD}()), Val{CS2}(), Val{FD}()
end

_CS = CS === nothing ? 0 : CS
return ad_alg, Val{_CS}(), Val{FD}()
end
Expand All @@ -186,3 +187,12 @@ function _process_AD_choice(
end
return ad_alg, Val{CS}(), ad_alg.fdtype
end

function _process_AD_choice(ad_alg::AutoSparse, cs2::Val{CS2}, fd::Val{FD}) where {CS2, FD}
_, cs, fd = _process_AD_choice(ad_alg.dense_ad, cs2, fd)
ad_alg, cs, fd
end

function _process_AD_choice(ad_alg, cs2, fd)
ad_alg, cs2, fd
end
10 changes: 7 additions & 3 deletions lib/OrdinaryDiffEqDifferentiation/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ version = "1.4.0"
[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Expand All @@ -15,16 +18,18 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
ADTypes = "1.11"
ADTypes = "1.14"
ArrayInterface = "7"
DiffEqBase = "6"
DiffEqDevTools = "2.44.4"
DifferentiationInterface = "0.6.48"
FastBroadcast = "0.3"
FiniteDiff = "2"
ForwardDiff = "0.10"
Expand All @@ -36,7 +41,6 @@ Random = "<0.0.1, 1"
SafeTestsets = "0.1.0"
SciMLBase = "2"
SparseArrays = "1"
SparseDiffTools = "2"
StaticArrayInterface = "1"
StaticArrays = "1"
Test = "<0.0.1, 1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module OrdinaryDiffEqDifferentiation

import ADTypes: AutoFiniteDiff, AutoForwardDiff, AbstractADType

import SparseDiffTools: SparseDiffTools, matrix_colors, forwarddiff_color_jacobian!,
forwarddiff_color_jacobian, ForwardColorJacCache,
default_chunk_size, getsize, JacVec
import ADTypes
import ADTypes: AutoFiniteDiff, AutoForwardDiff, AbstractADType, AutoSparse

import ForwardDiff, FiniteDiff
import ForwardDiff.Dual
Expand All @@ -16,7 +13,7 @@ using DiffEqBase
import LinearAlgebra
import LinearAlgebra: Diagonal, I, UniformScaling, diagind, mul!, lmul!, axpby!, opnorm, lu
import LinearAlgebra: LowerTriangular, UpperTriangular
import SparseArrays: SparseMatrixCSC, AbstractSparseMatrix, nonzeros
import SparseArrays: SparseMatrixCSC, AbstractSparseMatrix, nonzeros, sparse
import ArrayInterface

import StaticArrayInterface
Expand All @@ -27,7 +24,9 @@ import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, S
using DiffEqBase: TimeGradientWrapper,
UJacobianWrapper, TimeDerivativeWrapper,
UDerivativeWrapper
using SciMLBase: AbstractSciMLOperator, constructorof
using SciMLBase: AbstractSciMLOperator, constructorof, @set
using SciMLOperators
import SparseMatrixColorings
import OrdinaryDiffEqCore
using OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm, OrdinaryDiffEqAdaptiveImplicitAlgorithm,
DAEAlgorithm,
Expand All @@ -44,11 +43,16 @@ using OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm, OrdinaryDiffEqAdaptiveImplici
FastConvergence, Convergence, SlowConvergence,
VerySlowConvergence, Divergence, NLStatus, MethodType, constvalue

import OrdinaryDiffEqCore: get_chunksize, resize_J_W!, resize_nlsolver!, alg_autodiff,
_get_fwd_tag
import OrdinaryDiffEqCore: get_chunksize, resize_J_W!, resize_nlsolver!, alg_autodiff, _get_fwd_tag

using ConstructionBase

import DifferentiationInterface as DI

using FastBroadcast: @..

using ConcreteStructs: @concrete

@static if isdefined(DiffEqBase, :OrdinaryDiffEqTag)
import DiffEqBase: OrdinaryDiffEqTag
else
Expand All @@ -59,5 +63,6 @@ include("alg_utils.jl")
include("linsolve_utils.jl")
include("derivative_utils.jl")
include("derivative_wrappers.jl")
include("operators.jl")

end
Loading
Loading