Skip to content

Commit 9490b6d

Browse files
committed
docs: remove Symbolics and SparseDiffTools
1 parent 6713e59 commit 9490b6d

File tree

5 files changed

+35
-64
lines changed

5 files changed

+35
-64
lines changed

docs/Project.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
23
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
34
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
45
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
@@ -18,13 +19,12 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1819
SciMLJacobianOperators = "19f34311-ddf3-4b8b-af20-060888a46c0e"
1920
SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7"
2021
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
21-
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
2222
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2323
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
2424
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
25-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2625

2726
[compat]
27+
ADTypes = "1.9.0"
2828
AlgebraicMultigrid = "0.5, 0.6"
2929
ArrayInterface = "6, 7"
3030
BenchmarkTools = "1"
@@ -44,8 +44,6 @@ SciMLBase = "2.4"
4444
SciMLJacobianOperators = "0.1"
4545
SimpleNonlinearSolve = "1"
4646
SparseConnectivityTracer = "0.6.5"
47-
SparseDiffTools = "2.14"
4847
StaticArrays = "1"
4948
SteadyStateDiffEq = "2"
5049
Sundials = "4.11"
51-
Symbolics = "4, 5, 6"

docs/make.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ include("pages.jl")
1212

1313
bib = CitationBibliography(joinpath(@__DIR__, "src", "refs.bib"))
1414

15+
interlinks = InterLinks(
16+
"ADTypes" => "https://sciml.github.io/ADTypes.jl/stable/",
17+
)
18+
1519
makedocs(; sitename = "NonlinearSolve.jl",
1620
authors = "Chris Rackauckas",
1721
modules = [NonlinearSolve, SimpleNonlinearSolve, SteadyStateDiffEq,
@@ -23,7 +27,7 @@ makedocs(; sitename = "NonlinearSolve.jl",
2327
"https://link.springer.com/article/10.1007/s40096-020-00339-4"],
2428
checkdocs = :exports,
2529
warnonly = [:missing_docs],
26-
plugins = [bib],
30+
plugins = [bib, interlinks],
2731
format = Documenter.HTML(assets = ["assets/favicon.ico", "assets/citations.css"],
2832
canonical = "https://docs.sciml.ai/NonlinearSolve/stable/"),
2933
pages)

docs/src/basics/autodiff.md

Lines changed: 19 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,32 @@
11
# Automatic Differentiation Backends
22

3+
!!! note
4+
5+
We support all backends supported by DifferentiationInterface.jl. Please refer to
6+
the [backends page](https://gdalle.github.io/DifferentiationInterface.jl/DifferentiationInterface/stable/explanation/backends/)
7+
for more information.
8+
39
## Summary of Finite Differencing Backends
410

5-
- [`AutoFiniteDiff`](@ref): Finite differencing, not optimal but always applicable.
11+
- [`AutoFiniteDiff`](@extref ADTypes): Finite differencing using `FiniteDiff.jl`, not
12+
optimal but always applicable.
13+
- [`AutoFiniteDifferences`](@extref ADTypes): Finite differencing using
14+
`FiniteDifferences.jl`, not optimal but always applicable.
615

716
## Summary of Forward Mode AD Backends
817

9-
- [`AutoForwardDiff`](@ref): The best choice for dense problems.
10-
- [`AutoPolyesterForwardDiff`](@ref): Might be faster than [`AutoForwardDiff`](@ref) for
11-
large problems. Requires `PolyesterForwardDiff.jl` to be installed and loaded.
18+
- [`AutoForwardDiff`](@extref ADTypes): The best choice for dense problems.
19+
- [`AutoPolyesterForwardDiff`](@extref ADTypes): Might be faster than
20+
[`AutoForwardDiff`](@extref ADTypes) for large problems. Requires
21+
`PolyesterForwardDiff.jl` to be installed and loaded.
1222

1323
## Summary of Reverse Mode AD Backends
1424

1525
- [`AutoZygote`](@ref): The fastest choice for non-mutating array-based (BLAS) functions.
16-
- [`AutoEnzyme`](@ref): Uses `Enzyme.jl` Reverse Mode and should be considered
17-
experimental.
26+
- [`AutoEnzyme`](@ref): Uses `Enzyme.jl` Reverse Mode and works for both in-place and
27+
out-of-place functions.
1828

19-
!!! note
20-
21-
If `PolyesterForwardDiff.jl` is installed and loaded, then `SimpleNonlinearSolve.jl`
22-
will automatically use `AutoPolyesterForwardDiff` as the default AD backend.
29+
!!! tip
2330

24-
!!! note
25-
26-
The sparse versions of the methods refer to automated sparsity detection. These
27-
methods automatically discover the sparse Jacobian form from the function `f`. Note that
28-
all methods specialize the differentiation on a sparse Jacobian if the sparse Jacobian
29-
is given as `prob.f.jac_prototype` in the `NonlinearFunction` definition, and the
30-
`AutoSparse` here simply refers to whether this `jac_prototype` should be generated
31-
automatically. For more details, see
32-
[SparseDiffTools.jl](https://github.com/JuliaDiff/SparseDiffTools.jl) and
33-
[Sparsity Detection Manual Entry](@ref sparsity-detection), as well as the
34-
documentation of [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
35-
36-
## API Reference
37-
38-
```@docs
39-
AutoSparse
40-
```
41-
42-
### Finite Differencing Backends
43-
44-
```@docs
45-
AutoFiniteDiff
46-
```
47-
48-
### Forward Mode AD Backends
49-
50-
```@docs
51-
AutoForwardDiff
52-
AutoPolyesterForwardDiff
53-
```
54-
55-
### Reverse Mode AD Backends
56-
57-
```@docs
58-
AutoZygote
59-
AutoEnzyme
60-
```
31+
For sparsity detection and sparse AD take a look at
32+
[sparsity detection](@ref sparsity-detection).

docs/src/tutorials/large_systems.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,23 @@ is non-zeros, otherwise the overhead of sparse matrices can be higher than the g
161161
sparse differentiation!
162162

163163
One of the useful companion tools for NonlinearSolve.jl is
164-
[Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl). This allows for automatic
164+
[ADTypes.jl](https://github.com/SciML/ADTypes.jl) that specifies the interface for sparsity
165+
detection via [`jacobian_sparsity`](@extref ADTypes). This allows for automatic
165166
declaration of Jacobian sparsity types. To see this in action, we can give an example `du`
166167
and `u` and call `jacobian_sparsity` on our function with the example arguments, and it will
167168
kick out a sparse matrix with our pattern, that we can turn into our `jac_prototype`.
168169

169170
!!! tip
170171

171-
Alternatively you can use the `SparseConnectivityTracer.jl` package to automatically
172-
generate a sparse Jacobian.
172+
External packages like `SparseConnectivityTracer.jl` and `Symbolics.jl` provide the
173+
actual implementation of sparsity detection.
173174

174175
```@example ill_conditioned_nlprob
175-
using Symbolics
176+
using SparseConnectivityTracer, ADTypes
176177
177-
du0 = copy(u0)
178-
jac_sparsity = Symbolics.jacobian_sparsity(
179-
(du, u) -> brusselator_2d_loop(du, u, p), du0, u0)
178+
f! = (du, u) -> brusselator_2d_loop(du, u, p)
179+
du0 = similar(u0)
180+
jac_sparsity = ADTypes.jacobian_sparsity(f!, du0, u0, TracerSparsityDetector())
180181
```
181182

182183
Notice that Julia gives a nice print out of the sparsity pattern. That's neat, and would be
@@ -322,9 +323,6 @@ sparsity detection. Let's compare the two by setting the sparsity detection algo
322323
```@example ill_conditioned_nlprob
323324
using DifferentiationInterface, SparseConnectivityTracer
324325
325-
prob_brusselator_2d_exact_symbolics = NonlinearProblem(
326-
NonlinearFunction(brusselator_2d_loop; sparsity = SymbolicsSparsityDetector()),
327-
u0, p; abstol = 1e-10, reltol = 1e-10)
328326
prob_brusselator_2d_exact_tracer = NonlinearProblem(
329327
NonlinearFunction(brusselator_2d_loop; sparsity = TracerSparsityDetector()),
330328
u0, p; abstol = 1e-10, reltol = 1e-10)
@@ -333,7 +331,6 @@ prob_brusselator_2d_approx_di = NonlinearProblem(
333331
sparsity = DenseSparsityDetector(AutoForwardDiff(); atol = 1e-4)),
334332
u0, p; abstol = 1e-10, reltol = 1e-10)
335333
336-
@btime solve(prob_brusselator_2d_exact_symbolics, NewtonRaphson());
337334
@btime solve(prob_brusselator_2d_exact_tracer, NewtonRaphson());
338335
@btime solve(prob_brusselator_2d_approx_di, NewtonRaphson());
339336
nothing # hide

test/misc/qa_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end
1818
using NonlinearSolve, ADTypes, SimpleNonlinearSolve, SciMLBase
1919
import BandedMatrices, FastLevenbergMarquardt, FixedPointAcceleration,
2020
LeastSquaresOptim, MINPACK, NLsolve, NLSolvers, SIAMFANLEquations, SpeedMapping,
21-
Symbolics, Zygote
21+
Zygote
2222

2323
using ExplicitImports
2424

0 commit comments

Comments
 (0)