cuDNN Linear Attention: Optimized Mamba-2, GDN, GDP, KDA, and GDN-2 Kernels for NVIDIA GPUs
Linear attention replaces the softmax attention of Transformers with a fixed-size recurrent state, so that the runtime of prefill grows linearly rather than quadratically with the sequence length and the runtime of every decode step is constant in it. Many recent models have adopted a hybrid architecture where some layers swap dense attention for linear attention variants. cuDNN now ships optimized fused kernels for five linear attention variants, Mamba-2, Gated DeltaNet (GDN), Gated DeltaProduct (GDP), Kimi Delta Attention (KDA), and Gated DeltaNet-2 (GDN-2), on Blackwell (SM100, SM103), covering the training forward and backward passes. All of the kernels are open source and ship in cuDNN at https://github.com/NVIDIA/cudnn-frontend. In this paper, we walk through the optimizations that produce speedups over the state-of-the-art baselines. We start the kernel design from a single persistent kernel per pass. Then, in low $B \cdot H$ settings, where a grid of one CTA per (batch, head) pair does not cover the SMs, we use intra-card context parallelism (intra-card CP) or a split of the value dimension (split-$d_v$), both introduced by prior work in FlashQLA. We also fuse the other…
- arXiv
- 2611.36424
- Authors
- Joshua Park, Jingze Cui, Sherry Jiang, Mengyu Guo, Anerudhan Gopal and 4 more
- Categories
- cs.CL