按年被提到
20182018 · 3 次2026
编程语言与编译器›类型系统与函数式语言·arXiv:1810.07951 · cs.PL

Don't Unroll Adjoint: Differentiating SSA-Form Programs

不要展开伴随:对 SSA 形式程序做微分
Michael Innes · 2018

基于 SSA 形式的源码变换反向自动微分,Julia 的 Zygote 的原理

开始阅读 ↗PDFalphaXiv 讨论
被推荐 · 7 人首次 2018-10-20 · 最近 2021-12-25
7不同的人
7活跃月份
9讨论串
117被引(OpenAlex)

论文提出基于源码变换的反向模式自动微分(AD),针对现代编译器使用的静态单赋值(SSA)形式。该方法能支持控制流、嵌套、变异、递归、数据结构和高阶函数等语言结构,其输出交给现有编译器生成高效的微分代码。作者在 Julia 语言上实现了名为 Zygote 的新 AD 工具,对外呈现高层动态语义,同时在底层透明地编译伴随代码,并讨论了这种做法对 AD 工具易用性与性能的好处。

HN 为什么提它

HN 上的人用它说明 Julia 自动微分的特别之处:把 AD 作为编译器对 SSA 的变换,从而避开 JAX 那类追踪(tracing)方式的限制,常在谈 Zygote.jl 时引用。

方法难度 4 / 5约 40 分钟经得起时间
读之前最好知道
1自动微分(automatic differentiation)
2SSA 形式与编译器中间表示
3Julia 语言
4反向模式微分与伴随(adjoint)

学习路径

读这篇之前,按顺序读书架上的 2 篇 · 参考文献来自 OpenAlex,顺序和要点由 Claude Code 排出

这条路径帮你看到动态神经网络工具包对自动微分的新需求,以及 Julia 上整体编译的背景,再读基于 SSA 的反向微分。

  1. 1

    动态网络工具包要求框架能处理随输入变化的计算,说明为什么需要支持控制流的微分。

    读动态声明(dynamic declaration)计算图的思路。

  2. 2
    Automatic Full Compilation of Julia Programs and ML Models to Cloud TPUs将 Julia 程序与机器学习模型自动完整编译到 Cloud TPU · 2018

    同在 Julia 生态,说明如何把 Julia 程序整体编译到加速器上,与源码变换式微分相互配合。

    读把 Julia 代码交给 XLA 整体编译的流程;不必深究 TPU 实验。

  3. 3
    Don't Unroll Adjoint: Differentiating SSA-Form Programs不要展开伴随:对 SSA 形式程序做微分 · 2018 · 就是这篇

    对编译器使用的 SSA 形式做源码变换式反向微分,原理实现为 Zygote。

    读SSA 形式上的反向模式微分如何处理控制流和数据结构。

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
推荐krastanov · 2020-10

“I think this paper describes relatively well what is so special about the Julia autodiff tools”

推荐它,认为说清了 Julia 自动微分工具的特别之处
The Accelerating Adoption of Julia原评论 ↗
引用KenoFischer · 2019-07

“Mike has some details in an earlier paper: Don't Unroll Adjoint.”

指出 Mike 在这篇早期论文里有细节,把 AD 当作 SSA 上的编译器变换
A Differentiable Programming System to Bridge ML and Scientific Computing原评论 ↗
引用nestorD · 2020-02

“I have not read the paper yet but, reading the abstract, the idea of using continuation to store the differentiation information is reminiscent of the technique used in Zygote[0].”

读摘要后觉得用 continuation 存微分信息类似 Zygote
Demystifying Differentiable Programming (2018)原评论 ↗
引用ChrisRackauckas · 2021-07

“see the description of Zygote.jl Don't Unroll Adjoint”

引它说明 Zygote.jl 如何对 SSA 形式程序做微分
Useful algorithms that are not optimized by Jax, PyTorch, or TensorFlow原评论 ↗
引用ChrisRackauckas · 2021-12

“If you see the paper that was the synthesis for Zygote.jl, it was all about while loops and scalar operations.”

指出 Zygote 的论文主要讲 while 循环和标量运算
Trade-Offs in Automatic Differentiation: TensorFlow, PyTorch, Jax, and Julia原评论 ↗
被提交为 story · 4 次