paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Compiling Strassen-like Matrix Multiplication Algorithms to Fast CUDA Kernels

将 Strassen 类矩阵乘法算法编译为快速 CUDA 内核
PLDI 10(PLDI)2026匹配度 2/10 · 该论文属于面向 GPU 的领域特定编译与高性能代码生成,目标是优化 Strassen 类矩阵乘法内核,与用户关注的静态分析/形式化验证、Agentic/LLM 程序分析、浮点程序分析或贝叶斯程序分析没有直接交集。虽然涉及浮点矩阵乘法与 LLM 推理加速,但重点不是程序分析或 LLM 作为分析工具,因此匹配度较低。引用 0 inbox
Abhinav Jangda
crossref: 2026-09-10

AI 速览

一句话:提出 SubCuber,一个面向 Strassen 类矩阵乘法的领域特定编译器,生成高效 CUDA 内核。

矩阵乘法是科学计算与机器学习的核心操作,但 Strassen 等亚三次算法因递归结构难以在 GPU 上高效实现,现有方法常导致过多内存访问或计算与访存重叠不足。SubCuber 构建 Strassen 类算法的依赖图,选择高效的内核调度,并针对递归层级、矩阵尺寸和 GPU 应用融合策略;它包含两个旨在最小化输入加载并重叠计算与访存的新型 CUDA 内核。在 NVIDIA A100 和 H200 上,对单精度与半精度矩阵乘法的评估表明,SubCuber 生成的代码优于 Cutlass、cuBLAS 及现有 Strassen 实现:单层递归最多快 12%,两层最多快 22%,并使 Phi-4 14B、Qwen-3 32B、LLaMA-3 405B 等语言模型推理中的矩阵乘法最多快 16%。

问题
Strassen 类亚三次矩阵乘法理论更快,但递归结构导致 GPU 内核内存访问过多、访存与计算重叠不足,性能低于理论预期。
方法
SubCuber 是领域特定编译器,通过构建依赖图、选择内核调度并应用按递归层级、矩阵尺寸和 GPU 定制的融合策略,生成低输入加载且重叠访存的 CUDA 内核。
评估
在 NVIDIA A100 和 H200 上对单精度和半精度矩阵乘法评估,与 Cutlass、cuBLAS 及已有 Strassen 方法比较,并测试 Phi-4 14B、Qwen-3 32B、LLaMA-3 405B 推理中的加速效果。
原文摘要(Abstract)

Matrix multiplication is a key operation in scientific computing and machine learning, with GPU libraries like NVIDIA Cutlass and cuBLAS providing optimized implementations of the three nested loop cubic algorithm. While sub-cubic algorithms, like the Strassen algorithm and its variants, are theoretically faster, their recursive structure makes it challenging to implement efficient GPU kernels. This is why existing approaches either do excessive memory accesses or do not effectively overlap memory accesses and computations, leading to sub-optimal performance compared to theoretical expectations. This paper presents SubCuber, a domain-specific compiler that generates efficient CUDA kernels for Strassen-like matrix multiplication algorithms. SubCuber contains two novel CUDA kernels that are designed to minimize memory input loads and effectively overlap computation with memory loads. To generate efficient code, SubCuber constructs the dependency graph of a Strassen-like algorithm, selects efficient kernel schedules, and applies fusion strategies tailored to a recursion level, matrix sizes, and GPU. Our evaluation on NVIDIA A100 and H200 GPUs shows that for both single- and half-precision floating point matrix multiplications, SubCuber’s generated code outperforms state-of-the-art CUDA implementations for matrix multiplication and the Strassen algorithm. SubCuber is up to 12% faster for one recursion level and 22% for two recursion levels over Cutlass and cuBLAS, while existing approaches are only up to 8% faster for one-level and 16% faster for two-levels. Furthermore, SubCuber makes matrix multiplication in language models like Phi-4 14B, Qwen-3 32B, and LLaMA-3 405b, up to 16% faster for inference scenarios.

链接与引用

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

BibTeX
@article{Jangda26,
  title = {Compiling Strassen-like Matrix Multiplication Algorithms to Fast CUDA Kernels},
  author = {Abhinav Jangda},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {PLDI},
  year = {2026},
  doi = {10.1145/3808267}
}