Forward-Mode Automatic Differentiation of Compiled Programs

09/05/2022
by   Max Aehle, et al.
0

Algorithmic differentiation (AD) is a set of techniques that provide partial derivatives of computer-implemented functions. Such a function can be supplied to state-of-the-art AD tools via its source code, or via an intermediate representation produced while compiling its 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 a 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 comes at the price of scaling the run-time by a factor between 30 and 75, measured on a benchmark based on a numerical solver for a partial differential equation. Results of our extensive regression test suite indicate that Derivgrind produces correct results on GCC- and Clang-compiled programs, including a Python interpreter, with a small number of exceptions. While we provide a list of scenarios that Derivgrind does not handle correctly, nearly all of them are academic counterexamples or originate from highly optimized math libraries. As long as differentiating those is avoided, Derivgrind can be applied to an unprecedentedly wide range of cross-language or partially closed-source software with little integration efforts.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/28/2022

Reverse-Mode Automatic Differentiation of Compiled Programs

Tools for algorithmic differentiation (AD) provide accurate derivatives ...
research
09/25/2018

Tangent: Automatic differentiation using source-code transformation for dynamically typed array programming

The need to efficiently calculate first- and higher-order derivatives of...
research
04/09/2020

Automatic Differentiation in ROOT

In mathematics and computer algebra, automatic differentiation (AD) is a...
research
10/18/2018

Don't Unroll Adjoint: Differentiating SSA-Form Programs

This paper presents reverse-mode algorithmic differentiation (AD) based ...
research
10/04/2020

Instead of Rewriting Foreign Code for Machine Learning, Automatically Synthesize Fast Gradients

Applying differentiable programming techniques and machine learning algo...
research
05/24/2019

Landau: language for dynamical systems with automatic differentiation

Most numerical solvers used to determine free variables of dynamical sys...
research
07/13/2022

Reduction of the Random Access Memory Size in Adjoint Algorithmic Differentiation by Overloading

Adjoint algorithmic differentiation by operator and function overloading...

Please sign up or login with your details

Forgot password? Click here to reset