FlashRNN: I/O-Aware Optimization of Traditional RNNs on modern hardware
Korbinian Pöppel, Maximilian Beck, Sepp Hochreiter
Abstract
While Transformers and other sequence-parallelizable neural network architectures seem like the current state of the art in sequence modeling, they specifically lack state-tracking capabilities. These are important for time-series tasks and logical reasoning. Traditional RNNs like LSTMs and GRUs, as well as modern variants like sLSTM do have these capabilities at the cost of strictly sequential processing. While this is often seen as a strong limitation, we show how fast these networks can get with our hardware-optimization FlashRNN in Triton and CUDA, optimizing kernels to the register level on modern GPUs. We extend traditional RNNs with a parallelization variant that processes multiple RNNs of smaller hidden state in parallel, similar to the head-wise processing in Transformers. To enable flexibility on different GPU variants, we introduce a new optimization framework for hardware-internal cache sizes, memory and compute handling. It models the hardware in a setting using polyhedral-like constraints, including the notion of divisibility. This speeds up the solution process in our ConstrINT library for general integer constraint satisfaction problems (integer CSPs). We show that our kernels can achieve 50x speed-ups over a vanilla PyTorch implementation and allow 40x larger hidden sizes compared to our Triton implementation. Our open-source kernels and the optimization library are released here to boost research in the direction of state-tracking enabled RNNs and sequence modeling: https://github.com/NX-AI/flashrnn
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext fa52e4ea-6e8e-4243-b2d5-8489cbc33718Cited by top-tier papers3
- TiRex: Zero-Shot Forecasting Across Long and Short Horizons with Enhanced In-Context LearningAndreas Auer, Patrick Podest, Daniel Klotz, Sebastian Böck et al.NeurIPS 2025 · 126 citations
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM KernelsMaximilian Beck, Korbinian Pöppel, Phillip Lippe, Sepp HochreiterNeurIPS 2025 · 17 citations
- pLSTM: parallelizable Linear Source Transition Mark networksKorbinian Pöppel, Richard Freinschlag, Thomas Schmied, Wei Lin et al.NeurIPS 2025 · 2 citations
Builds on9
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
- FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisionJay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar et al.NeurIPS 2024 · 727 citations
Related papers
- ParaRNN: Unlocking Parallel Training of Nonlinear RNNs for Large Language ModelsFederico Danieli, Pau Rodríguez, Miguel Sarabia, Xavier Suau et al.ICLR 2026 · 18 citations
- ThunderKittens: Simple, Fast, and Adorable KernelsBenjamin Frederick Spector, Simran Arora, Aaryan Singhal, Arjun Parthasarathy et al.ICLR 2025
- PRISM: Parallel Residual Iterative Sequence ModelJie Jiang, Ke Cheng, XIN XU, Mengyang Pang et al.ICML 2026
- Implicit Language Models are RNNs: Balancing Parallelization and ExpressivityMark Schöne, Babak Rahmani, Heiner Kremer, Fabian Falck et al.ICML 2025
- FlashEKGR: Fast Embedding-Based Knowledge Graph Reasoning Models TrainingWentai Zhang, Teng Xu, Weiguang Wang, Junxing Li et al.ICDE 2026
