Lune

POPL2023顶会

Efficient Dual-Numbers Reverse AD via Well-Known Program Transformations

Tom Smeding, Matthijs Vákár

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • JAX Autodiff from a Linear Logic Perspective 引用了 Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation
  • JAX Autodiff from a Linear Logic Perspective 引用了 Automatic differentiation in PCF
  • JAX Autodiff from a Linear Logic Perspective 引用了 Backpropagation in the simply typed lambda-calculus with linear negation
  • JAX Autodiff from a Linear Logic Perspective 引用了 A simple differentiable programming language
  • JAX Autodiff from a Linear Logic Perspective 引用了 Efficient CHAD
  • On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters 引用了 Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation
  • On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters 引用了 ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs
  • On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters 引用了 Automatic differentiation in PCF
  • On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters 引用了 Backpropagation in the simply typed lambda-calculus with linear negation
  • On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters 引用了 A simple differentiable programming language
  • Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation 引用了 Automatic differentiation in PCF
  • Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation 引用了 Backpropagation in the simply typed lambda-calculus with linear negation
  • Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation 引用了 A simple differentiable programming language
  • ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs 引用了 Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation
  • ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs 引用了 Automatic differentiation in PCF
  • ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs 引用了 Backpropagation in the simply typed lambda-calculus with linear negation
  • Automatic differentiation in PCF 引用了 Backpropagation in the simply typed lambda-calculus with linear negation
  • Automatic differentiation in PCF 引用了 A simple differentiable programming language
  • Efficient CHAD 引用了 Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable ParametersWonyeol Lee, Sejun Park, Alex AikenICML 2023 · 6 次引用
  2. Efficient CHADTom Smeding, Matthijs VákárPOPL 2024 · 6 次引用
  3. ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable ProgramsMathieu Huot, Alexander K. Lew, Vikash K. Mansinghka, Sam StatonLICS 2023 · 5 次引用
  4. JAX Autodiff from a Linear Logic PerspectiveGiulia Giusti, Michele PaganiPOPL 2026

它引用的 Paper8

  1. A simple differentiable programming languageMartín Abadi, Gordon D. PlotkinPOPL 2020 · 49 次引用
  2. Automatic differentiation in PCFDamiano Mazza, Michele PaganiPOPL 2021 · 47 次引用
  3. Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiationFaustyna Krawiec, Simon Peyton Jones, Neel Krishnaswami, Tom Ellis 等POPL 2022 · 27 次引用
  4. Backpropagation in the simply typed lambda-calculus with linear negationAloïs Brunel, Damiano Mazza, Michele PaganiPOPL 2020 · 24 次引用
  5. Purity of an ST monad: full abstraction by semantically typed back-translationKoen Jacobs, Dominique Devriese, Amin TimanyOOPSLA 2022 · 13 次引用

相关 Paper

  1. AD for an Array Language with Nested ParallelismRobert Schenck, Ola Rønning, Troels Henriksen, Cosmin E. OanceaSC 2022 · 11 次引用
  2. You Only Linearize Once: Tangents Transpose to GradientsAlexey Radul, Adam Paszke, Roy Frostig, Matthew J. Johnson 等POPL 2023 · 13 次引用
  3. Reverse-mode automatic differentiation and optimization of GPU kernels via enzymeWilliam S. Moses, Valentin Churavy, Ludger Paehler, Jan Hückelheim 等SC 2021 · 50 次引用
  4. Compositional Taylor expansion in cartesian differential categoriesAymeric WalchLICS 2025
  5. ParDiff: Efficiently Parallelizing Reverse-Mode Automatic Differentiation with Direct IndexingShuhong Huang, Shizhi Tang, Yuan Wen, Huanqi Cao 等PPoPP 2026
黄昏的海面,两侧是细线勾勒的悬崖