GPU Hierarchy Meets Structured Matrices: Fast Algorithms for State-Space Models
Keep the title, authors and abstract in paper.json
potentialpaper · 2026-11-23 20:45 UTC · 5741a706176e ·
.potentialpaper/metadata.json modified
+++ b/.potentialpaper/metadata.json@@ -1,31 +1,5 @@{- "layout": 5,- "identifiers": [- {- "scheme": "openreview",- "value": "m6QBIQ5qCZ"- }- ],- "title": "GPU Hierarchy Meets Structured Matrices: Fast Algorithms for State-Space Models",- "authors": [- "Berlin Chen",- "Caitlin Wang",- "Aakash Lahoti",- "Kevin Li",- "Jay Shah",- "Jack Carlisle",- "Timmy Liu",- "Mengyu Guo",- "J Zico Kolter",- "Albert Gu",- "Tri Dao"- ],- "abstract": "Linear-time sequence models such as State Space Models (SSMs) offer an efficient alternative to self-attention and have demonstrated strong language modeling performance at scale.\nIn practice, however, their asymptotic advantage is often lost at common training and prefill lengths---optimized FlashAttention kernels remain faster than existing SSM implementations up to 8k tokens.\nIn this work, we substantially narrow this performance gap with novel algorithmic improvements: \nFirst, we introduce a split-sequence algorithm that decouples the compute tile from the sequence-parallel split length, preserving efficient matrix multiplication tiles while substantially reducing boundary-state traffic and latency.\nSecond, we resolve a longstanding *speed--stability tradeoff* in computing the 1-semiseparable (SS) decay mask, the main non-matmul bottleneck shared by all chunk-wise linear-time kernels (Mamba-2, Mamba-3, GDN, KDA). Existing kernels use the fast *diff segsum* (prefix subtraction), which suffers monotonicity violations and catastrophic cancellation---failures observed in real pretraining (e.g., Nemotron-H); the stable alternative (*direct segsum*) materializes the dense mask and is $\\sim30\\\\%$ slower. Our *hierarchy-aware segsum* decomposes the SS mask into 1-SS diagonal blocks and rank-one off-diagonal blocks, computed via warp-level scans and cross-warp aggregation directly in registers, achieving the stability of direct segsum at the speed of diff segsum.\nWe implement these algorithms using CuTe-DSL with warp specialization, asynchronous TMA, WGMMA, and layout-aware accumulator fragments.\nAcross a large range of sequence length, our H100 kernels reach 91\\% of measured memcpy bandwidth, improve prefill time by $4.1\\times$ over the official Triton Mamba-2 kernel, and **outperform the highly-optimized FlashAttention-4 starting at 1-2k sequence length**---to our knowledge, the first time a linear-time sequence layer is faster than state-of-the-art attention at the 2-4k sequence lengths used in common pretraining and prefill workloads, where prior linear-time kernels only reached parity at $\\geq 8$k. Our hierarchy-aware segsum is $1.35$-$1.40\\times$ faster than a naive stable direct-segsum implementation.",- "year": 2026,- "venue": "NeurIPS 2026",- "source": "openreview",- "license": {- "metadata": "CC0-1.0",- "abstract": "CC0-1.0"- }+ "layout": 6,+ "kind": "paper",+ "key": "f16c1b9b-8532-488f-ac98-1efa7043b3db"}
paper.json added
+++ b/paper.json@@ -0,0 +1,21 @@+{+ "title": "GPU Hierarchy Meets Structured Matrices: Fast Algorithms for State-Space Models",+ "authors": [+ "Berlin Chen",+ "Caitlin Wang",+ "Aakash Lahoti",+ "Kevin Li",+ "Jay Shah",+ "Jack Carlisle",+ "Timmy Liu",+ "Mengyu Guo",+ "J Zico Kolter",+ "Albert Gu",+ "Tri Dao"+ ],+ "abstract": "Linear-time sequence models such as State Space Models (SSMs) offer an efficient alternative to self-attention and have demonstrated strong language modeling performance at scale.\nIn practice, however, their asymptotic advantage is often lost at common training and prefill lengths---optimized FlashAttention kernels remain faster than existing SSM implementations up to 8k tokens.\nIn this work, we substantially narrow this performance gap with novel algorithmic improvements: \nFirst, we introduce a split-sequence algorithm that decouples the compute tile from the sequence-parallel split length, preserving efficient matrix multiplication tiles while substantially reducing boundary-state traffic and latency.\nSecond, we resolve a longstanding *speed--stability tradeoff* in computing the 1-semiseparable (SS) decay mask, the main non-matmul bottleneck shared by all chunk-wise linear-time kernels (Mamba-2, Mamba-3, GDN, KDA). Existing kernels use the fast *diff segsum* (prefix subtraction), which suffers monotonicity violations and catastrophic cancellation---failures observed in real pretraining (e.g., Nemotron-H); the stable alternative (*direct segsum*) materializes the dense mask and is $\\sim30\\\\%$ slower. Our *hierarchy-aware segsum* decomposes the SS mask into 1-SS diagonal blocks and rank-one off-diagonal blocks, computed via warp-level scans and cross-warp aggregation directly in registers, achieving the stability of direct segsum at the speed of diff segsum.\nWe implement these algorithms using CuTe-DSL with warp specialization, asynchronous TMA, WGMMA, and layout-aware accumulator fragments.\nAcross a large range of sequence length, our H100 kernels reach 91\\% of measured memcpy bandwidth, improve prefill time by $4.1\\times$ over the official Triton Mamba-2 kernel, and **outperform the highly-optimized FlashAttention-4 starting at 1-2k sequence length**---to our knowledge, the first time a linear-time sequence layer is faster than state-of-the-art attention at the 2-4k sequence lengths used in common pretraining and prefill workloads, where prior linear-time kernels only reached parity at $\\geq 8$k. Our hierarchy-aware segsum is $1.35$-$1.40\\times$ faster than a naive stable direct-segsum implementation.",+ "license": {+ "metadata": "CC0-1.0",+ "abstract": "CC0-1.0"+ }+}