Skip to yearly menu bar Skip to main content

Workshop: Differentiable Programming Workshop

Aggregated type handling in AD tape implementations

Max Sagebaum


The development of AD tools focuses mostly on handling floating point types in the target language. Taping optimizations in these tools mostly focus on specific operations like matrix vector products.Aggregated types like std::complex are usually handled by specifying the AD type as a template argument.This approach provides exact results, but prevents the use of expression templates.If AD tools are extended and specialized such that aggregated types can be added to the expression framework, then this will result in reduced memory utilization and improve the timing for applications where aggregated types such as complex number, matrix vector operations or layer operations in neural networks are used. Such an integration requires a reformulation of the stored data per expression and a rework of the tape evaluation process. In this paper we demonstrate the overhead of unhandled aggregated types in expression templates and provide basic ingredients for a tape implementation that supports arbitrary aggregated types for which the user has implemented some type traits. Finally, we demonstrate the advantages of aggregated type handling on a synthetic benchmark case.