paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SpEQ: Translation of Sparse Codes using Equivalences

SpEQ:利用等价关系翻译稀疏代码
PLDI 8(PLDI)2024匹配度 2/10 · 该论文属于编译与程序分析中的稀疏代码翻译与等价性检测,使用 LLVM/Z3/egglog 将稀疏线性代数翻译为高性能库调用,但不涉及 LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析,与用户当前核心研究方向仅有很弱的 PL/静态分析关联。引用 6 inbox
Avery Laird, Bangtian Liu, Nikolaj Bjørner, Maryam Mehri Dehnavi
crossref: 2026-09-10

AI 速览

一句话:SpEQ 识别稀疏代码语义与存储前置条件,并将其正确翻译为高性能库或 DSL 调用。

稀疏线性代数代码常隐含数据存储前置条件,直接翻译到高性能库或 DSL 容易产生错误。SpEQ 通过等价关系识别高层计算、存储细节及相关前置条件,并用运行时检查守护翻译,确保所需条件满足。其实现基于 LLVM、Z3 与 egglog,可将稀疏代码正确翻译到 NVIDIA cuSPARSE、Intel MKL 和 OpenMP。在十个多样基准上对比两个先进翻译工具,SpEQ 在 OMP、MKL、cuSPARSE 后端分别取得 3.25×、5.09×、8.04× 的几何平均加速,并且是唯一能保证稀疏计算正确翻译的工具。

问题
稀疏代码中的隐式存储前置条件会阻碍直接翻译,现有工具难以在保证正确性的同时映射到高性能库或 DSL。
方法
SpEQ 利用等价关系检测高层计算、存储细节与前置条件,并通过运行时检查保护翻译过程;其实现结合 LLVM、Z3 和 egglog。
评估
在十个多样基准上与两个先进翻译工具比较,SpEQ 在 OpenMP、MKL、cuSPARSE 后端分别获得 3.25×、5.09×、8.04× 几何平均加速,并保证翻译正确性。
原文摘要(Abstract)

We present S p EQ, a quick and correct strategy for detecting semantics in sparse codes and enabling automatic translation to high-performance library calls or domain-specific languages (DSLs). When sparse linear algebra codes contain implicit preconditions about how data is stored that hamper direct translation, S p EQ identifies the high-level computation along with storage details and related preconditions. A run-time check guards the translation and ensures that required preconditions are met. We implement S p EQ using the LLVM framework, the Z3 solver, and egglog library and correctly translate sparse linear algebra codes into two high-performance libraries, NVIDIA cuSPARSE and Intel MKL, and OpenMP (OMP). We evaluate S p EQ on ten diverse benchmarks against two state-of-the-art translation tools. S p EQ achieves geometric mean speedups of 3.25 × , 5.09 × , and 8.04 × on OpenMP, MKL, and cuSPARSE backends, respectively. S p EQ is the only tool that can guarantee the correct translation of sparse computations.

链接与引用

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

BibTeX
@article{paperbot2516,
  title = {SpEQ: Translation of Sparse Codes using Equivalences},
  author = {Avery Laird and Bangtian Liu and Nikolaj Bjørner and Maryam Mehri Dehnavi},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656445}
}