Accelerating Sparse Transformer Inference on GPU

Wenhao Dai, Haodong Deng, Mengfei Rong, Xinyu Yang, Hongyu Liu +4 more
6/6/2025
cs.LG

No official code found. Best implementation: HeyDavid633/PPoPP26-pap161-AE (1 star, MIT, last commit 2026-02-27).

Abstract

Large language models (LLMs) are popular around the world due to their powerful understanding capabilities. As the core component of LLMs, accelerating Transformer through parallelization has gradually become a hot research topic. Mask layers introduce sparsity into Transformer to reduce calculations. However, previous works rarely focus on the performance optimization of sparse Transformer. In addition, current static operator fusion schemes fail to adapt to diverse application scenarios. To address the above problems, we propose STOF, a framework that incorporates optimizations for Sparse Transformer that enables flexible masking and Operator Fusion on GPU. For multi-head attention (MHA) structure, STOF maps the computation to row-wise or blockwise kernels with unique storage formats according to analytical modeling. For downstream operators, STOF maps the fusion scheme to compilation templates and determines the optimal running configuration through two-stage searching. The experimental results show that compared to the stateof-the-art work, STOF achieves maximum speedups of 1.6x in MHA computation and 1.4x in end-to-end inference.

View on arXivView PDF

Code Implementations(1)

MIT

The AE file for PPoPP26 Paper161 "Accelerating Sparse Transformer Inference on GPU"

10C, C++Nov 24, 20257 months agoMIT

Similar Papers

Cite this paper

@article{dai2025accelerating,
  title  = {Accelerating Sparse Transformer Inference on GPU},
  author = {Wenhao Dai and Haodong Deng and Mengfei Rong and Xinyu Yang and Hongyu Liu and Fangxin Liu and Hailong Yang and Qianwen Cao and Qingxiao Sun},
  year   = {2025},
  eprint = {2506.06095},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.06095v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.06095.svg)](https://codeofpaper.com/paper/2506.06095)

Discussion