Tools for algorithmic differentiation (AD) provide accurate derivatives of computer-implemented functions for use in, e. g., optimization and machine learning (ML). However, they often require the source code of the function to be available in a restricted set of programming languages. As a step towards making AD accessible for code bases with cross-language or closed-source components, we recently presented the forward-mode AD tool Derivgrind. It inserts forward-mode AD logic into the machine code of a compiled program using the Valgrind dynamic binary instrumentation framework. This work extends Derivgrind, adding the capability to record the real-arithmetic evaluation tree, and thus enabling operator overloading style reverse-mode AD for compiled programs. We maintain the high level of correctness reported for Derivgrind's forward mode, failing the same few testcases in an extensive test suite for the same well-understood reasons. Runtime-wise, the recording slows down the execution of a compiled 64-bit benchmark program by a factor of about 180.
翻译:算法区分工具( AD) 提供了计算机执行功能的精确衍生物, 用于( 例如) 优化和机器学习( ML) 。 但是, 它们往往要求该功能的源代码以有限的一套编程语言提供。 作为使具有跨语言或封闭源组件的代码基础可以使用自动交换的一个步骤, 我们最近展示了前方模式 AD 工具 Derivgrind 。 它使用 Valgrind 动态二进制仪框架将前方模式AD 逻辑插入编译程序的机器代码中。 这项工作扩展了 Derivgrind, 添加了记录真实- 定量评价树的能力, 从而使得编译程序能够让操作器超载式反向模式ADAD 。 我们保持了Derivgrind 前方模式报告的高度正确性, 由于同样原因在广泛的测试套房里没有同样的几个测试框。 运行时, 记录慢慢慢了编译的64位基准程序的执行速度约为 180 。