paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Mind the Abstraction Gap: Bringing Equality Saturation to Real-World ML Compilers

注意抽象鸿沟:将等价饱和引入真实世界的 ML 编译器
OOPSLA 9(OOPSLA2)2025匹配度 6/10 · 论文将等价饱和(PL中的程序变换/优化技术)应用于真实ML编译器XLA,属于PL→AI中“将PL技术用于ML系统”的方向,且注重工程落地与问题驱动。但它并非用户核心关注的静态分析,也不涉及LLM/Agent、浮点程序分析或贝叶斯程序分析,因此匹配度中等。引用 3 inbox
Arya Vohra, Leo Seojun Lee, Jakub Bachurski, Oleksandr Zinenko, Phitchaya Mangpo Phothilimthana, Albert Cohen, William S. Moses
crossref: 2026-09-10

AI 速览

一句话:将等价饱和用于真实 ML 计算图,结合全局代价模型优化 XLA,在 CPU/GPU 上平均提速 3.45%。

ML 编译器依赖图级变换提升运行时性能,但局部重写可能改变后续数据布局、并行化、细粒度调度和内存管理等变换的合法性与收益,使编译器长期依赖易过时的手工启发式。本文提出用等价饱和替代这些局部启发式,并以考虑下游变换的全局性能模型评估变换收益,从而发现更有效的图优化组合。作者针对真实 ML 计算图和现代硬件,研究融合与布局优化中的代价建模方法,并解决宽范围代数优化带来的可扩展性问题。他们在 XLA 中设计并实现了 C++/Rust 的等价饱和 pass。在多个 CPU 和 GPU 平台基准上,该方法相对 XLA 优化流程平均提速 3.45%,NasRNN 在 CPU 上最高提速 56.26%。

问题
ML 编译器的局部图重写会影响下游数据布局、融合、并行化与内存管理等优化,手工启发式难以适应新硬件和模型架构。
方法
用等价饱和替代局部启发式,结合面向下游变换的全局性能模型,并为 XLA 实现处理融合、布局与可扩展性挑战的 C++/Rust pass。
评估
在多种 CPU 和 GPU 平台的基准套件上与 XLA 优化流程对比,报告平均与最大加速比。
原文摘要(Abstract)

Machine learning (ML) compilers rely on graph-level transformations to enhance the runtime performance of ML models. However, performing local transformations on individual operations can create effects far beyond the location of the rewrite. In particular, a local rewrite can change the profitability or legality of hard-to-predict downstream transformations, particularly regarding data layout, parallelization, fine-grained scheduling, and memory management. As a result, program transformations are often driven by manually-tuned compiler heuristics, which are quickly rendered obsolete by new hardware and model architectures. Instead of hand-written local heuristics, we propose the use of equality saturation. We replace such heuristics with a more robust global performance model, which accounts for downstream transformations. Equality saturation addresses the challenge of local optimizations inadvertently constraining or negating the benefits of subsequent transformations, thereby providing a solution that is inherently adaptable to newer workloads. While this approach still requires a global performance model to evaluate the profitability of transformations, it holds significant promise for increased automation and adaptability. This paper addresses challenges in applying equality saturation on real-world ML compute graphs and state-of-the-art hardware. By doing so, we present an improved method for discovering effective compositions of graph optimizations. We study different cost modeling approaches to deal with fusion and layout optimization, and tackle scalability issues that arise from considering a very wide range of algebraic optimizations. We design an equality saturation pass for the XLA compiler, with an implementation in C++ and Rust. We demonstrate an average speedup of 3.45% over XLA’s optimization flow across our benchmark suite on various CPU and GPU platforms, with a maximum speedup of 56.26% for NasRNN on CPU.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2997,
  title = {Mind the Abstraction Gap: Bringing Equality Saturation to Real-World ML Compilers},
  author = {Arya Vohra and Leo Seojun Lee and Jakub Bachurski and Oleksandr Zinenko and Phitchaya Mangpo Phothilimthana and Albert Cohen and William S. Moses},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763062}
}