TL;DR
Linear attention lets language models process million-token sequences without drowning in quadratic compute, but its step-by-step recurrence clashes with how modern GPUs actually want to run. NVIDIA engineers have built open-source, fully fused kernels in cuDNN for five popular linear attention architectures on Blackwell GPUs, eliminating slow memory round-trips and squeezing up to $15.9\times$ more speed out of the hardware. If you train or serve hybrid Mamba or DeltaNet models, your bottleneck just got a serious upgrade.
What Problem Does This Paper Address?
Standard Transformer attention compares every token to every other token. That means prefill compute scales quadratically with sequence length, and the key-value (KV) cache balloons endlessly during decoding.
Linear attention fixes this by compressing history into a fixed-size recurrent state—like a scratchpad of constant dimensions. To stop that scratchpad from turning into an unreadable blur of overlapping notes, modern variants add two mechanisms: data-dependent decay (shrinking old memories) and the delta rule (selectively erasing and overwriting specific entries). Today’s frontier models (like Nemotron 3, Qwen3-Next, and Kimi) blend these linear layers with traditional softmax attention.
Here is the catch: GPUs hate strictly serial recurrences, which starve massive Tensor Cores of parallel work. The standard workaround is chunking—splitting sequences into blocks of $C$ tokens to do dense matrix math inside each chunk while passing the state serially between chunks. However, existing implementations (like FLA, FlashQLA, and FlashKDA) split this chunked math across multiple separate GPU kernels. Every handoff writes intermediates out to global memory (DRAM) and reads them back in. Worse, when you fuse everything into one kernel, each (batch, head) pair runs sequentially on a single Streaming Multiprocessor (SM). If batch * heads is small, most of your expensive GPU sits completely idle.
Methods
The authors introduce open-source forward and backward training kernels in cuDNN for five variants—Mamba-2, Gated DeltaNet (GDN), Gated DeltaProduct (GDP), Kimi Delta Attention (KDA), and Gated DeltaNet-2 (GDN-2)—tailored for NVIDIA Blackwell GPUs.
- Total Kernel Fusion: Unlike prior work that leaves gate scans or matrix inversions as separate launches, the authors fuse the entire pass into a single warp-specialized persistent kernel (plus peripheral L2 normalization and gate activations). The recurrent state lives in Blackwell’s fast Tensor Memory (TMEM) in
fp32for the whole sequence. - Feeding Blackwell’s Tensor Cores: Blackwell’s
tcgen05.mmainstructions require a matrix row dimension of $M = 128$ for full utilization, yet numerical and register limits force chunk sizes of $C = 64$ (GDN/GDP) or $C = 16$ (KDA/GDN-2). The authors use swap-AB (computing transposed products so the head dimension $d_v = 128$ sits on the $M$ axis) and operand stacking (fusing $\mathbf{K}\mathbf{K}^\mathsf{T}$ and $\mathbf{Q}\mathbf{K}^\mathsf{T}$ into one $M = 128$ instruction).
- Dynamic GPU-Filling Strategies: Depending on $P = \lfloor \text{\#SMs} / (B \cdot H) \rfloor$—how many spare SMs are available per sequence—the plan adapts:
- $P \ge 3$ (Intra-card Context Parallelism): Exploits the fact that state updates are affine ($\mathbf{S}_b = \mathbf{M}\mathbf{S}_a + \mathbf{H}$). It cuts sequences into independent segments, summarizes them in parallel, chains the boundary states in
fp32, and runs the main pass. - $P = 2$ (Split-$d_v$): Splits the value head dimension across two thread blocks.
- $P = 1$ (Split-K): Cuts sequences only where cumulative decay gates shrink below $e^{-10}$, allowing segments to warm up from zero state without chaining.
- $P < 1$ (Tail Method): Runs full GPU waves normally and slices up leftover partial-wave tiles Stream-K style to prevent wave quantization.
Datasets
Not discussed in the paper. Because this is a low-level systems and kernel-engineering paper, evaluations are conducted on synthetic tensor shapes rather than training or benchmark datasets. Specifically, the authors benchmark bf16 inputs across sweeps of sequence length and batch size, setting all decay gates to $1$—the mathematical worst case for data-dependent skipping methods.
Key Insights and Ideas
- Pure Neumann series can blow up in 16-bit precision: Inverting the $16 \times 16$ chunk matrix in KDA/GDN-2 via a doubling Neumann series (standard in FlashKDA) causes intermediate matrix powers to grow combinatorially—reaching thousands—before canceling out to values $\le 1$. In
bf16, rounding errors ruin that cancellation and cause the recurrent state to explode. Combining a tiny $4 \times 4$ Neumann series with recursive blockwise corrections fixes the numerics and uses fewer instructions (10 vs. 12). - Diagonal decay ratios need special protection in the backward pass: For per-channel decay variants, scaling queries by $\Gamma$ and keys by $\Gamma^{-1}$ cancels out nicely along the chunk diagonal in exact math, but multiplying huge $\Gamma^{-1}$ values in 16-bit Tensor Cores during gradient computation destroys precision. Separating the 16 diagonal entries into an
fp32shared-memory ring completely sidesteps this round-trip rounding error. - Decoupling FlashQLA’s parallelism: Prior work bundled exact state-chaining and gate-driven skipping together. Realizing that exact chaining has a $2\times$ compute overhead (only worth it when $\ge 3$ SMs are free per head) allowed the authors to cleanly separate them into distinct regimes.
Key Results
Tested on NVIDIA GB200 GPUs across both low-occupancy ($B=1, H=16$) and saturated ($B=4$) regimes:
- Delta-rule variants (GDN, GDP, KDA, GDN-2): Run up to $7.1\times$ faster in the forward pass and $8.1\times$ faster in the backward pass compared to FLA’s reference Triton kernels.
- Against specialized baselines: GDN achieves up to $3.2\times$ forward and $2.0\times$ backward speedups over FlashQLA (TileLang). KDA runs up to $6.1\times$ faster than FlashKDA (CUTLASS).
- Mamba-2: Runs up to $15.9\times$ faster than FLA and $4.2\times$ faster than
mamba_ssmin the forward pass, and up to $6.9\times$ and $5.5\times$ faster in the backward pass.
Limitations and Future Work
- Small chunk sizes for per-channel decay: KDA and GDN-2 are currently locked to $C = 16$ to prevent $\Gamma$ and $\Gamma^{-1}$ from underflowing or overflowing. Future work could adopt FLA’s "anchor" trick—measuring decay relative to the middle of a block rather than the start—to push chunks to $C = 32+$ for higher Tensor Core saturation and lower memory traffic.
- Split-K doesn't work for KDA/GDN-2: Because per-channel gates allow individual channels to remember over long horizons, the worst-case channel rarely decays fast enough to justify a zero-state cut.
- Hardware and precision horizons: All current MMAs use 16-bit operands; future iterations could explore lower-precision formats (like FP8), overlap idle SMs with surrounding projection GEMMs, and leverage upcoming Rubin GPUs' expanded shared memory to hold all intermediates on-chip.
Summary updated