Skip to content

Commit f0f3167

Browse files
authored
Merge branch 'master' into qqy/dual_nlprob
2 parents dececf8 + 2284348 commit f0f3167

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

lib/NonlinearSolveBase/Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NonlinearSolveBase"
22
uuid = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
33
authors = ["Avik Pal <[email protected]> and contributors"]
4-
version = "1.3.3"
4+
version = "1.4.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -13,7 +13,6 @@ ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
1313
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
1414
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
1515
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
16-
FunctionProperties = "f62d2435-5019-4c03-9749-2d4c77af0cbc"
1716
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1817
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
1918
MaybeInplace = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb"
@@ -60,7 +59,6 @@ EnzymeCore = "0.8"
6059
ExplicitImports = "1.10.1"
6160
FastClosures = "0.3"
6261
ForwardDiff = "0.10.36"
63-
FunctionProperties = "0.1.2"
6462
InteractiveUtils = "<0.0.1, 1"
6563
LineSearch = "0.1.4"
6664
LinearAlgebra = "1.10"

lib/NonlinearSolveBase/src/NonlinearSolveBase.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ using StaticArraysCore: StaticArray, SMatrix, SArray, MArray
1414

1515
using CommonSolve: CommonSolve, init
1616
using EnzymeCore: EnzymeCore
17-
using FunctionProperties: hasbranching
1817
using MaybeInplace: @bb
1918
using RecursiveArrayTools: AbstractVectorOfArray, ArrayPartition
2019
using SciMLBase: SciMLBase, ReturnCode, AbstractODEIntegrator, AbstractNonlinearProblem,

lib/NonlinearSolveBase/src/autodiff.jl

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,13 @@
33

44
# Ordering is important here. We want to select the first one that is compatible with the
55
# problem.
6-
# XXX: Remove this once Enzyme is properly supported on Julia 1.11+
7-
@static if VERSION v"1.11-"
8-
const ReverseADs = (
9-
ADTypes.AutoZygote(),
10-
ADTypes.AutoTracker(),
11-
ADTypes.AutoReverseDiff(; compile = true),
12-
ADTypes.AutoReverseDiff(),
13-
ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse),
14-
ADTypes.AutoFiniteDiff()
15-
)
16-
else
17-
const ReverseADs = (
18-
ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse),
19-
ADTypes.AutoZygote(),
20-
ADTypes.AutoTracker(),
21-
ADTypes.AutoReverseDiff(; compile = true),
22-
ADTypes.AutoReverseDiff(),
23-
ADTypes.AutoFiniteDiff()
24-
)
25-
end
6+
const ReverseADs = (
7+
ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse),
8+
ADTypes.AutoZygote(),
9+
ADTypes.AutoTracker(),
10+
ADTypes.AutoReverseDiff(),
11+
ADTypes.AutoFiniteDiff()
12+
)
2613

2714
const ForwardADs = (
2815
ADTypes.AutoPolyesterForwardDiff(),
@@ -116,14 +103,6 @@ function incompatible_backend_and_problem(
116103
end
117104

118105
additional_incompatible_backend_check(::AbstractNonlinearProblem, ::AbstractADType) = false
119-
function additional_incompatible_backend_check(prob::AbstractNonlinearProblem,
120-
::ADTypes.AutoReverseDiff{true})
121-
if SciMLBase.isinplace(prob)
122-
fu = prob.f.resid_prototype === nothing ? zero(prob.u0) : prob.f.resid_prototype
123-
return hasbranching(prob.f, fu, prob.u0, prob.p)
124-
end
125-
return hasbranching(prob.f, prob.u0, prob.p)
126-
end
127106
function additional_incompatible_backend_check(
128107
prob::AbstractNonlinearProblem, ::ADTypes.AutoPolyesterForwardDiff)
129108
prob.u0 isa SArray && return true # promotes to a mutable array

0 commit comments

Comments
 (0)