Fast Inference with Kronecker-Sparse Matrices
Antoine Gonon, Léon Zheng, Pascal Carrivain, Quoc-Tung Le
摘要
Kronecker-sparse (KS) matrices-whose supports are Kronecker products of identity and all-ones blocks-underpin the structure of Butterfly and Monarch matrices and offer the promise of more efficient models. However, existing GPU kernels for KS matrix multiplication suffer from high data movement costs, with up to 50 % of time spent on memory-bound tensor permutations. We propose a fused, output-stationary GPU kernel that eliminates these overheads, reducing global memory traffic threefold. Across 600 KS patterns, our kernel achieves in FP32 a median speedup of ×1.4 and lowers energy consumption by 15 %. A simple heuristic based on KS pattern parameters predicts when our method outperforms existing ones. We release all code 1 at github.com/PascalCarrivain/ksmm, including a PyTorch-compatible KSLinear layer, and demonstrate in FP32 end-to-end latency reductions of up to 22 % in ViT-S/16 and 16 % in GPT-2 medium.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- Scaling Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Models
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 引用了 Monarch: Expressive Structured Matrices for Efficient and Accurate Training
- Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Models 引用了 Scaling Vision Transformers
- Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Models 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Monarch: Expressive Structured Matrices for Efficient and Accurate Training 引用了 Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Models
- Monarch: Expressive Structured Matrices for Efficient and Accurate Training 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
它引用的 Paper10
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra 等NeurIPS 2022 · 5,493 次引用
- Scaling Vision TransformersXiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, Lucas BeyerCVPR 2022 · 767 次引用
- Monarch: Expressive Structured Matrices for Efficient and Accurate TrainingTri Dao, Beidi Chen, Nimit Sharad Sohoni, Arjun D. Desai 等ICML 2022 · 125 次引用
- Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network ModelsBeidi Chen, Tri Dao, Kaizhao Liang, Jiaming Yang 等ICLR 2022 · 94 次引用
相关 Paper
- Compute Better Spent: Replacing Dense Layers with Structured MatricesShikai Qiu, Andres Potapczynski, Marc Anton Finzi, Micah Goldblum 等ICML 2024 · 26 次引用
- Monarch Mixer: A Simple Sub-Quadratic GEMM-Based ArchitectureDaniel Y. Fu, Simran Arora, Jessica Grogan, Isys Johnson 等NeurIPS 2023 · 80 次引用
- Accelerating Block Low-Rank Foundation Model Inference on Memory-Constrained GPUsPierre Abillama, Changwoo Lee, Juechu Dong, David T. Blaauw 等HPDC 2026
- Fast Kronecker Matrix-Matrix Multiplication on GPUsAbhinav Jangda, Mohit YadavPPoPP 2024 · 2 次引用
- Searching for Efficient Linear Layers over a Continuous Space of Structured MatricesAndres Potapczynski, Shikai Qiu, Marc Finzi, Christopher Ferri 等NeurIPS 2024 · 11 次引用
