-
-
Notifications
You must be signed in to change notification settings - Fork 46
feat: use DifferentiationInterface for sparse AD #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5f76313
refactor: reorder imports
avik-pal 78e19a9
refactor: remove Symbolics
avik-pal fc7fcdb
feat: use DI for sparse jacobians
avik-pal 607f5c4
chore: apply suggestions from code review
avik-pal 35bea3e
chore: apply suggestions from code review
avik-pal fb8b1ee
test: structured jacobians
avik-pal 294ec09
feat: using DI for structured Jacobians
avik-pal 7836f04
docs: add a table to guarantee selections
avik-pal 89b679c
chore: apply suggestions from code review
avik-pal 76fe551
fix: remove stale load
avik-pal acf377f
chore: apply formatting suggestion
avik-pal 1356cfe
docs: remove Symbolics and SparseDiffTools
avik-pal 8449406
docs: remove unnecessary ADTypes docs
avik-pal fa575c6
test: remove sparsedifftools and symbolics from tests
avik-pal d6b5536
refactor: remove Zygote extension
avik-pal c562fa1
docs: add documenter interlinks as a dep
avik-pal 6dcb0da
docs: fix external references
avik-pal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,34 @@ | ||
# Automatic Differentiation Backends | ||
|
||
!!! note | ||
|
||
We support all backends supported by DifferentiationInterface.jl. Please refer to | ||
the [backends page](https://gdalle.github.io/DifferentiationInterface.jl/DifferentiationInterface/stable/explanation/backends/) | ||
for more information. | ||
|
||
## Summary of Finite Differencing Backends | ||
|
||
- [`AutoFiniteDiff`](@ref): Finite differencing, not optimal but always applicable. | ||
- [`AutoFiniteDiff`](@extref ADTypes.AutoFiniteDiff): Finite differencing using | ||
`FiniteDiff.jl`, not optimal but always applicable. | ||
- [`AutoFiniteDifferences`](@extref ADTypes.AutoFiniteDifferences): Finite differencing | ||
using `FiniteDifferences.jl`, not optimal but always applicable. | ||
|
||
## Summary of Forward Mode AD Backends | ||
|
||
- [`AutoForwardDiff`](@ref): The best choice for dense problems. | ||
- [`AutoPolyesterForwardDiff`](@ref): Might be faster than [`AutoForwardDiff`](@ref) for | ||
large problems. Requires `PolyesterForwardDiff.jl` to be installed and loaded. | ||
- [`AutoForwardDiff`](@extref ADTypes.AutoForwardDiff): The best choice for dense | ||
problems. | ||
- [`AutoPolyesterForwardDiff`](@extref ADTypes.AutoPolyesterForwardDiff): Might be faster | ||
than [`AutoForwardDiff`](@extref ADTypes.AutoForwardDiff) for large problems. Requires | ||
`PolyesterForwardDiff.jl` to be installed and loaded. | ||
|
||
## Summary of Reverse Mode AD Backends | ||
|
||
- [`AutoZygote`](@ref): The fastest choice for non-mutating array-based (BLAS) functions. | ||
- [`AutoEnzyme`](@ref): Uses `Enzyme.jl` Reverse Mode and should be considered | ||
experimental. | ||
|
||
!!! note | ||
|
||
If `PolyesterForwardDiff.jl` is installed and loaded, then `SimpleNonlinearSolve.jl` | ||
will automatically use `AutoPolyesterForwardDiff` as the default AD backend. | ||
- [`AutoZygote`](@extref ADTypes.AutoZygote): The fastest choice for non-mutating | ||
array-based (BLAS) functions. | ||
- [`AutoEnzyme`](@extref ADTypes.AutoEnzyme): Uses `Enzyme.jl` Reverse Mode and works for | ||
both in-place and out-of-place functions. | ||
|
||
!!! note | ||
!!! tip | ||
|
||
The sparse versions of the methods refer to automated sparsity detection. These | ||
methods automatically discover the sparse Jacobian form from the function `f`. Note that | ||
all methods specialize the differentiation on a sparse Jacobian if the sparse Jacobian | ||
is given as `prob.f.jac_prototype` in the `NonlinearFunction` definition, and the | ||
`AutoSparse` here simply refers to whether this `jac_prototype` should be generated | ||
automatically. For more details, see | ||
[SparseDiffTools.jl](https://github.com/JuliaDiff/SparseDiffTools.jl) and | ||
[Sparsity Detection Manual Entry](@ref sparsity-detection), as well as the | ||
documentation of [ADTypes.jl](https://github.com/SciML/ADTypes.jl). | ||
|
||
## API Reference | ||
|
||
```@docs | ||
AutoSparse | ||
``` | ||
|
||
### Finite Differencing Backends | ||
|
||
```@docs | ||
AutoFiniteDiff | ||
``` | ||
|
||
### Forward Mode AD Backends | ||
|
||
```@docs | ||
AutoForwardDiff | ||
AutoPolyesterForwardDiff | ||
``` | ||
|
||
### Reverse Mode AD Backends | ||
|
||
```@docs | ||
AutoZygote | ||
AutoEnzyme | ||
``` | ||
For sparsity detection and sparse AD take a look at | ||
[sparsity detection](@ref sparsity-detection). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.