paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Compilation of dynamic sparse tensor algebra

动态稀疏张量代数的编译
OOPSLA 6(OOPSLA2)2022匹配度 2/10 · 该论文聚焦于动态稀疏张量代数的编译与代码生成,属于编译器/DSL方向,但与用户核心关注的 PL 与 AI/LLM/Agent 交叉、静态分析、浮点程序分析或贝叶斯程序分析均无明显关联。尽管摘要提到控制流分析作为应用场景之一,但论文本身不涉及静态分析技术或 LLM/Agent。引用 8 inbox
Stephen Chou, Saman Amarasinghe
crossref: 2026-09-10

AI 速览

一句话:提出一种编译技术,将动态稀疏张量代数运算编译为适配多种指针式动态稀疏格式的高效代码。

许多应用需要计算随程序执行而演化的稀疏数据,这类数据可表示为动态稀疏张量,并适合用块链表、二叉搜索树、B树、C树等基于指针的动态格式存储,以支持快速原地修改。然而,不同动态格式各有优劣,且针对不同格式实现张量运算的代码差异大,正确实现与优化都很困难。本文提出一种用于精确指定递归、指针式数据结构的语言,能够表达上述多种动态数据结构;进而展示编译器如何根据这些高层数据结构规格,生成高效访问和计算动态稀疏张量的代码。评估表明,该技术生成的动态稀疏张量代数内核性能与 PAM、Aspen、STINGER、Terrace 等先进库和框架相当甚至更好,同时支持比 Aspen、STINGER、Terrace 更广的张量代数操作,例如同时计算静态与动态稀疏张量,并在相同操作上显著优于 PAM。

问题
动态稀疏张量常存于多种指针式格式中,不同格式与不同张量运算对应的代码差异巨大,既难以正确实现,也难以优化。
方法
提出一种精确描述递归、基于指针的数据结构的语言,可表达块链表、二叉搜索树、B树、C树等;编译器根据高层数据结构规格生成高效访问和计算动态稀疏张量的代码。
评估
生成动态稀疏张量代数内核,并与 PAM、Aspen、STINGER、Terrace 等系统比较;结果显示性能相当或更好,支持更广操作,且在相同操作上显著优于 PAM。
原文摘要(Abstract)

Many applications, from social network graph analytics to control flow analysis, compute on sparse data that evolves over the course of program execution. Such data can be represented as dynamic sparse tensors and efficiently stored in formats (data layouts) that utilize pointer-based data structures like block linked lists, binary search trees, B-trees, and C-trees among others. These specialized formats support fast in-place modification and are thus better suited than traditional, array-based data structures like CSR for storing dynamic sparse tensors. However, different dynamic sparse tensor formats have distinct benefits and drawbacks, and performing different computations on tensors that are stored in different formats can require vastly dissimilar code that are not straightforward to correctly implement and optimize. This paper shows how a compiler can generate efficient code to compute tensor algebra operations on dynamic sparse tensors that may be stored in a wide range of disparate formats. We propose a language for precisely specifying recursive, pointer-based data structures, and we show how this language can express many different dynamic data structures, including all the ones named above as well as many more. We then describe how, given high-level specifications of such dynamic data structures, a compiler can emit code to efficiently access and compute on dynamic sparse tensors that are stored in the aforementioned data structures. We evaluate our technique and find it generates efficient dynamic sparse tensor algebra kernels that have performance comparable to, if not better than, state-of-the-art libraries and frameworks such as PAM, Aspen, STINGER, and Terrace. At the same time, our technique supports a wider range of tensor algebra operations---such as those that simultaneously compute with static and dynamic sparse tensors---than Aspen, STINGER, and Terrace, while also achieving significantly better performance than PAM for those same operations.

链接与引用

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

BibTeX
@article{paperbot1415,
  title = {Compilation of dynamic sparse tensor algebra},
  author = {Stephen Chou and Saman Amarasinghe},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {OOPSLA2},
  year = {2022},
  doi = {10.1145/3563338}
}