File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
3737ChainRules = " 082447d4-558c-5d27-93f4-14fc19e9eca2"
3838ChainRulesCore = " d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
3939Distributions = " 31c24e10-a181-5473-b8eb-7969acd0382f"
40+ EnzymeRules = " b2b7a20a-8ddc-4497-9a0a-d49b80ff0020"
4041ForwardDiff = " f6369f11-7733-5829-9624-2563aa707210"
4142MLStyle = " d8e11817-5142-5d16-987a-aa16d5891078"
4243Makie = " ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
@@ -54,6 +55,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
5455[extensions ]
5556SciMLBaseChainRulesCoreExt = " ChainRulesCore"
5657SciMLBaseDistributionsExt = " Distributions"
58+ SciMLBaseEnzymeExt = " EnzymeRules"
5759SciMLBaseForwardDiffExt = " ForwardDiff"
5860SciMLBaseMLStyleExt = " MLStyle"
5961SciMLBaseMakieExt = " Makie"
@@ -80,6 +82,7 @@ ConstructionBase = "1.5"
8082Distributed = " 1.10"
8183Distributions = " 0.25"
8284DocStringExtensions = " 0.9"
85+ EnzymeRules = " 0.1"
8386EnumX = " 1"
8487ForwardDiff = " 0.10.36, 1"
8588FunctionWrappersWrappers = " 0.1.3"
Original file line number Diff line number Diff line change 1+ module SciMLBaseEnzymeExt
2+
3+ using SciMLBase
4+ import EnzymeRules
5+
6+ # Enzyme rules for SciMLBase abstract types
7+ #
8+ # Sensitivity algorithms define HOW to compute derivatives, not WHAT to differentiate.
9+ # They should be treated as inactive (constant) during Enzyme differentiation to prevent
10+ # errors when they are stored in problem structures that Enzyme differentiates through.
11+ #
12+ # This fixes issues like SciMLSensitivity.jl#1225 where passing `sensealg` to ODEProblem
13+ # constructor would fail with Enzyme.
14+
15+ # All sensitivity algorithm types should be inactive for Enzyme differentiation
16+ EnzymeRules. inactive_type (:: Type{<:AbstractSensitivityAlgorithm} ) = true
17+
18+ end
You can’t perform that action at this time.
0 commit comments