A Common Interface for Automatic Differentiation
Guillaume Dalle, Adrian Hill
TL;DR
The paper tackles the challenge of choosing among diverse Automatic Differentiation backends in scientific computing by introducing DifferentiationInterface.jl (DI), a common frontend that unifies access to multiple AD packages. It emphasizes a modular design built on backends, operators, and a novel preparation mechanism that amortizes one-time computations, enabling advanced capabilities like sparse AD. Key contributions include a standardized API across backends, support for contexts and sparsity, backend composition and translation, and an accompanying testing framework for benchmarking. This approach lowers the barrier to experiment with different AD solutions, improves performance for complex differentiable workflows, and provides a scalable path for broader adoption in Julia-based scientific computing.
Abstract
For scientific machine learning tasks with a lot of custom code, picking the right Automatic Differentiation (AD) system matters. Our Julia package DifferentiationInterface$.$jl provides a common frontend to a dozen AD backends, unlocking easy comparison and modular development. In particular, its built-in preparation mechanism leverages the strengths of each backend by amortizing one-time computations. This is key to enabling sophisticated features like sparsity handling without putting additional burdens on the user.
