paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SPLAT: A Framework for Optimised GPU Code-Generation for SParse reguLar ATtention

SPLAT:面向稀疏规则注意力的优化 GPU 代码生成框架
OOPSLA 9(OOPSLA1)2025匹配度 2/10 · 论文属于面向 ML 工作负载的 GPU 代码生成/编译优化,与用户关注的静态分析在 ML/Agent 系统中的应用、LLM 改进静态分析、浮点/贝叶斯程序分析等核心方向无直接交集;仅在“PL+AI 交叉”这一宽泛层面有微弱关联。引用 3 inbox
Ahan Gupta, Yueming Yuan, Devansh Jain, Yuhao Ge, David Aponte, Yanqi Zhou, Charith Mendis
crossref: 2026-09-10

AI 速览

一句话:提出 ACSR 稀疏格式与 SPLAT 代码生成框架,为多样稀疏注意力模式在 GPU 上生成高性能实现。

多头自注意力(MHSA)在 NLP 与视觉任务上表现优异,但其对序列长度的二次依赖成为推理速度瓶颈。稀疏 MHSA 通过只计算部分注意力来缓解该问题,然而现有稀疏库与编译器受底层稀疏格式限制,难以兼顾通用性与性能:专用格式覆盖面窄,通用格式在稀疏 MHSA 常见的中等稀疏度(10%–50% 非零元)矩阵上元数据开销过大。本文提出仿射压缩稀疏行(affine-compressed-sparse-row, ACSR)格式及配套代码生成方案 SPLAT。其核心观察是常见稀疏 MHSA 模式具有独特的规则几何性质,可在即时(just-in-time)分析中提取,从而暴露新的优化与分块策略,SPLAT 据此为多样稀疏模式生成高性能 GPU 实现。在 A100 单精度下,SPLAT 为多种稀疏 MHSA 模型生成代码,相对 Triton 手写 kernel 最高加速 2.05 倍,相对 TVM 最高加速 4.05 倍。

问题
稀疏 MHSA 具有多种实现模式,但现有稀疏格式要么过于专用、覆盖面窄,要么过于通用、在中等稀疏度下元数据开销高,导致缺乏兼顾通用性与高性能的 GPU 实现。
方法
观察到常见稀疏 MHSA 模式具有可即时分析的规则几何性质,据此设计 ACSR 稀疏格式,并实现 SPLAT 代码生成方案,利用这些性质应用新的优化与分块策略为不同模式生成 GPU 代码。
评估
在 A100 GPU 单精度下,用 SPLAT 为多种稀疏 MHSA 模型生成代码,并与 Triton 与 TVM 手写 kernel 对比,分别取得最高 2.05 倍与 4.05 倍加速。
原文摘要(Abstract)

Multi-head-self-attention (MHSA) mechanisms achieve state-of-the-art (SOTA) performance across natural language processing and vision tasks. However, their quadratic dependence on sequence lengths has bottlenecked inference speeds. To circumvent this bottleneck, researchers have proposed various sparse-MHSA models, where a subset of full attention is computed. Despite their promise, current sparse libraries and compilers do not support high-performance implementations for diverse sparse-MHSA patterns due to the underlying sparse formats they operate on. These formats are either too specialised, failing to cover a wide-range of sparse patterns, or too general, incurring high metadata overhead when computing on the moderately sparse (10-50% non-zeros) matrices present in sparse-MHSA. We bridge this gap, achieving both generality and performance, by proposing a novel sparse format: affine-compressed-sparse-row (ACSR) and supporting code-generation scheme, SPLAT, that generates highperformance implementations for diverse sparse-MHSA patterns on GPUs. Core to our proposed format and code generation algorithm is the observation that common sparse-MHSA patterns have uniquely regular geometric properties. These properties, which can be analyzed just-in-time, expose novel optimizations and tiling strategies that SPLAT exploits to generate high-performance implementations for diverse patterns. To demonstrate SPLAT’s efficacy, we use it to generate code for various sparse-MHSA models, achieving speedups of up-to 2.05x and 4.05x over hand-written kernels written in Triton and TVM respectively on A100 GPUs in single-precision.

链接与引用

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

BibTeX
@article{paperbot3192,
  title = {SPLAT: A Framework for Optimised GPU Code-Generation for SParse reguLar ATtention},
  author = {Ahan Gupta and Yueming Yuan and Devansh Jain and Yuhao Ge and David Aponte and Yanqi Zhou and Charith Mendis},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA1},
  year = {2025},
  doi = {10.1145/3720503}
}