BibTeX
@ARTICLE{
Aehle2025FMA,
author = "Aehle, Max and Bl\"{u}hdorn, Johannes and Sagebaum, Max and Gauger, Nicolas
R.",
title = "Forward-Mode Automatic Differentiation of Compiled Programs",
year = "2025",
publisher = "Association for Computing Machinery",
address = "New York, NY, USA",
volume = "51",
number = "2",
issn = "0098-3500",
url = "https://doi.org/10.1145/3716309",
doi = "10.1145/3716309",
abstract = "Algorithmic differentiation (AD) is a set of techniques that provide partial
derivatives of computer-implemented functions. Such functions can be supplied to state-of-the-art AD
tools via their source code, or via intermediate representations produced while compiling their
source code.We present the novel AD tool Derivgrind, which augments the machine code of compiled
programs with forward-mode AD logic. Derivgrind leverages the Valgrind instrumentation framework for
structured access to the machine code, and a shadow memory tool to store dot values. Access to the
source code is required at most for the files in which input and output variables are defined.
Derivgrind’s versatility mainly comes at the price of reduced run-time performance. According
to our extensive regression test suite, Derivgrind produces correct results on GCC- and
Clang-compiled programs, including a Python interpreter, with a small number of exceptions. We
provide a list of “bit-tricks” that Derivgrind does not handle correctly, some of which
actually appear in highly optimized math libraries. As long as differentiating those is avoided,
Derivgrind enables black-box forward-mode AD for an unprecedentedly wide range of cross-language
software with little integration efforts.",
journal = "ACM Trans. Math. Softw.",
month = "may",
articleno = "7",
numpages = "25",
keywords = "Algorithmic Differentiation, Automatic Differentiation, Differentiable Programming,
Dynamic Binary Instrumentation, Valgrind, Derivgrind",
ad_tools = "Derivgrind"
}
|