Skip to content

Commit d8905f5

Browse files
authored
docs: make Enzyme warning more visible (#808)
1 parent f07b6ec commit d8905f5

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

DifferentiationInterface/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ We support the following backends defined by [ADTypes.jl](https://github.com/Sci
3232

3333
- [ChainRulesCore.jl](https://github.com/JuliaDiff/ChainRulesCore.jl)
3434
- [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl) (currently broken)
35-
- [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl)
35+
- [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) (see below)
3636
- [FastDifferentiation.jl](https://github.com/brianguenter/FastDifferentiation.jl)
3737
- [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl)
3838
- [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl)
@@ -45,10 +45,8 @@ We support the following backends defined by [ADTypes.jl](https://github.com/Sci
4545
- [Tracker.jl](https://github.com/FluxML/Tracker.jl)
4646
- [Zygote.jl](https://github.com/FluxML/Zygote.jl)
4747

48-
Note that in some cases, going through DifferentiationInterface.jl might be slower than a direct call to the backend's API.
49-
This is mostly true for Enzyme.jl, whose handling of activities and multiple arguments unlocks additional performance.
50-
We are working on this challenge, and welcome any suggestions or contributions.
51-
Meanwhile, if differentiation fails or takes too long, consider using Enzyme.jl directly.
48+
> [!CAUTION]
49+
> Note that in some cases, going through DifferentiationInterface.jl might be slower or cause more errors than a direct call to the backend's API. This is especially true for Enzyme.jl, whose handling of activities and multiple arguments is not fully supported here. We are working on this challenge, and welcome any suggestions or contributions. Meanwhile, if differentiation fails or takes too long, consider using Enzyme.jl through its [native API](https://enzymead.github.io/Enzyme.jl/stable/) instead.
5250
5351
## Installation
5452

DifferentiationInterface/docs/make.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ links = InterLinks(
1616
"Symbolics" => "https://symbolics.juliasymbolics.org/stable/",
1717
)
1818

19-
cp(joinpath(@__DIR__, "..", "README.md"), joinpath(@__DIR__, "src", "index.md"); force=true)
19+
readme_str = read(joinpath(@__DIR__, "..", "README.md"), String)
20+
readme_str = replace(readme_str, "> [!CAUTION]\n> " => "!!! warning\n ")
21+
write(joinpath(@__DIR__, "src", "index.md"), readme_str)
2022

2123
makedocs(;
2224
modules=[DifferentiationInterface],

DifferentiationInterface/docs/src/explanation/backends.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ We only implement `pushforward`.
120120
Depending on the `mode` attribute inside [`AutoEnzyme`](@extref ADTypes.AutoEnzyme), we implement either `pushforward` or `pullback` based on `Enzyme.autodiff`.
121121
When necessary, preparation chooses a number of chunks (for `gradient` and `jacobian` in forward mode, for `jacobian` only in reverse mode).
122122

123+
!!! warning
124+
Enzyme.jl's handling of activities and multiple arguments is not fully supported here, which can cause slowdowns or errors.
125+
If differentiation fails or takes too long, consider using Enzyme.jl through its [native API](https://enzymead.github.io/Enzyme.jl/stable/) instead.
126+
123127
### FastDifferentiation
124128

125129
For every operator, preparation generates an [executable function](https://brianguenter.github.io/FastDifferentiation.jl/stable/makefunction/) from the symbolic expression of the differentiated function.

0 commit comments

Comments
 (0)