paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Compiler Support for Sparse Tensor Convolutions

面向稀疏张量卷积的编译器支持
OOPSLA 8(OOPSLA2)2024匹配度 3/10 · 论文属于机器学习与程序语言交叉中的稀疏张量编译器与代码生成,涉及 MLIR 等工程实现,但与用户核心关注的静态分析、Agentic 程序、LLM 与形式化验证、浮点程序分析及贝叶斯程序分析均无直接关系。引用 6 inbox
Peiming Liu, Alexander J Root, Anlun Xu, Yinying Li, Fredrik Kjolstad, Aart J.C. Bik
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出将仿射下标表达式逐步重写为利用稀疏性的循环的编译方法,为稀疏卷积等生成渐近高效代码。

现有稀疏张量代数编译器主要处理简单下标表达式,难以为含仿射下标表达式的张量表达式生成渐近高效代码,因而无法很好支持稀疏卷积和池化等机器学习与图形学计算。本文提出一种编译方法,将复合下标表达式逐步重写为简单下标表达式,并生成利用输入稀疏张量稀疏模式的循环;由此生成内核的时间复杂度由存储元素数量而非张量形状界定。该方法可无缝集成到现有框架,并兼容 MLIR 稀疏编译器对不同稀疏格式组合的处理。实验表明,99.9% 稀疏度下较最先进的编译器方法获得 19.5 倍加速,约 80% 稀疏度时生成的稀疏内核开始优于稠密卷积实现。

问题
现有稀疏张量代数编译器难以对含仿射下标表达式的张量表达式生成渐近高效代码,因而无法很好支持稀疏卷积和池化等计算。
方法
将复合下标表达式逐步重写为简单下标表达式,并生成利用输入稀疏张量稀疏模式的循环,使内核复杂度由存储元素数而非张量形状界住,并集成到 MLIR 稀疏编译器中。
评估
在 MLIR 稀疏编译器上实现并开展实验,99.9% 稀疏度下较最先进的编译器方法快 19.5 倍,且在约 80% 稀疏度时开始优于稠密卷积实现。
原文摘要(Abstract)

This paper extends prior work on sparse tensor algebra compilers to generate asymptotically efficient code for tensor expressions with affine subscript expressions. Our technique enables compiler support for a wide range of sparse computations, including sparse convolutions and pooling that are widely used in ML and graphics applications. We propose an approach that gradually rewrites compound subscript expressions to simple subscript expressions with loops that exploit the sparsity pattern of the input sparse tensors. As a result, the time complexity of the generated kernels is bounded by the number of stored elements and not by the shape of the tensors. Our approach seamlessly integrates into existing frameworks and is compatible with recent advances in compilers for sparse computations, including the flexibility to efficiently handle arbitrary combinations of different sparse tensor formats. The implementation of our algorithm is open source and upstreamed to the MLIR sparse compiler. Experimental results show that our method achieves 19.5x speedup when compared with the state-of-the-art compiler-based method at 99.9% sparsity. The generated sparse kernels start to outperform dense convolution implementations at about 80% sparsity

链接与引用

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

BibTeX
@article{LiuRXLKB24,
  title = {Compiler Support for Sparse Tensor Convolutions},
  author = {Peiming Liu and Alexander J Root and Anlun Xu and Yinying Li and Fredrik Kjolstad and Aart J.C. Bik},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689721}
}