|
2 | 2 |
|
3 | 3 | # DifferentiationInterface |
4 | 4 |
|
5 | | -[](https://github.com/JuliaDiff/DifferentiationInterface.jl/actions/workflows/Test.yml?query=branch%3Amain) |
6 | | -[](https://app.codecov.io/gh/JuliaDiff/DifferentiationInterface.jl) |
7 | | -[](https://github.com/fredrikekre/Runic.jl) |
8 | | -[](https://github.com/SciML/ColPrac) |
9 | | -[](https://zenodo.org/doi/10.5281/zenodo.11092033) |
10 | | - |
11 | | -| Package | Docs | |
12 | | -| :--------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | |
13 | | -| DifferentiationInterface | [](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/stable/) [](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/dev/) | |
14 | | -| DifferentiationInterfaceTest | [](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterfaceTest/stable/) [](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterfaceTest/dev/) | |
| 5 | +| Category | Badges | |
| 6 | +|---|---| |
| 7 | +| Build status | [](https://github.com/JuliaDiff/DifferentiationInterface.jl/actions/workflows/Test.yml?query=branch%3Amain) [](https://app.codecov.io/gh/JuliaDiff/DifferentiationInterface.jl) | |
| 8 | +| Documentation | [](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/stable/) [](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/dev/) [](https://github.com/SciML/ColPrac) | |
| 9 | +| Code quality | [](https://github.com/fredrikekre/Runic.jl) [](https://github.com/JuliaTesting/Aqua.jl) | |
| 10 | +| Downloads | [](http://juliapkgstats.com/pkg/DifferentiationInterface) [](https://juliahub.com/ui/Packages/General/DifferentiationInterface?#dependents) | |
| 11 | +| References | [](https://zenodo.org/doi/10.5281/zenodo.11092033) | |
15 | 12 |
|
16 | 13 | An interface to various automatic differentiation (AD) backends in Julia. |
17 | 14 |
|
18 | 15 | ## Goal |
19 | 16 |
|
20 | 17 | This package provides a unified syntax to differentiate functions, including: |
21 | 18 |
|
22 | | - - First- and second-order operators (gradients, Jacobians, Hessians and more) |
23 | | - - In-place and out-of-place differentiation |
24 | | - - Preparation mechanism (e.g. to pre-allocate a cache or record a tape) |
25 | | - - Built-in sparsity handling |
26 | | - - Thorough validation on standard inputs and outputs (numbers, vectors, matrices) |
27 | | - - Testing and benchmarking utilities accessible to users with [DifferentiationInterfaceTest](https://github.com/JuliaDiff/DifferentiationInterface.jl/tree/main/DifferentiationInterfaceTest) |
| 19 | +- First- and second-order operators (gradients, Jacobians, Hessians and more) |
| 20 | +- In-place and out-of-place differentiation |
| 21 | +- Preparation mechanism (e.g. to pre-allocate a cache or record a tape) |
| 22 | +- Built-in sparsity handling |
| 23 | +- Thorough validation on standard inputs and outputs (numbers, vectors, matrices) |
| 24 | +- Testing and benchmarking utilities accessible to users with [DifferentiationInterfaceTest](https://github.com/JuliaDiff/DifferentiationInterface.jl/tree/main/DifferentiationInterfaceTest) |
28 | 25 |
|
29 | 26 | ## Compatibility |
30 | 27 |
|
31 | 28 | We support the following backends defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl): |
32 | 29 |
|
33 | | - - [ChainRulesCore.jl](https://github.com/JuliaDiff/ChainRulesCore.jl) |
34 | | - - [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl) (currently broken) |
35 | | - - [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) (see below) |
36 | | - - [FastDifferentiation.jl](https://github.com/brianguenter/FastDifferentiation.jl) |
37 | | - - [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl) |
38 | | - - [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl) |
39 | | - - [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) |
40 | | - - [GTPSA.jl](https://github.com/bmad-sim/GTPSA.jl) |
41 | | - - [Mooncake.jl](https://github.com/chalk-lab/Mooncake.jl) |
42 | | - - [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl) |
43 | | - - [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl) |
44 | | - - [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) |
45 | | - - [Tracker.jl](https://github.com/FluxML/Tracker.jl) |
46 | | - - [Zygote.jl](https://github.com/FluxML/Zygote.jl) |
| 30 | +- [ChainRulesCore.jl](https://github.com/JuliaDiff/ChainRulesCore.jl) |
| 31 | +- [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl) (currently broken) |
| 32 | +- [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) (see below) |
| 33 | +- [FastDifferentiation.jl](https://github.com/brianguenter/FastDifferentiation.jl) |
| 34 | +- [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl) |
| 35 | +- [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl) |
| 36 | +- [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) |
| 37 | +- [GTPSA.jl](https://github.com/bmad-sim/GTPSA.jl) |
| 38 | +- [Mooncake.jl](https://github.com/chalk-lab/Mooncake.jl) |
| 39 | +- [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl) |
| 40 | +- [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl) |
| 41 | +- [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) |
| 42 | +- [Tracker.jl](https://github.com/FluxML/Tracker.jl) |
| 43 | +- [Zygote.jl](https://github.com/FluxML/Zygote.jl) |
47 | 44 |
|
48 | 45 | > [!CAUTION] |
49 | 46 | > 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. |
@@ -92,42 +89,44 @@ To improve your performance by up to several orders of magnitude compared to thi |
92 | 89 |
|
93 | 90 | Whenever you refer to this package or the ideas it contains, please cite: |
94 | 91 |
|
95 | | - 1. our preprint [*A Common Interface for Automatic Differentiation*](https://arxiv.org/abs/2505.05542); |
| 92 | + 1. our JMLR paper [*A Common Interface for Automatic Differentiation*](https://jmlr.org/papers/v27/25-1024.html); |
96 | 93 | 2. our inspiration [AbstractDifferentiation.jl](https://github.com/JuliaDiff/AbstractDifferentiation.jl). |
| 94 | + 3. if you use sparse differentiation capabilities, our companion packages [SparseConnectivityTracer.jl](https://github.com/adrhill/SparseConnectivityTracer.jl) and [SparseMatrixColorings.jl](https://github.com/JuliaDiff/SparseMatrixColorings.jl) which provide these capabilities (see their respective repositories for guidelines). |
97 | 95 |
|
98 | | -You can use the provided [`CITATION.cff`](https://github.com/JuliaDiff/DifferentiationInterface.jl/blob/main/CITATION.cff) file or the following BibTeX entries: |
| 96 | +For the first two items, you can use the provided [`CITATION.cff`](https://github.com/JuliaDiff/DifferentiationInterface.jl/blob/main/CITATION.cff) file or the following BibTeX entries: |
99 | 97 |
|
100 | 98 | ```bibtex |
101 | | -@misc{dalle2025commoninterfaceautomaticdifferentiation, |
102 | | - title={A Common Interface for Automatic Differentiation}, |
103 | | - author={Guillaume Dalle and Adrian Hill}, |
104 | | - year={2025}, |
105 | | - eprint={2505.05542}, |
106 | | - archivePrefix={arXiv}, |
107 | | - primaryClass={cs.MS}, |
108 | | - url={https://arxiv.org/abs/2505.05542}, |
| 99 | +@article{dalle2026commoninterfaceautomaticdifferentiation, |
| 100 | + author = {Guillaume Dalle and Adrian Hill}, |
| 101 | + title = {A Common Interface for Automatic Differentiation}, |
| 102 | + journal = {Journal of Machine Learning Research}, |
| 103 | + year = {2026}, |
| 104 | + volume = {27}, |
| 105 | + number = {25}, |
| 106 | + pages = {1--13}, |
| 107 | + url = {http://jmlr.org/papers/v27/25-1024.html} |
109 | 108 | } |
110 | 109 |
|
111 | | -@misc{schäfer2022abstractdifferentiationjlbackendagnosticdifferentiableprogramming, |
112 | | - title={AbstractDifferentiation.jl: Backend-Agnostic Differentiable Programming in Julia}, |
113 | | - author={Frank Schäfer and Mohamed Tarek and Lyndon White and Chris Rackauckas}, |
114 | | - year={2022}, |
115 | | - eprint={2109.12449}, |
116 | | - archivePrefix={arXiv}, |
117 | | - primaryClass={cs.MS}, |
118 | | - url={https://arxiv.org/abs/2109.12449}, |
| 110 | +@misc{schäfer2022abstractdifferentiationjlbackendagnostic, |
| 111 | + title = {AbstractDifferentiation.jl: Backend-Agnostic Differentiable Programming in Julia}, |
| 112 | + author = {Frank Schäfer and Mohamed Tarek and Lyndon White and Chris Rackauckas}, |
| 113 | + year = {2022}, |
| 114 | + eprint = {2109.12449}, |
| 115 | + archiveprefix = {arXiv}, |
| 116 | + primaryclass = {cs.MS}, |
| 117 | + url = {https://arxiv.org/abs/2109.12449} |
119 | 118 | } |
120 | 119 | ``` |
121 | 120 |
|
122 | | -If you use the software, additionally cite us using the precise [Zenodo DOI](https://zenodo.org/records/11092033) of the package version you used, or the BibTeX entry below: |
| 121 | +If you run the actual software as part of your experiments, please cite the precise [Zenodo DOI](https://zenodo.org/records/11092033) of the package version you used, or the BibTeX entry below: |
123 | 122 |
|
124 | 123 | ```bibtex |
125 | | -@software{dalleDifferentiationInterface2025, |
126 | | - author={Dalle, Guillaume and Hill, Adrian}, |
127 | | - title={Differentiation{I}nterface.jl}, |
128 | | - year={2024}, |
129 | | - publisher={Zenodo}, |
130 | | - doi={10.5281/zenodo.11092033}, |
131 | | - url={https://doi.org/10.5281/zenodo.11092033}, |
| 124 | +@software{dalle2024DifferentiationInterface202, |
| 125 | + author = {Dalle, Guillaume and Hill, Adrian}, |
| 126 | + title = {Differentiation{I}nterface.jl}, |
| 127 | + year = {2024}, |
| 128 | + publisher = {Zenodo}, |
| 129 | + doi = {10.5281/zenodo.11092033}, |
| 130 | + url = {https://doi.org/10.5281/zenodo.11092033} |
132 | 131 | } |
133 | 132 | ``` |
0 commit comments