PyTorch: A Reference Language — 编译器验证新范式

Edward Z. Yang (ezyang, PyTorch 核心维护者) 提出 PyTorch 同时扮演”参考语言”和”实现语言”的双重角色。

核心论点:随着 kernel DSL 和 coding agents 的爆发,生产模式变为”一条实现做研究,一条实现做规模,一个验证器在暗中连接两者”的三元架构。

关键要素:

  1. Reference ↔ Production 分离 — 纯 PyTorch 参考实现 + LLM 生成显式 forward-backward 生产实现
  2. Verifier 取代 pattern matching — bitwise equivalence test 或 graph structural equivalence
  3. Tangent (Google AD) 遗产复活 — LLM 时代 source-to-source AD 重获可行性
  4. Inverse pattern match — fusion 优化时只需提供 fusion 的参考实现

发布于 2026-07-25 | HN: 24pts (49079454)