Papers › Efficient Memory Management for Large Language Model Serving with PagedAttention

Efficient Memory Management for Large Language Model Serving with PagedAttention

12 Sep 2023arXiv:2309.06180archive 2025-07-28

Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, Ion Stoica

High throughput serving of large language models (LLMs) requires batching sufficiently many requests at a time. However, existing systems struggle because the key-value cache (KV cache) memory for each request is huge and grows and shrinks dynamically. When managed inefficiently, this memory can be significantly wasted by fragmentation and redundant duplication, limiting the batch size. To address this problem, we propose PagedAttention, an attention algorithm inspired by the classical virtual memory and paging techniques in operating systems. On top of it, we build vLLM, an LLM serving system that achieves (1) near-zero waste in KV cache memory and (2) flexible sharing of KV cache within and across requests to further reduce memory usage. Our evaluations show that vLLM improves the throughput of popular LLMs by 2-4× with the same level of latency compared to the state-of-the-art systems, such as FasterTransformer and Orca. The improvement is more pronounced with longer sequences, larger models, and more complex decoding algorithms. vLLM's source code is publicly available at https://github.com/vllm-project/vllm

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2309.06180")

Code

Syntology Ran 25 of 36 code samples harvested from 3 repositories linked to this paper; 11 have no recorded run. Of those that ran: 2 ran · honoured contract; 1 ran · fixture could not drive it; 22 ran with no contract checked.

By repository: community (archive-listed): 36 samples from 3 repositories, 25 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

vllm-project/vllm officialmentioned in papermentioned on GitHubpytorch report
ROCm/flash-attention mentioned on GitHubpytorchBSD-3-Clause report
adlik/vllm mentioned on GitHubpytorchApache-2.0 report
dao-ailab/flash-attention mentioned on GitHubpytorchBSD-3-Clause report
hazyresearch/flash-attention mentioned on GitHubpytorchBSD-3-Clause report
rasmith/vllm mentioned on GitHubjaxApache-2.0 report
wuklab/infercept mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

36 samples harvested; 25 ran; 2 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
1ran · fixture could not drive it
22ran
11unverified

Licence: 0 of the 36 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

apply_rotary_emb_torch ROCm/flash-attention/flash_attn/layers/rotary.py community (archive-listed) ran BSD-3-Clause (permissive) · 5ec949977c334f87 · report
attention_pytorch ROCm/flash-attention/flash_attn/cute/benchmark_flash_attention_fp8.py community (archive-listed) ran · fixture could not drive it fingerprinted BSD-3-Clause (permissive) · 4afe00a5853d633f · report
attention_pytorch ROCm/flash-attention/benchmarks/benchmark_flash_attention.py community (archive-listed) ran BSD-3-Clause (permissive) · 942ce4d7b0714c0a · report
convert_blockmask ROCm/flash-attention/flash_attn/flash_blocksparse_attn_interface.py community (archive-listed) ran BSD-3-Clause (permissive) · cc628b160e090ba1 · report
efficiency ROCm/flash-attention/flash_attn/cute/benchmark_flash_attention_fp8.py community (archive-listed) ran · honoured contract fingerprinted BSD-3-Clause (permissive) · f29cb637db3ec374 · report
efficiency ROCm/flash-attention/benchmarks/benchmark_flash_attention.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · b5de75d142329f03 · report
flash_attn_qkvpacked_func ROCm/flash-attention/flash_attn/flash_attn_interface.py community (archive-listed) ran BSD-3-Clause (permissive) · 7541ce9614862680 · report
flops ROCm/flash-attention/flash_attn/cute/benchmark_flash_attention_fp8.py community (archive-listed) ran · honoured contract fingerprinted BSD-3-Clause (permissive) · e73bdfbda28da341 · report
flops ROCm/flash-attention/benchmarks/benchmark_flash_attention.py community (archive-listed) ran BSD-3-Clause (permissive) · 8d5fb28ca2f46eb8 · report
format_model_inspection rasmith/vllm/vllm/model_inspection.py community (archive-listed) ran Apache-2.0 (permissive) · a696f84b9b36ab84 · report
get_lock adlik/vllm/vllm/model_executor/weight_utils.py community (archive-listed) ran Apache-2.0 (permissive) · 9f09d0beacdd35d1 · report
init_logger adlik/vllm/vllm/logger.py community (archive-listed) ran Apache-2.0 (permissive) · 13adeb89dc2bcd5c · report
init_to_zero ROCm/flash-attention/flash_attn/flash_attn_triton.py community (archive-listed) ran BSD-3-Clause (permissive) · 1586b639a5abd0b0 · report
maybe_contiguous ROCm/flash-attention/flash_attn/flash_attn_interface.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · 19ad2ccd82e378c1 · report
maybe_convert_bool rasmith/vllm/vllm/envs.py community (archive-listed) ran Apache-2.0 (permissive) · a39aa5bb3cefb4d0 · report
maybe_convert_int rasmith/vllm/vllm/envs.py community (archive-listed) ran Apache-2.0 (permissive) · d11a43f137351612 · report
pad_input ROCm/flash-attention/flash_attn/bert_padding.py community (archive-listed) ran BSD-3-Clause (permissive) · a8cf6124094beaab · report
rotate_half ROCm/flash-attention/flash_attn/layers/rotary.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · 163292f43a3c861b · report
round_multiple ROCm/flash-attention/flash_attn/flash_attn_interface.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · a0595f1c95cacf06 · report
run rasmith/vllm/vllm/collect_env.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · bd5675c0d72d5295 · report
run_and_parse_first_match rasmith/vllm/vllm/collect_env.py community (archive-listed) ran Apache-2.0 (permissive) · 0b342669284f2be6 · report
run_and_read_all rasmith/vllm/vllm/collect_env.py community (archive-listed) ran Apache-2.0 (permissive) · 5ae630bfc3821b6e · report
str_dtype_to_torch_dtype rasmith/vllm/vllm/config/model.py community (archive-listed) ran Apache-2.0 (permissive) · 653b6f1bab40d0d2 · report
unpad_input ROCm/flash-attention/flash_attn/bert_padding.py community (archive-listed) ran BSD-3-Clause (permissive) · d84093c20a0ed8fd · report
unpad_input_for_concatenated_sequences ROCm/flash-attention/flash_attn/bert_padding.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · 62394c842aafb022 · report
convert_to_cudnn_type ROCm/flash-attention/hopper/benchmark_flash_attention_fp8.py community (archive-listed) unverified BSD-3-Clause (permissive) · a9519adef33152bb · report
create_fp4_output_tensors rasmith/vllm/vllm/_custom_ops.py community (archive-listed) unverified Apache-2.0 (permissive) · c1aa2a7e052537ef · report
create_fp4_scale_tensor rasmith/vllm/vllm/_custom_ops.py community (archive-listed) unverified Apache-2.0 (permissive) · 5c034fc95116b35f · report
cudnn_spda_setup ROCm/flash-attention/hopper/benchmark_flash_attention_fp8.py community (archive-listed) unverified BSD-3-Clause (permissive) · 58ebcd8dbefa010d · report
get_graph_partition_signature_patched rasmith/vllm/vllm/env_override.py community (archive-listed) unverified Apache-2.0 (permissive) · 982bc8603648cd4c · report
get_served_model_name rasmith/vllm/vllm/config/model.py community (archive-listed) unverified Apache-2.0 (permissive) · 274e96c750b77b6d · report
maybe_convert_json_str_or_file rasmith/vllm/vllm/envs.py community (archive-listed) unverified Apache-2.0 (permissive) · d8ae3e91c8bc649b · report
memory_plan_reuse_patched rasmith/vllm/vllm/env_override.py community (archive-listed) unverified Apache-2.0 (permissive) · 2842ff1da04c998d · report
prepare_hf_model_weights adlik/vllm/vllm/model_executor/weight_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 0ffca819d6ab93f9 · report
should_partition_patched rasmith/vllm/vllm/env_override.py community (archive-listed) unverified Apache-2.0 (permissive) · 556097b799045118 · report
vocab_parallel_embedding rasmith/vllm/vllm/_custom_ops.py community (archive-listed) unverified Apache-2.0 (permissive) · 59912a58648c7c22 · report

Tasks

Language ModelingLanguage ModellingLarge Language ModelManagement

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Fragmentation

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections