[Bugfix][KV Offload] Size CPU cache slots for one KV group - #56953
Open
zupengwang wants to merge 1 commit into
Open
zupengwang wants to merge 1 commit into
zupengwang wants to merge 1 commit into
Conversation
Size shared CPU slots for the largest selected group and overlay per-group views within each slot. Preserve packed GPU strides and isolate the new layout from persisted all-group rows. Fixes vllm-project#56871 Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Wang Zupeng <zupenwang@gmail.com>
Contributor
|
Documentation preview: https://vllm--56953.org.readthedocs.build/en/56953/ |
zupengwang
marked this pull request as ready for review
September 15, 2026 05:40
zupengwang
requested review from
ApostaC,
NickLucche,
ivanium,
orozery and
xuechendi
as code owners
September 15, 2026 05:40
Contributor
Author
|
@ApostaC @orozery could you review the shared-slot layout and persistent-cache compatibility in this PR? It fixes #56871 by sizing each CPU slot for the largest selected KV group and placing each group's data at the slot origin, while retaining fixed-size rows for secondary tiers. Remote validation at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #56871.
An offload key identifies one KV cache group, but CPU slots can reserve the combined footprint of all groups. For eight equally sized, disjoint groups, a budget that should hold 16 group keys holds only two.
This change carries each selected group's byte size into the offloading config and sizes the shared slot pool for the largest group. Worker views start at the beginning of each slot for each group, preserving GPU strides, aliases, unpadded payload sizes, and partial chunks. Packed GPU layouts use group-specific transfer regions instead of copying the whole multi-group block. The layout applies to CPU offloading and the CPU primary tier of tiered offloading.
Slots remain fixed-size for secondary-tier transfers. Unequal groups can still leave unused space inside a slot. A storage-format identifier including row size separates compact rows from previously persisted rows; existing files remain on disk but are not reused. Single-group and external backends retain their existing layout by default.
Duplicate-work check
The issue is claimed at #56871 (comment). Issue discussion and open/closed PR searches were rechecked on 2026-09-15. Related work covers group eligibility (#54743), node-local sizing (#53474), capacity metrics (#53902, #56867), and worker interfaces (#56076); it does not implement this per-group slot layout.
Validation
Base:
cd10ed6f9f6b37a8ace9cf380007e66fe12ec0c3, after the v0.29.0 release. Linux, Python 3.12.13, PyTorch 2.13.0+cu130, RTX 3090.blocks_per_chunk=1,3are covered.The GPU tests used reused native extensions with the checked-out Python sources. DeepSeek-V4.1 TP=8 production validation and throughput measurement remain outside this evidence.
The model comparison used the same standalone
model_roundtrip.pyharness from each checkout, invoked withPYTHONPATH="$PWD" RUN_NAME=baselineorRUN_NAME=candidate, using.venv/bin/python /ch_data/wzp/oss-ai-infra/vllm-offload-groups-20260915-evidence/model_roundtrip.py. The harness and JSON results are included in the review materials.Commands
AI assistance: Codex assisted with implementation, testing, and this description.