Event-Based Automatic Differentiation of OpenMP with OpDiLib

Johannes Blühdorn, Max Sagebaum, Nicolas R. Gauger
2/23/2021
cs.MS

Official code: SciCompKL/OpDiLib (6 stars, C++, LGPL-3.0, last commit 2026-01-12).

Abstract

We present the new software OpDiLib, a universal add-on for classical operator overloading AD tools that enables the automatic differentiation (AD) of OpenMP parallelized code. With it, we establish support for OpenMP features in a reverse mode operator overloading AD tool to an extent that was previously only reported on in source transformation tools.

Show full abstract

We achieve this with an event-based implementation ansatz that is unprecedented in AD. Combined with modern OpenMP features around OMPT, we demonstrate how it can be used to achieve differentiation without any additional modifications of the source code; neither do we impose a priori restrictions on the data access patterns, which makes OpDiLib highly applicable. For further performance optimizations, restrictions like atomic updates on adjoint variables can be lifted in a fine-grained manner. OpDiLib can also be applied in a semi-automatic fashion via a macro interface, which supports compilers that do not implement OMPT. We demonstrate the applicability of OpDiLib for a pure operator overloading approach in a hybrid parallel environment. We quantify the cost of atomic updates on adjoint variables and showcase the speedup and scaling that can be achieved with the different configurations of OpDiLib in both the forward and the reverse pass.

View on arXivView PDF

Code Implementations(1)

SciCompKL/OpDiLibOfficial100%
LGPL-3.0

Universal add-on for operator overloading AD tools that enables the differentiation of OpenMP parallel codes.

64C++, PythonFeb 23, 202110 months agoLGPL-3.0

Similar Papers

Cite this paper

@article{blhdorn2021eventbased,
  title  = {Event-Based Automatic Differentiation of OpenMP with OpDiLib},
  author = {Johannes Blühdorn and Max Sagebaum and Nicolas R. Gauger},
  year   = {2021},
  eprint = {2102.11572},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.11572}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2102.11572.svg)](https://codeofpaper.com/paper/2102.11572)

Discussion