NeurIPS 2026QuestionsPapersAreasAboutMarkdown

GPU Hierarchy Meets Structured Matrices: Fast Algorithms for State-Space Models

Berlin Chen, Caitlin Wang, Aakash Sunil Lahoti, Kevin Li, Jay Shah, Jack Carlisle, Timmy Liu, Mengyu Guo, Zico Kolter, Albert Gu, Tri Dao

NeurIPS page · OpenReview · Open on the map

Category: Efficient LLM Inference & Training › Efficient Sequence Modeling · Type: new method · Keywords: linear-time sequence models, state space models, GPU optimization, segsum, CuTe-DSL, warp specialization

Areas: Long Context › Long-context mechanisms › Attention optimizations; Model Architectures & Sequence Modeling › Language Model Architectures › Linearized Transformers

Summary

The paper introduces a split-sequence algorithm and a hierarchy-aware decay-mask computation that together make linear-time sequence models faster than FlashAttention for typical prefill lengths.

Explained to a 5-year-old

We want computers to read long texts quickly. Right now, a special kind of math called attention is fast, but another kind called state space models is supposed to be even faster. However, the fast version sometimes makes mistakes, and the slow version is too slow. The researchers made two new tricks: one splits the work into pieces so less data moves around, and the other computes a tricky part of the math in a stable way that is also fast. With these tricks, the new method beats the fast attention method for typical text lengths, making reading and writing long texts quicker on regular computers.

Explained to a 5-year-old, longer

Computers need to process long pieces of text, like books or conversations, quickly. There are two main ways to do this: attention, which is already fast, and state space models, which are designed to be even faster. The problem is that the fast state space models are not as fast as attention in real-world situations, and the part of the math that makes them work can become unstable, causing errors. The researchers looked at this problem and came up with two new ideas. First, they split the work into smaller chunks so that less information has to travel between parts of the computer, which reduces delays. Second, they found a way to compute a tricky mathematical mask that is both stable (no errors) and fast, by breaking it into simple pieces and using fast operations inside the computer’s hardware. They built these ideas into a new software library that uses advanced GPU features like warp specialization and asynchronous memory copies. When they tested the new method, it used almost all of the GPU’s memory bandwidth, ran 4.1 times faster than an existing state space model, and even beat the popular attention method for typical text lengths used in training and pre-filling. This means that for everyday tasks like training large language models or generating answers quickly, the new method can save time and resources, making large AI systems more practical and efficient.

For a technical reader

The paper addresses the performance bottleneck of linear-time sequence models at common sequence lengths. It proposes a split-sequence tiling approach to reduce boundary-state traffic and a hierarchy-aware segsum that decomposes the semiseparable decay mask into diagonal and rank-one blocks, computed efficiently with warp-level scans and cross-warp aggregation. Implemented in CuTe-DSL with warp specialization, asynchronous TMA, WGMMA, and layout-aware accumulators, the kernels achieve 91% of memcpy bandwidth, 4.1× faster prefill than the Triton Mamba-2 kernel, and surpass FlashAttention-4 from 1-2k tokens onward, while being 1.35-1.40× faster than a stable direct-segsum baseline.

Problem

Linear-time sequence models such as SSMs are theoretically faster than attention, but their speed advantage is lost at common training and prefill lengths because existing implementations are slower than optimized attention kernels and computing the decay mask suffers from a speed-stability tradeoff.

Method

The approach uses a split-sequence tiling strategy to reduce boundary-state traffic and decomposes the semiseparable decay mask into diagonal and rank-one blocks, computing them with warp-level scans and cross-warp aggregation while maintaining stability. The implementation leverages CuTe-DSL with warp specialization, asynchronous TMA, WGMMA, and layout-aware accumulator fragments.

Results

The approach reaches 91% of memcpy bandwidth, improves prefill time by 4.1× over the Triton Mamba-2 kernel, and outperforms FlashAttention-4 starting at 1-2k tokens, with the mask computation being 1.35-1.40× faster than a stable direct-segsum implementation.

Contributions

The work narrows the speed gap between linear-time sequence models and attention by introducing a split-sequence tiling scheme and a stable, fast decay-mask computation that decomposes the mask into diagonal and rank-one components. It also provides an implementation that achieves near-optimal memory bandwidth utilization on H100 GPUs.

Practical relevance

This makes linear-time sequence models viable for common pretraining and prefill workloads, enabling faster inference and training on standard GPUs.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction