diff --git a/DifferentiationInterface/docs/make.jl b/DifferentiationInterface/docs/make.jl index 93ce4045e..083f30f6d 100644 --- a/DifferentiationInterface/docs/make.jl +++ b/DifferentiationInterface/docs/make.jl @@ -4,7 +4,7 @@ import DifferentiationInterface as DI using Documenter using DocumenterMermaid -using ADTypes +using ADTypes: ADTypes using Diffractor: Diffractor using Enzyme: Enzyme using FastDifferentiation: FastDifferentiation @@ -37,16 +37,18 @@ extensions = [ ] makedocs(; - modules=[DifferentiationInterface, extensions...], + modules=[DifferentiationInterface, ADTypes, extensions...], authors="Guillaume Dalle, Adrian Hill", sitename="DifferentiationInterface.jl", format=Documenter.HTML(), pages=[ - "Home" => "index.md", # + "Home" => "index.md", "Start here" => ["tutorial.md", "overview.md", "backends.md"], "API reference" => "api.md", "Advanced" => ["design.md", "extensions.md", "overloads.md"], ], + checkdocs=:exports, + warnonly=[:missing_docs, :cross_references], ) deploydocs(; diff --git a/DifferentiationInterface/docs/src/backends.md b/DifferentiationInterface/docs/src/backends.md index d14b54b28..9d7299b64 100644 --- a/DifferentiationInterface/docs/src/backends.md +++ b/DifferentiationInterface/docs/src/backends.md @@ -4,7 +4,6 @@ CollapsedDocStrings = true ``` ```@setup backends -using ADTypes using DifferentiationInterface using DifferentiationInterface: backend_string import Markdown @@ -70,3 +69,27 @@ You can check this compatibility using [`check_twoarg`](@ref). Only some backends are able to compute Hessians. You can use [`check_hessian`](@ref) to check this feature. + + +## API Reference + +!!! warning + The following documentation has been re-exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl). + Refer to the ADTypes documentation for more information. + +```@docs +AutoChainRules +AutoDiffractor +AutoEnzyme +AutoFastDifferentiation +AutoFiniteDiff +AutoFiniteDifferences +AutoForwardDiff +AutoPolyesterForwardDiff +AutoReverseDiff +AutoSymbolics +AutoTapir +AutoTracker +AutoZygote +AutoSparse +``` \ No newline at end of file diff --git a/DifferentiationInterface/docs/src/overloads.md b/DifferentiationInterface/docs/src/overloads.md index 6625a94c7..60b3f7918 100644 --- a/DifferentiationInterface/docs/src/overloads.md +++ b/DifferentiationInterface/docs/src/overloads.md @@ -22,7 +22,7 @@ Each cell can have three values: Check marks (✅) are clickable and link to the source code. ```@setup overloads -using ADTypes +using ADTypes: AbstractADType using DifferentiationInterface using DifferentiationInterface: backend_string, mutation_support, MutationSupported using Markdown: Markdown diff --git a/DifferentiationInterface/src/DifferentiationInterface.jl b/DifferentiationInterface/src/DifferentiationInterface.jl index e6d50ca7f..d2ff4a8e4 100644 --- a/DifferentiationInterface/src/DifferentiationInterface.jl +++ b/DifferentiationInterface/src/DifferentiationInterface.jl @@ -87,4 +87,21 @@ export prepare_second_derivative, prepare_hvp, prepare_hessian export check_available, check_twoarg, check_hessian +# Re-export backends from ADTypes +export AutoChainRules +export AutoDiffractor +export AutoEnzyme +export AutoFastDifferentiation +export AutoFiniteDiff +export AutoFiniteDifferences +export AutoForwardDiff +export AutoPolyesterForwardDiff +export AutoReverseDiff +export AutoSymbolics +export AutoTapir +export AutoTracker +export AutoZygote + +export AutoSparse + end # module diff --git a/DifferentiationInterface/src/utils/printing.jl b/DifferentiationInterface/src/utils/printing.jl index f5bd7ad79..6a71c414c 100644 --- a/DifferentiationInterface/src/utils/printing.jl +++ b/DifferentiationInterface/src/utils/printing.jl @@ -1,4 +1,5 @@ backend_package_name(b::AbstractADType) = strip(string(b), ['(', ')']) +backend_package_name(b::AutoSparse) = backend_package_name(dense_ad(b)) backend_package_name(::AutoChainRules) = "ChainRules" backend_package_name(::AutoDiffractor) = "Diffractor" diff --git a/DifferentiationInterfaceTest/docs/src/tutorial.md b/DifferentiationInterfaceTest/docs/src/tutorial.md index c6f5c0c6b..3ba0aebb7 100644 --- a/DifferentiationInterfaceTest/docs/src/tutorial.md +++ b/DifferentiationInterfaceTest/docs/src/tutorial.md @@ -8,7 +8,7 @@ We present a typical workflow with DifferentiationInterfaceTest.jl, building on ```@repl tuto using DifferentiationInterface, DifferentiationInterfaceTest -import ADTypes, ForwardDiff, Enzyme +import ForwardDiff, Enzyme import DataFrames, Markdown, PrettyTables, Printf ``` @@ -17,7 +17,7 @@ import DataFrames, Markdown, PrettyTables, Printf The AD backends we want to compare are [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) and [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl). ```@repl tuto -backends = [ADTypes.AutoForwardDiff(), ADTypes.AutoEnzyme(; mode=Enzyme.Reverse)] +backends = [AutoForwardDiff(), AutoEnzyme(; mode=Enzyme.Reverse)] ``` To do that, we are going to take gradients of a simple function: