Mixed-language automatic differentiation

Valérie Pascual 1, 2 Laurent Hascoët 1, 2
1 TROPICS - Program transformations for scientific computing
CRISAM - Inria Sophia Antipolis - Méditerranée
Abstract : As Automatic Differentiation (AD) usage is spreading to larger and more sophisticated applications, problems arise for codes that use several programming languages. This work describes the issues involved in interoperability between languages and focuses on the main issue which is parameter passing. It describes the architecture of a source transformation AD tool and the algorithms used to differentiate mixed-language codes. A language-independent internal representation enables application of global analysis and strategies on the entire source code. Our goal is that the Tapenade AD tool differentiates codes that mix C and Fortran and generates efficient differentiated code using these strategies. Many Automatic Differentiation tools have been designed with one application language in mind. Only a few use an internal representation that promotes language-independence, at least conceptually. When faced with the problem of building (with AD) the derivative code of a mixed-language application, end-users may consider using several AD tools, one per language. However, this leads to several problems: • Different AD tools may implement very different AD concepts such as overloading-based versus source-transformation based transformations, or association-by-address versus association-by-name for storage of derivatives values. These concepts are generally not directly compatible. • When selecting the source-transformation concept (for efficiency of the differentiated code), performance of the differentiated code strongly depends on the quality of data-flow analysis, which is improved if it is global on the code. A global analysis with separate AD tools would require inter-tool communication at the level of data-flow analysis, which does not exist at present. It is possible to produce efficient derivative code for mixed-language applications using single-language AD tools by writing by hand dummy definitions of black-box procedures with the same data flow behavior. However, this method is prone to error and is tedious to apply for large mixed-language applications. It is also possible to automatically interface differentiated codes from different languages with a suitable high-level specification, for
Document type :
Journal articles
Complete list of metadatas

Cited literature [17 references]  Display  Hide  Download

Contributor : Valérie Pascual <>
Submitted on : Wednesday, August 1, 2018 - 10:12:45 AM
Last modification on : Wednesday, September 12, 2018 - 1:16:10 AM
Long-term archiving on : Friday, November 2, 2018 - 2:01:44 PM


Files produced by the author(s)




Valérie Pascual, Laurent Hascoët. Mixed-language automatic differentiation. Optimization Methods and Software, Taylor & Francis, 2018, 00, pp.1 - 15. ⟨10.1080/10556788.2018.1435650⟩. ⟨hal-01852216⟩



Record views


Files downloads