Skip to content

Commit

Permalink
refactor: remove Zygote extension
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 3, 2024
1 parent fa575c6 commit 2ad7a1d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ NLSolvers = "337daf1e-9722-11e9-073e-8b9effe078ba"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4"
SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[extensions]
NonlinearSolveBandedMatricesExt = "BandedMatrices"
Expand All @@ -57,7 +56,6 @@ NonlinearSolveNLSolversExt = "NLSolvers"
NonlinearSolveNLsolveExt = "NLsolve"
NonlinearSolveSIAMFANLEquationsExt = "SIAMFANLEquations"
NonlinearSolveSpeedMappingExt = "SpeedMapping"
NonlinearSolveZygoteExt = "Zygote"

[compat]
ADTypes = "1.9"
Expand Down
7 changes: 0 additions & 7 deletions ext/NonlinearSolveZygoteExt.jl

This file was deleted.

3 changes: 0 additions & 3 deletions src/NonlinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ using SparseMatrixColorings: ConstantColoringAlgorithm, GreedyColoringAlgorithm,

const DI = DifferentiationInterface

# Type-Inference Friendly Check for Extension Loading
is_extension_loaded(::Val) = false

const True = Val(true)
const False = Val(false)

Expand Down
2 changes: 1 addition & 1 deletion src/internal/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function get_concrete_reverse_ad(
else
use_sparse_ad = false
end
ad = if isinplace(prob) || !is_extension_loaded(Val(:Zygote)) # Use Finite Differencing
ad = if isinplace(prob) || !DI.check_available(AutoZygote()) # Use Finite Differencing
use_sparse_ad ? AutoSparse(AutoFiniteDiff()) : AutoFiniteDiff()
else
use_sparse_ad ? AutoSparse(AutoZygote()) : AutoZygote()
Expand Down
3 changes: 1 addition & 2 deletions test/misc/qa_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ end
@testitem "Explicit Imports" tags=[:misc] begin
using NonlinearSolve, ADTypes, SimpleNonlinearSolve, SciMLBase
import BandedMatrices, FastLevenbergMarquardt, FixedPointAcceleration,
LeastSquaresOptim, MINPACK, NLsolve, NLSolvers, SIAMFANLEquations, SpeedMapping,
Zygote
LeastSquaresOptim, MINPACK, NLsolve, NLSolvers, SIAMFANLEquations, SpeedMapping

using ExplicitImports

Expand Down

0 comments on commit 2ad7a1d

Please sign in to comment.