diff --git a/lib/NonlinearSolveBase/Project.toml b/lib/NonlinearSolveBase/Project.toml index 4cc10a6be..2f5404dc7 100644 --- a/lib/NonlinearSolveBase/Project.toml +++ b/lib/NonlinearSolveBase/Project.toml @@ -1,7 +1,7 @@ name = "NonlinearSolveBase" uuid = "be0214bd-f91f-a760-ac4e-3421ce2b2da0" authors = ["Avik Pal and contributors"] -version = "1.3.3" +version = "1.4.0" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" @@ -13,7 +13,6 @@ ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471" DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a" -FunctionProperties = "f62d2435-5019-4c03-9749-2d4c77af0cbc" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" MaybeInplace = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb" @@ -60,7 +59,6 @@ EnzymeCore = "0.8" ExplicitImports = "1.10.1" FastClosures = "0.3" ForwardDiff = "0.10.36" -FunctionProperties = "0.1.2" InteractiveUtils = "<0.0.1, 1" LineSearch = "0.1.4" LinearAlgebra = "1.10" diff --git a/lib/NonlinearSolveBase/src/NonlinearSolveBase.jl b/lib/NonlinearSolveBase/src/NonlinearSolveBase.jl index df65e1fed..f45ba9242 100644 --- a/lib/NonlinearSolveBase/src/NonlinearSolveBase.jl +++ b/lib/NonlinearSolveBase/src/NonlinearSolveBase.jl @@ -14,7 +14,6 @@ using StaticArraysCore: StaticArray, SMatrix, SArray, MArray using CommonSolve: CommonSolve, init using EnzymeCore: EnzymeCore -using FunctionProperties: hasbranching using MaybeInplace: @bb using RecursiveArrayTools: AbstractVectorOfArray, ArrayPartition using SciMLBase: SciMLBase, ReturnCode, AbstractODEIntegrator, AbstractNonlinearProblem, diff --git a/lib/NonlinearSolveBase/src/autodiff.jl b/lib/NonlinearSolveBase/src/autodiff.jl index c92a3e27d..5f9843e9a 100644 --- a/lib/NonlinearSolveBase/src/autodiff.jl +++ b/lib/NonlinearSolveBase/src/autodiff.jl @@ -3,26 +3,13 @@ # Ordering is important here. We want to select the first one that is compatible with the # problem. -# XXX: Remove this once Enzyme is properly supported on Julia 1.11+ -@static if VERSION ≥ v"1.11-" - const ReverseADs = ( - ADTypes.AutoZygote(), - ADTypes.AutoTracker(), - ADTypes.AutoReverseDiff(; compile = true), - ADTypes.AutoReverseDiff(), - ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), - ADTypes.AutoFiniteDiff() - ) -else - const ReverseADs = ( - ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), - ADTypes.AutoZygote(), - ADTypes.AutoTracker(), - ADTypes.AutoReverseDiff(; compile = true), - ADTypes.AutoReverseDiff(), - ADTypes.AutoFiniteDiff() - ) -end +const ReverseADs = ( + ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse), + ADTypes.AutoZygote(), + ADTypes.AutoTracker(), + ADTypes.AutoReverseDiff(), + ADTypes.AutoFiniteDiff() +) const ForwardADs = ( ADTypes.AutoPolyesterForwardDiff(), @@ -116,14 +103,6 @@ function incompatible_backend_and_problem( end additional_incompatible_backend_check(::AbstractNonlinearProblem, ::AbstractADType) = false -function additional_incompatible_backend_check(prob::AbstractNonlinearProblem, - ::ADTypes.AutoReverseDiff{true}) - if SciMLBase.isinplace(prob) - fu = prob.f.resid_prototype === nothing ? zero(prob.u0) : prob.f.resid_prototype - return hasbranching(prob.f, fu, prob.u0, prob.p) - end - return hasbranching(prob.f, prob.u0, prob.p) -end function additional_incompatible_backend_check( prob::AbstractNonlinearProblem, ::ADTypes.AutoPolyesterForwardDiff) prob.u0 isa SArray && return true # promotes to a mutable array