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. 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.
翻译:我们展示了新的软件OpdiLib, 这是一种通用的软件 OpdiLib, 用于经典操作员超载的AD 工具, 使得 OpenMP 平行代码的自动区分( AD) 。 有了它, 我们就可以在反向模式操作员超载的 AD 工具中建立对 OpenMP 功能的支持, 其程度以前只在源转换工具中报告过。 我们用一个在 AD 上没有先例的基于事件的执行 ansatz 实现这一点。 加上在 OMPT 周围的现代 OpenMP 功能, 我们展示了如何在不进一步修改源代码的情况下使用 OpdiLib 来实现差异化; 我们也没有对数据访问模式施加先验限制, 从而使得 OpdiLib 高度适用。 对于进一步的性能优化, 可以以细微的精细度的方式取消对自动更新对自动变量的限制。 OpdiLb 还可以通过一个宏观接口, 半自动应用, 支持不执行 OMOPT。 我们证明 OpdiL 可用于在混合平行环境中的纯过往配置。 我们量化原子更新的同步更新成本成本的成本, 。