paper-with-me

Papers

Paged Attention Meets FlexAttention: Unlocking Long-Context Efficiency in Deployed Inference

2025-06-08 · Thomas Joshi, Herman Saini, Neil Dhillon, Antoni Viros i Martin, Kaoutar El Maghraoui

Large Language Models (LLMs) encounter severe memory inefficiencies during long-context inference due to conventional handling of key-value (KV) caches. In this work, we introduce a novel integration of PagedAttention with PyTorch's FlexAttention, addressing internal fragmentation and inefficiencies associated with monolithic KV cache allocations. Implemented within IBM's Foundation Model Stack (FMS), our fused attention kernel efficiently gathers scattered KV data. Our benchmarks on an NVIDIA L4 GPU (24GB) demonstrate significantly reduced inference latency, growing only linearly (~2x) with sequence length from 128 to 2048 tokens when utilizing a global KV cache, compared to exponential latency increases without caching. While peak memory usage remains largely unchanged for single-step evaluations (dominated by model weights and activations), paged attention causes minimal incremental memory usage, observable only at sequence lengths exceeding 2048 tokens due to its power-of-two cache allocations. We open-source the full implementation and discuss its implications for future long-context model deployment.

📄 PDF Abstract BibTeX arXiv:2506.07311

Code (0)

등록된 구현이 없습니다.

Tasks

GPU

Methods 이 논문이 사용한 방법론

Fragmentation Given a pattern $P,$ that is more complicated than the patterns, we fragment $P$ into simpler patterns such that their exact count is known. In the subgraph GNN proposed earlier,…

Similar Papers 제목 키워드 기반

Flex Attention: A Programming Model for Generating Optimized Attention Kernels

2024-12-07 · Juechu Dong, Boyuan Feng, Driss Guessous, Yanbo Liang 외

Over the past 7 years, attention has become one of the most important primitives in deep learning. The primary approach to optimize attention is FlashAttention, which fuses the operation together, drastically improving b…

PagedEviction: Structured Block-wise KV Cache Pruning for Efficient Large Language Model Inference

2025-09-04 · Krishna Teja Chitty-Venkata, Jie Ye, Xian-He Sun, Anthony Kougkas 외 arxiv

KV caching significantly improves the efficiency of Large Language Model (LLM) inference by storing attention states from previously processed tokens, enabling faster generation of subsequent tokens. However, as sequence…

Flashlight: PyTorch Compiler Extensions to Accelerate Attention Variants

2025-11-03 · Bozhi You, Irene Wang, Zelal Su Mustafaoglu, Abhinav Jangda 외 arxiv

Attention is a fundamental building block of large language models (LLMs), so there have been many efforts to implement it efficiently. For example, FlashAttention leverages tiling and kernel fusion to optimize attention…

FlexAttention for Efficient High-Resolution Vision-Language Models

2024-07-29 · Junyan Li, Delin Chen, Tianle Cai, Peihao Chen 외

Current high-resolution vision-language models encode images as high-resolution image tokens and exhaustively take all these tokens to compute attention, which significantly increases the computational cost. To address t…

TextVQA

vAttention: Dynamic Memory Management for Serving LLMs without PagedAttention

2024-05-07 · Ramya Prabhu, Ajay Nayak, Jayashree Mohan, Ramachandran Ramjee 외

PagedAttention is a popular approach for dynamic memory allocation in LLM serving systems. It enables on-demand allocation of GPU memory to mitigate KV cache fragmentation -- a phenomenon that crippled the batch size (an…

GPUManagement