Team, Visitors, External Collaborators
Overall Objectives
Research Program
Application Domains
New Software and Platforms
New Results
XML PDF e-pub
PDF e-Pub

Section: Research Program

Algorithmic Differentiation

Participants : Laurent Hascoët, Valérie Pascual.

algorithmic differentiation

(AD, aka Automatic Differentiation) Transformation of a program, that returns a new program that computes derivatives of the initial program, i.e. some combination of the partial derivatives of the program's outputs with respect to its inputs.


Mathematical manipulation of the Partial Differential Equations that define a problem, obtaining new differential equations that define the gradient of the original problem's solution.


General trade-off technique, used in adjoint AD, that trades duplicate execution of a part of the program to save some memory space that was used to save intermediate results.

Algorithmic Differentiation (AD) differentiates programs. The input of AD is a source program P that, given some Xn, returns some Y=F(X)m, for a differentiable F. AD generates a new source program P' that, given X, computes some derivatives of F [4].

Any execution of P amounts to a sequence of instructions, which is identified with a composition of vector functions. Thus, if

where each fk is the elementary function implemented by instruction Ik. AD applies the chain rule to obtain derivatives of F. Calling Xk the values of all variables after instruction Ik, i.e. X0=X and Xk=fk(Xk-1), the Jacobian of F is

which can be mechanically written as a sequence of instructions Ik'. This can be generalized to higher level derivatives, Taylor series, etc. Combining the Ik' with the control of P yields P', and therefore this differentiation is piecewise.

The above computation of F'(X), albeit simple and mechanical, can be prohibitively expensive on large codes. In practice, many applications only need cheaper projections of F'(X) such as:

Adjoint AD builds a very efficient program  [27], which computes the gradient in a time independent from the number of parameters n. In contrast, computing the same gradient with the tangent mode would require running the tangent differentiated program n times.

However, the Xk are required in the inverse of their computation order. If the original program overwrites a part of Xk, the differentiated program must restore Xk before it is used by fk+1'*(Xk). Therefore, the central research problem of adjoint AD is to make the Xk available in reverse order at the cheapest cost, using strategies that combine storage, repeated forward computation from available previous values, or even inverted computation from available later values.

Another research issue is to make the AD model cope with the constant evolution of modern language constructs. From the old days of Fortran77, novelties include pointers and dynamic allocation, modularity, structured data types, objects, vectorial notation and parallel programming. We keep developing our models and tools to handle these new constructs.