Repository navigation
[Bugfix][KV Offload] Restore MTP-retained sliding-window history - #56709
Merged
orozery merged 3 commits intoSep 16, 2026
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: jacklin78911-collab <jacklin78911@gmail.com>
jacklin78911-collab
requested review from
ApostaC,
NickLucche,
ivanium,
orozery and
xuechendi
as code owners
September 13, 2026 15:59
Contributor
|
/ci run |
|
❌ This PR is 112 commits behind upstream |
Contributor
|
/ci run |
|
✅ Triggered Buildkite CI #89041 for commit |
Contributor
Author
|
✅ @jacklin78911-collab, CI is now available for this PR.
|
Contributor
|
/ci run |
|
✅ Triggered Buildkite CI #89251 for commit |
orozery
approved these changes
Sep 16, 2026
6 tasks done
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.
Purpose
Fix native KV offload restoring MTP-retained sliding-window blocks that lookup never checked and the producer may never have stored. Implements the conservative coverage option discussed in #56701.
For example, with a 64-token external hit, SWA block size 16, window 32, and three extra retained tokens, lookup checks chunks 2–3 while allocation also restores chunk 1. If chunk 1 is absent or still being written,
CPUOffloadingManager.prepare_load()asserts after the hit has already been admitted. Hybrid store pruning can itself omit chunk 1.Include
extra_retained_tokensin aligned/partial lookup coverage, the existing in-flight-load check, and producer store reachability. Preserve the base coverage lower bound so retaining one extra token does not unnecessarily request another chunk. The store mask uses a temporary coverage spec; actual attention windows, allocation, cache keys, and transfer ownership are unchanged. Restoring the required older blocks can increase CPU cache usage and transfer volume.Duplicate checks on 2026-09-13 found no open PR for
56701 in:bodyorextra_retained_tokens offload. #55818 handles allocation scaling and #53499 page-size normalization; neither fixes this lookup/store mismatch.Test Plan
Extend the existing scheduler tests to cover retained history at aligned and unaligned hybrid boundaries, EAGLE tail handling, missing/pending/loading chunks, and a producer followed by a cold GPU-cache consumer. The consumer only hits keys actually stored by the producer.
PYTHONPATH="$PWD" .venv/bin/python -m pytest \ tests/v1/kv_connector/unit/offloading_connector \ tests/v1/kv_offload/cpu/test_manager.py -q --tb=short .venv/bin/python -m pre_commit run --files \ vllm/distributed/kv_transfer/kv_connector/v1/offloading/scheduler.py \ tests/v1/kv_connector/unit/offloading_connector/test_scheduler.py .venv/bin/python -m pre_commit run mypy-3.12 --hook-stage manual --files \ vllm/distributed/kv_transfer/kv_connector/v1/offloading/scheduler.py \ tests/v1/kv_connector/unit/offloading_connector/test_scheduler.pyTest Result
--lfafter seeding the missing publicfacebook/opt-125mconfig/tokenizer cache and enabling offline mode; no code changes.de500290ffffeb7bd834872c0dea5331590dd40d: 14 failed, 88 passed.MultiModuleMTPSpeculator; the unmodified proposals exercised 30 decode calls with four rejected drafts, entering the three-token re-prefill path. A separate controlled draft-rejection check also passed the restore/output assertions.V1 used Python 3.12.13 / PyTorch 2.11.0+cu130; H20 V2 used Python 3.12.14 / PyTorch 2.13.0+cu130 with UVA available. Compiled extensions were reused, and both changed source files on H20 were SHA-256 verified against
1e89fa93a662a321e29860f3f30a25a362070fc8(the reused environment's package version metadata identifies the older build).These GPU checks use tiny dummy weights, BF16, eager mode, and disabled optional JIT warmup. They validate the serving/re-prefill paths for this configuration. Trained-model quality, acceptance rate, and performance have not been evaluated; no throughput improvement is claimed.
Reproduce the H20 V2 functional smoke
Save the script below as
../tiny_mtp_v2.pyrelative to the checkout and run:The temporary model directory below is generalized from the executed script.
AI assistance: OpenAI Codex assisted with investigation, implementation, testing, and this description; the commit includes attribution.
PR description checklist