论文标题
平行双数字反向广告
Parallel Dual-Numbers Reverse AD
论文作者
论文摘要
如果双数字向前模式自动分化(AD)将每个标量值配对与其切线值配对,则双数字反向模式AD尝试使用类似简单的想法来实现反向AD:通过将每个标量值配对与后propagator函数。 Brunel,Mazza和Pagani已经分析了其对高阶输入语言的正确性和效率,但是此分析使用了一种自定义操作语义,目前尚不清楚是否可以有效地实现它。我们从使用线性保理的灵感来将双数字反向模式AD优化到具有正确复杂性的算法,并在标准功能语言中具有有效的实现,并支持对可变阵列(例如Haskell)的有效实现。除线性保理成分外,我们的优化步骤还包括功能编程社区的知名思想。我们通过提供了分化Haskell98的大部分实施方法来证明我们的技术的使用。如果以前的双数逆向广告需要顺序化来构建反向通行证,我们证明我们可以将技术应用于任务并行源程序并生成任务并行导数计算。
Where dual-numbers forward-mode automatic differentiation (AD) pairs each scalar value with its tangent value, dual-numbers reverse-mode AD attempts to achieve reverse AD using a similarly simple idea: by pairing each scalar value with a backpropagator function. Its correctness and efficiency on higher-order input languages have been analysed by Brunel, Mazza and Pagani, but this analysis used a custom operational semantics for which it is unclear whether it can be implemented efficiently. We take inspiration from their use of linear factoring to optimise dual-numbers reverse-mode AD to an algorithm that has the correct complexity and enjoys an efficient implementation in a standard functional language with support for mutable arrays, such as Haskell. Aside from the linear factoring ingredient, our optimisation steps consist of well-known ideas from the functional programming community. We demonstrate the use of our technique by providing a practical implementation that differentiates most of Haskell98. Where previous work on dual numbers reverse AD has required sequentialisation to construct the reverse pass, we demonstrate that we can apply our technique to task-parallel source programs and generate a task-parallel derivative computation.