paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Compiling Recurrences over Dense and Sparse Arrays

编译稠密与稀疏数组上的递推方程
OOPSLA 8(OOPSLA1)2024匹配度 2/10 · 论文属于编译器/DSL 代码生成方向,核心是递推方程在稠密/稀疏数组上的调度、可解性与代码生成,与用户画像中 PL↔AI、静态分析、浮点程序分析、贝叶斯程序分析及 LLM/Agent 交叉等方向基本无关;仅在“程序分析与编译”大方向上有非常弱的关联。引用 1 inbox
Shiv Sundram, Muhammad Usman Tariq, Fredrik Kjolstad
crossref: 2026-09-10

AI 速览

一句话:提出一个将递推方程组按数据结构与调度编译为原生代码的框架,并判定其可解性。

本文提出一个将递推方程(recurrence equations)编译为原生代码的框架。用户以规范形式给出递推方程组、存储输入输出的数据结构类型以及用于优化的调度命令,编译器据此把规范 lowering 为尊重递推依赖关系的原生代码。该编译器既能面向稀疏数据结构也能面向稠密数据结构生成代码,并能判定在给定调度原语下递推系统是否可解。作者在来自稠密与稀疏矩阵求解、动态规划、图问题以及稀疏张量代数等多个领域的递推上评估了生成代码的正确性与性能。实验表明,生成代码的性能可与库中手工优化实现相竞争;而与只针对特定递推、特定数据结构与特定优化的手写库不同,本系统能从递推、数据格式与调度自动生成实现,因而具有更强的通用性。

问题
手写库实现通常只针对特定递推、特定数据结构与特定优化,缺乏通用性;如何从递推方程、数据格式与调度自动生成高效且正确的代码。
方法
用户指定递推方程组、输入输出数据结构类型与调度命令,编译器将规范 lowering 为尊重递推依赖的原生代码,支持稀疏与稠密数据结构,并判定递推系统在给定调度原语下是否可解。
评估
在稠密与稀疏矩阵求解、动态规划、图问题与稀疏张量代数等多类递推上评估生成代码的正确性与性能,结果显示其性能可与库中手工优化实现相竞争,同时通用性更强。
原文摘要(Abstract)

We present a framework for compiling recurrence equations into native code. In our framework, users specify a system of recurrences, the types of data structures that store inputs and outputs, and scheduling commands for optimization. Our compiler then lowers these specifications into native code that respects the dependencies in the recurrence equations. Our compiler can generate code over both sparse and dense data structures, and determines if the recurrence system is solvable with the provided scheduling primitives. We evaluate the performance and correctness of the generated code on several recurrences, from domains as diverse as dense and sparse matrix solvers, dynamic programming, graph problems, and sparse tensor algebra. We demonstrate that the generated code has competitive performance to hand-optimized implementations in libraries. However, these handwritten libraries target specific recurrences, specific data structures, and specific optimizations. Our system, on the other hand, automatically generates implementations from recurrences, data formats, and schedules, giving our system more generality than library approaches.

链接与引用

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

BibTeX
@article{paperbot2531,
  title = {Compiling Recurrences over Dense and Sparse Arrays},
  author = {Shiv Sundram and Muhammad Usman Tariq and Fredrik Kjolstad},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA1},
  year = {2024},
  doi = {10.1145/3649820}
}