Algorithmic differentiation (AD) is a set of techniques to obtain accurate derivatives of a computer-implemented function in an automatic fashion. State-of-the-art AD tools rely on the source code of the implementation or internal representations of compilers building it. We present the new AD tool Derivgrind, which augments the machine code of compiled programs with forward AD logic. Derivgrind leverages the Valgrind instrumentation framework for a structured access to the machine code, and a shadow memory tool to store dot values. Depending on the application scenario, no access to the source code is required at all, or the access is restricted to the parts defining input and output variables. Derivgrind's versatility comes at the price of scaling the running time by a factor between 60 and 140, measured on a benchmark based on a PDE solver. Results of our extensive test suite indicate that Derivgrind produces correct results on GCC- and Clang-compiled programs, including a Python interpreter, with a small number of exceptions. While we provide a list of scenarios that Derivgrind does not handle correctly, most of them are academic examples or originate from highly optimized math libraries. We will therefore further study the potential of our tool in more complex software projects.
翻译:算法差异( AD) 是一套自动获取计算机执行功能的精确衍生物的技术。 最先进的 AD 工具依赖于执行源代码或构建该功能的汇编者内部代表。 我们介绍了新的 AD 工具 Derivgrind, 以远端的AD 逻辑来补充编篡程序机码。 Derivgrind 利用 Valgrind 仪表框架来结构化访问机器代码, 以及一个存储点值的影子存储工具。 根据应用设想, 完全不需要访问源代码, 或访问限制于定义输入和输出变量的部分。 Derivgrind 的多功能是以60到140个因素的价格出现的, 以基于PDE 解算器的基准来衡量。 我们广泛的测试套的结果表明, Derivgrind 在GC- 和 Clang- concompil 程序上产生了正确的结果, 包括一个 Python 解释器, 有少量的例外。 虽然我们提供了Derivgrind 无法正确处理我们复杂的数学研究工具中的大多数。