A survey of Tapenade in contrast with Enzyme
The principles of AD, tangent and adjoint, are well established and
mostly agreed upon. They apply to fundamental structures of code such as
data structures, expressions, assignments, instruction sequence, and
(with acceptable limits) control flow. Problems arise when considering
the variety of programming constructs introduced by modern languages,
especially of the more dynamic kind. To work around these problems,
Enzyme's approach is to apply AD on LLVM, a lower-level representation
embedded in a popular compiler tool chain. This approach is clever,
appealing, and solves many of the problems presented by these new
languages. It might also raise new problems on its own. Over the last
decades, whe have studied Source-Transformation AD, that applies to
classical imperative languages (Fortran, C \dots), and that provides a
level of efficiency that is generally well appreciated. We would like to
present the design choices of the Source-Transformation AD tool Tapenade
and to highlight those contrasting with (our understanding of) Enzyme.
It is certainly a worthwhile goal to investigate combinations of the
qualities of the two approaches. We will conclude with some thoughts on
possible directions of Source-Transformation AD, inspired by the
strengths of other AD approaches.