FlashRNN: I/O-Aware Optimization of Traditional RNNs on modern hardware
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 Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
3 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels cites FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision
- Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- pLSTM: parallelizable Linear Source Transition Mark networks cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- pLSTM: parallelizable Linear Source Transition Mark networks cites Tiled Flash Linear Attention: More Efficient Linear RNN and xLSTM Kernels
- pLSTM: parallelizable Linear Source Transition Mark networks cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- pLSTM: parallelizable Linear Source Transition Mark networks cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
Cited 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
