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 View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

No sample from the archive's official repository (vllm-project/vllm) is linked to this paper; the 36 samples below come from 3 community repositories. Syntology harvested code from vllm-project/vllm for another paper.

vllm-project/vllm: Syntology's graph links these samples to Learning how to Forget: Fine-tuning for Long-Context Sparse Attention (arXiv:2608.19920; that paper's own run record: 21 ran (of which 2 constructed an object rather than computing a result; 11 with no instrument failure: 3 honoured, 5 violated, 3 with no contract checked; 10 where Syntology's instrument failed) · 8 unverified); nothing checks that they implement this paper's method.

Syntology 36 code samples harvested from 3 repositories linked to this paper: 28 ran (of which 0 constructed an object rather than computing a result; 12 with no instrument failure: 5 honoured, 1 violated, 6 with no contract checked; 16 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 11 where our contract draft was wrong; 5 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 36 samples from 3 repositories, 28 ran (12 with no instrument failure; 16 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 3 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

vllm-project/vllm officialmentioned in papermentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Learning how to Forget: Fine-tuning for Long-Context Sparse Attention (arXiv:2608.19920; that paper's own run record: 21 ran (of which 2 constructed an object rather than computing a result; 11 with no instrument failure: 3 honoured, 5 violated, 3 with no contract checked; 10 where Syntology's instrument failed) · 8 unverified); nothing checks that they implement this paper's method. report
ROCm/flash-attention mentioned on GitHubpytorchBSD-3-ClauseSyntology: 18 samples, 16 ran (9 instrument-failed) · 2 unverified report
adlik/vllm mentioned on GitHubpytorchApache-2.0Syntology: 3 samples, 3 ran (2 instrument-failed) · 0 unverified report
dao-ailab/flash-attention mentioned on GitHubpytorchBSD-3-ClauseSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision (arXiv:2407.08608; that paper's own run record: 16 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 4 honoured, 0 violated, 3 with no contract checked; 9 where Syntology's instrument failed) · 2 unverified) and ELSA: Exact Linear-Scan Attention for Fast and Memory-Light Vision Transformers (arXiv:2604.23798; that paper's own run record: 16 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 4 honoured, 0 violated, 3 with no contract checked; 9 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
hazyresearch/flash-attention mentioned on GitHubpytorchBSD-3-ClauseSyntology: not harvested report
rasmith/vllm mentioned on GitHubjaxApache-2.0Syntology: 15 samples, 9 ran (5 instrument-failed) · 6 unverified report
wuklab/infercept mentioned on GitHubpytorchApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to InferCept: Efficient Intercept Support for Augmented Large Language Model Inference (arXiv:2402.01869; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 0 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

36 samples harvested: 28 ran (of which 0 constructed an object rather than computing a result; 12 with no instrument failure: 5 honoured, 1 violated, 6 with no contract checked; 16 where Syntology's instrument failed) · 8 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

5ran · honoured contract
1ran · violated contract
11ran · our draft was wrong
5ran; the contract check could not run
6ran
8unverified

Licence: 11 of the 36 samples are pointer only, meaning Syntology does not serve that copy's text. For 11 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. 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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

ROCm/flash-attention community (archive-listed) 18 samples, 16 ran (9 instrument-failed) · 2 unverified
apply_rotary_emb_torch in 8 papers flash_attn/layers/rotary.py ran; the contract check could not run (RAISES) BSD-3-Clause (permissive) here; the stored copy is pointer only · 5ec949977c334f87 · report fixture: signature x:Tensor/4/float, cos:Tensor/2/float, sin:Tensor/2/float, interleaved:bool/0/bool · returned Tensor · level recorded 2026-09-24
attention_pytorch flash_attn/cute/benchmark_flash_attention_fp8.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted BSD-3-Clause (permissive) · 4afe00a5853d633f · report fixture: signature qkv:Tensor/5/float, causal:bool/0/bool · returned Tensor · level recorded 2026-09-22
attention_pytorch benchmarks/benchmark_flash_attention.py ran; the contract check could not run (RAISES) BSD-3-Clause (permissive) · 942ce4d7b0714c0a · report fixture: signature qkv:Tensor/5/float, dropout_p:float/0/float, causal:bool/0/bool · returned Tensor · level recorded 2026-09-24
convert_blockmask flash_attn/flash_blocksparse_attn_interface.py ran; the contract check could not run (RAISES) BSD-3-Clause (permissive) here; the stored copy is pointer only · cc628b160e090ba1 · report fixture: signature blockmask:Tensor/2/float, causal:bool/0/bool · returned Tensor · level recorded 2026-09-24
efficiency flash_attn/cute/benchmark_flash_attention_fp8.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) · f29cb637db3ec374 · report fixture: signature flop:int/0/int, seconds:float/0/float · returned float · level recorded 2026-09-22
efficiency benchmarks/benchmark_flash_attention.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) · b5de75d142329f03 · report fixture: signature flop:float/0/float, time:float/0/float · returned float · level recorded 2026-09-24
flash_attn_qkvpacked_func flash_attn/flash_attn_interface.py ran BSD-3-Clause (permissive) here; the stored copy is pointer only · 7541ce9614862680 · report fixture: returned Tensor · level recorded 2026-09-24
flops flash_attn/cute/benchmark_flash_attention_fp8.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) · e73bdfbda28da341 · report fixture: signature batch:int/0/int, seqlen:int/0/int, headdim:int/0/int, nheads:int/0/int, causal:bool/0/bool · returned int · level recorded 2026-09-22
flops benchmarks/benchmark_flash_attention.py ran BSD-3-Clause (permissive) · 8d5fb28ca2f46eb8 · report fixture: signature batch:int/0/int, seqlen:int/0/int, headdim:int/0/int, nheads:int/0/int, causal:bool/0/bool, mode:str/0/str · returned int · level recorded 2026-09-24
init_to_zero in 17 papers flash_attn/flash_attn_triton.py ran · our draft was wrong BSD-3-Clause (permissive) here; the stored copy is pointer only · 1586b639a5abd0b0 · report fixture: signature name:str/0/str · returned function · level recorded 2026-09-24
maybe_contiguous in 8 papers flash_attn/flash_attn_interface.py ran · our draft was wrong fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · 19ad2ccd82e378c1 · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-24
pad_input in 16 papers flash_attn/bert_padding.py ran BSD-3-Clause (permissive) here; the stored copy is pointer only · a8cf6124094beaab · report fixture: signature hidden_states:Tensor/2/float, indices:Tensor/1/int, batch:int/0/int, seqlen:int/0/int · returned Tensor · level recorded 2026-09-24
rotate_half in 424 papers
census: 24 implementations from 96 papers, 4 distinct outputs across 2 buckets, one shared input per bucket
flash_attn/layers/rotary.py ran; the contract check could not run (RAISES) fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · 163292f43a3c861b · report fixture: signature x:Tensor/2/float, interleaved:bool/0/bool · returned Tensor · level recorded 2026-09-24
round_multiple flash_attn/flash_attn_interface.py ran · honoured contract fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · a0595f1c95cacf06 · report fixture: signature x:int/0/int, m:int/0/int · returned int · level recorded 2026-09-24
unpad_input in 12 papers flash_attn/bert_padding.py ran · our draft was wrong BSD-3-Clause (permissive) here; the stored copy is pointer only · d84093c20a0ed8fd · report fixture: signature hidden_states:Tensor/3/float, attention_mask:Tensor/2/int, unused_mask:Tensor/2/int · returned tuple · level recorded 2026-09-24
unpad_input_for_concatenated_sequences in 5 papers flash_attn/bert_padding.py ran · our draft was wrong fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · 62394c842aafb022 · report fixture: signature hidden_states:Tensor/3/float, attention_mask_in_length:Tensor/2/int · returned tuple · level recorded 2026-09-24
convert_to_cudnn_type hopper/benchmark_flash_attention_fp8.py unverified BSD-3-Clause (permissive) · a9519adef33152bb · report
cudnn_spda_setup hopper/benchmark_flash_attention_fp8.py unverified BSD-3-Clause (permissive) · 58ebcd8dbefa010d · report
adlik/vllm community (archive-listed) 3 samples, 3 ran (2 instrument-failed) · 0 unverified
get_lock vllm/model_executor/weight_utils.py ran · our draft was wrong Apache-2.0 (permissive) · 9f09d0beacdd35d1 · report fixture: signature model_name_or_path:str/0/str, cache_dir:NoneType/0/? · returned UnixFileLock · level recorded 2026-09-24
init_logger in 50 papers vllm/logger.py ran · our draft was wrong Apache-2.0 (permissive) · 13adeb89dc2bcd5c · report fixture: signature name:str/0/str · returned Logger · level recorded 2026-09-24
prepare_hf_model_weights vllm/model_executor/weight_utils.py ran Apache-2.0 (permissive) · 0ffca819d6ab93f9 · report fixture: signature model_name_or_path:str/0/str, cache_dir:NoneType/0/?, use_safetensors:bool/0/bool, fall_back_to_pt:bool/0/bool, revision:NoneType/0/? · returned tuple · level recorded 2026-09-24
rasmith/vllm community (archive-listed) 15 samples, 9 ran (5 instrument-failed) · 6 unverified
create_fp4_scale_tensor vllm/_custom_ops.py ran Apache-2.0 (permissive) · 5c034fc95116b35f · report fixture: signature m:int/0/int, n:int/0/int, device:device/0/?, is_sf_swizzled_layout:bool/0/bool · returned Tensor · level recorded 2026-09-24
format_model_inspection in 5 papers vllm/model_inspection.py ran · our draft was wrong Apache-2.0 (permissive) here; the stored copy is pointer only · a696f84b9b36ab84 · report fixture: signature model:callable/0/? · returned str · level recorded 2026-09-24
get_served_model_name vllm/config/model.py ran fingerprinted Apache-2.0 (permissive) · 274e96c750b77b6d · report fixture: signature model:str/0/str, served_model_name:list/1/str · returned str · level recorded 2026-09-24
maybe_convert_bool vllm/envs.py ran · violated contract Apache-2.0 (permissive) · a39aa5bb3cefb4d0 · report fixture: signature value:str/0/str · returned bool · level recorded 2026-09-24
maybe_convert_int vllm/envs.py ran · honoured contract Apache-2.0 (permissive) · d11a43f137351612 · report fixture: signature value:str/0/str · returned int · level recorded 2026-09-24
run in 143 papers vllm/collect_env.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · bd5675c0d72d5295 · report fixture: signature command:str/0/str · returned tuple · level recorded 2026-09-24
run_and_parse_first_match in 15 papers vllm/collect_env.py ran · our draft was wrong Apache-2.0 (permissive) · 0b342669284f2be6 · report fixture: signature run_lambda:callable/0/?, command:str/0/str, regex:str/0/str · returned str · level recorded 2026-09-24
run_and_read_all in 15 papers vllm/collect_env.py ran · our draft was wrong Apache-2.0 (permissive) · 5ae630bfc3821b6e · report fixture: signature run_lambda:callable/0/?, command:str/0/str · returned str · level recorded 2026-09-24
str_dtype_to_torch_dtype vllm/config/model.py ran · our draft was wrong Apache-2.0 (permissive) · 653b6f1bab40d0d2 · report fixture: signature type:str/0/str · returned dtype · level recorded 2026-09-24
create_fp4_output_tensors vllm/_custom_ops.py unverified Apache-2.0 (permissive) · c1aa2a7e052537ef · report
get_graph_partition_signature_patched vllm/env_override.py unverified Apache-2.0 (permissive) · 982bc8603648cd4c · report
maybe_convert_json_str_or_file vllm/envs.py unverified Apache-2.0 (permissive) · d8ae3e91c8bc649b · report
memory_plan_reuse_patched vllm/env_override.py unverified Apache-2.0 (permissive) · 2842ff1da04c998d · report
should_partition_patched vllm/env_override.py unverified Apache-2.0 (permissive) · 556097b799045118 · report
vocab_parallel_embedding vllm/_custom_ops.py 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