Skip to content

Commit

Permalink
fix: down prioritize Enzyme in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 8, 2024
1 parent 244d7bb commit 3597683
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
46 changes: 32 additions & 14 deletions lib/NonlinearSolveBase/src/autodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,39 @@

# Ordering is important here. We want to select the first one that is compatible with the
# problem.
const ReverseADs = (
ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse),
ADTypes.AutoZygote(),
ADTypes.AutoTracker(),
ADTypes.AutoReverseDiff(; compile = true),
ADTypes.AutoReverseDiff(),
ADTypes.AutoFiniteDiff()
)
@static if !Sys.iswindows()
const ReverseADs = (
ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse),
ADTypes.AutoZygote(),
ADTypes.AutoTracker(),
ADTypes.AutoReverseDiff(; compile = true),
ADTypes.AutoReverseDiff(),
ADTypes.AutoFiniteDiff()
)

const ForwardADs = (
ADTypes.AutoEnzyme(; mode = EnzymeCore.Forward),
ADTypes.AutoPolyesterForwardDiff(),
ADTypes.AutoForwardDiff(),
ADTypes.AutoFiniteDiff()
)
const ForwardADs = (
ADTypes.AutoEnzyme(; mode = EnzymeCore.Forward),
ADTypes.AutoPolyesterForwardDiff(),
ADTypes.AutoForwardDiff(),
ADTypes.AutoFiniteDiff()
)
else
const ReverseADs = (
ADTypes.AutoZygote(),
ADTypes.AutoTracker(),
ADTypes.AutoReverseDiff(; compile = true),
ADTypes.AutoReverseDiff(),
ADTypes.AutoEnzyme(; mode = EnzymeCore.Reverse),
ADTypes.AutoFiniteDiff()
)

const ForwardADs = (
ADTypes.AutoPolyesterForwardDiff(),
ADTypes.AutoForwardDiff(),
ADTypes.AutoEnzyme(; mode = EnzymeCore.Forward),
ADTypes.AutoFiniteDiff()
)
end

# TODO: Handle Sparsity

Expand Down
3 changes: 1 addition & 2 deletions lib/SimpleNonlinearSolve/test/core/qa_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ end
import ReverseDiff, Tracker, StaticArrays, Zygote
using ExplicitImports, SimpleNonlinearSolve

@test check_no_implicit_imports(
SimpleNonlinearSolve; skip = (Base, Core, SciMLBase)) === nothing
@test check_no_implicit_imports(SimpleNonlinearSolve; skip = (Base, Core)) === nothing
@test check_no_stale_explicit_imports(SimpleNonlinearSolve) === nothing
@test check_all_qualified_accesses_via_owners(SimpleNonlinearSolve) === nothing
end

0 comments on commit 3597683

Please sign in to comment.