Ragged Paged Attention: A High-Performance and Flexible LLM Inference Kernel for TPU
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
Large Language Model (LLM) deployment is increasingly shifting to cost-efficient accelerators like Google's Tensor Processing Units (TPUs), prioritizing both performance and total cost of ownership (TCO). However, existing LLM inference kernels and serving systems remain largely GPU-centric, and there is no well-established approach for efficiently mapping LLM workloads onto TPU architectures--particularly under the dynamic and ragged execution patterns common in modern serving. In this paper, we present Ragged Paged Attention (RPA), a high-performance and flexible attention kernel for TPUs, implemented using Pallas and Mosaic. RPA addresses these challenges through three key techniques: (1) fine-grained tiling to enable efficient dynamic slicing over ragged memory, (2) a custom software pipeline that fuses KV cache updates with attention computation, and (3) a distribution-aware compilation strategy that generates specialized kernels for decode, prefill, and mixed workloads. Evaluated on Llama 3 8B on TPU7x, RPA achieves up to 86% memory bandwidth utilization (MBU) in decode and 73% model FLOPs utilization (MFU) in prefill. Integrated as the primary TPU backend in vLLM and SGLang, RPA provides a production-grade foundation for efficient TPU inference and offers practical insights into kernel design.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 9 of its 11 references that are in the map. First posted on arXiv 16 Apr 2026.
Builds on
9 of 11 references.
Closest ancestors · 1
Same direction, newest first
Other references · 8
- 2017Attention Is All You Needcited by 59,932
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 507
- 2026FlashAttention-4: Algorithm and Kernel Pipelining Co-Design for Asymmetric Hardware Scalingcited by 58
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026JAXBench: Benchmarking Autonomous TPU Kernel Optimization19 May 2026
Similar, not cited
Close in wording, no citation either way
- 2025The Anatomy of a Triton Attention Kernel
- 2025HGCA: Hybrid GPU-CPU Attention for Long Context LLM Inference
- 2025FlashInfer: Efficient and Customizable Attention Engine for LLM Inference Serving
- 2026Multi-Segment Attention: Enabling Efficient KV-Cache Management for Faster Large Language Model Serving
- 2026PackInfer: Compute- and I/O-Efficient Attention for Batched LLM Inference
- 2026HybridGen: Efficient LLM Generative Inference via CPU-GPU Hybrid Computing
- 2023Efficient LLM inference solution on Intel GPU
- 2025Paged Attention Meets FlexAttention: Unlocking Long-Context Efficiency in Deployed Inference