Skip to content

[BugFix] Preserve aligned hybrid cache reuse alongside endpoint checkpoints - #669

Merged
lukealonso merged 2 commits into
local-inference-lab:dev/jovian-judgementfrom
logprobz:fix/dev-aligned-cache-reuse
Sep 6, 2026
Merged

lukealonso merged 2 commits into
local-inference-lab:dev/jovian-judgementfrom
logprobz:fix/dev-aligned-cache-reuse

Conversation

@logprobz

@logprobz logprobz commented Sep 5, 2026

Copy link
Copy Markdown

The new endpoint-checkpoint mechanism excludes DFlash2 and external connectors, which still use aligned recurrent checkpoints. That path fails three LP26 cache regressions on the current branch: missing reuse, missing fallback state, and skipped rewind boundaries. This ports the qualified fixes while preserving private endpoint bundles and their ownership guards.

The shared handoff API changes are kept together so core and connector consumers remain compatible. Review the port in these groups:

  • Aligned reuse and scheduling: retained checkpoints, fine sliding-window lookup, committed state publication, and aligned prefill budgets. Endpoint requests retain their bypass and private-state guard.
  • External stores: explicit boundary-state offers, per-job ownership, exact Mooncake and generic-offload consumers, and snapshots for scheduled requests that allocate no new blocks.
  • Cache events: truthful sparse stores, parent continuity, full-report replay, and partial-tail visibility, with protocol tests.

This carries behavior from #643, #645, #646, #655, #656, #557, #657, and #663. Authorship is preserved in commit trailers. It supersedes logprobz follow-ups #643, #645, #655, #656, #657, and #663; other authors' PRs remain independently owned.

Validation:

  • This cache port passed 910 CPU regressions and three aligned-cache contracts before the independent sampling and GDN corrections.
  • The combined image passed 952 regressions plus those contracts, 25 installed sampling cases, and 14 upstream sampling regressions.
  • Matched four-GPU DFlash2 K3, Marlin, TP4/DCP1, FP8 KV, 524288-context serving passed cache replay, shared prefixes, tools, vision, 491520-token retrieval, all 64 agent turns, and the finite speed matrix. Warm long-context retrieval reused 491264 tokens in 1.75 seconds. Initial throughput and latency ratios are within the existing 5% LP26 parity limits.
  • The exact LP26 service was restored. Promotion and the final repeated parity gate remain pending.

The initial serving evidence includes the local GDN variant from now-closed #668 and #653's sampling RNG fix as production prerequisites. BF16 LM-head precision is retained. External connectors have CPU coverage; no live external store was qualified. Concurrent MTP endpoint admission is outside this DFlash2 profile.

Base tested: b7e3d03. Prepared with AI assistance. Independent Astra release review verified source hashes, image provenance, sampling identity, and serving receipts, with bounded candidate approval. A separate local promotion-script preemption check is being corrected before production cutover.

PR #667 already fixes the same GDN defect, so #668 is closed as a duplicate. Our transition cases and #667 metadata/worker tests pass (53 passed, 3 skipped). Final qualification is switching to #667 + this PR + #653; fresh combined-image GPU validation is required before promotion.

MTP qualification update: native2048 recurrent blocks passed full serving qualification. Fine256 MTP exposed a resumed recurrent-state column using target-page units; #672 is the narrow required correction. Fine MTP replay is being requalified with that dependency. Do not interpret cache-hit counts alone as MTP correctness.

Final MTP3 serving qualification

The combined immutable candidate containing #653, #667, #669, #670, #672 and #674 passed full MTP3 serving qualification. All cold/warm/appended cache canaries, 16 shared-prefix requests, 64 agent turns, tools/parser/vision checks and 491,520-token cold/warm retrieval passed, with zero preemptions or runtime errors. The long prompt was fully reused and returned the correct answer in 1.36 seconds warm versus 56.73 seconds cold. Ten decode repeats averaged 133.98 tokens/s.

The installed image passed 1,000 CPU regressions plus three cache contracts, and all 18 scalar restore GPU cases. DFlash2 also passed full serving qualification and two repeated concurrency matrices. Every throughput and latency metric met the 5% LP26 parity gate, with zero preemptions or runtime errors. The qualified image is promoted on port 8100. This is a combined-source qualification, not a standalone performance claim for this PR.

Port the qualified hybrid retention, fine-hit, event, exact external-state,
and aligned-budget changes onto dev/jovian-judgement. Keep endpoint bundles
private and preserve their allocation, reader, and invalidation lifecycle.

Retain the behavioral contributions from PRs vllm-project#557, vllm-project#643, vllm-project#645, vllm-project#646,
vllm-project#655, vllm-project#656, vllm-project#657, and vllm-project#663. Resolve shared helpers once so fine and coarse
replay boundaries are not expanded twice.

Validation: 910 cache, scheduler, parser, event, connector, and endpoint
regressions pass. The three literal LP26 cache regressions also pass.

Co-authored-by: Jason Cook <jasonc@maxlyn.com>
Co-authored-by: Martin Vit <martin@voipmonitor.org>
Co-authored-by: Yifan Qiao <yifanqiao@inferact.ai>
Co-authored-by: haic0 <149741444+haic0@users.noreply.github.com>
Co-authored-by: tobymao <toby.mao@gmail.com>
Signed-off-by: logprobz <321553542+logprobz@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 6175ef52-cf00-43a9-b9dd-5a6076c53487

📥 Commits

Reviewing files that changed from the base of the PR and between b7e3d03 and 1e5110f.

📒 Files selected for processing (32)
  • tests/distributed/test_kv_cache_events.py
  • tests/v1/core/prefix_cache/test_partial_prefix_cache_hits.py
  • tests/v1/core/prefix_cache/test_partial_prefix_cache_primitives.py
  • tests/v1/core/prefix_cache/test_sparse_event_context.py
  • tests/v1/core/test_kv_connector_block_state.py
  • tests/v1/core/test_lp27_review_invariants.py
  • tests/v1/core/test_mamba_align_chunk_split.py
  • tests/v1/core/test_micro_slicing.py
  • tests/v1/core/test_prefix_caching.py
  • tests/v1/core/test_single_type_kv_cache_manager.py
  • tests/v1/kv_connector/unit/offloading_connector/test_scheduler.py
  • tests/v1/kv_connector/unit/test_lp27_snapshot_coverage.py
  • tests/v1/kv_connector/unit/test_mooncake_store_connector.py
  • tests/v1/kv_connector/unit/test_mooncake_store_coordinator.py
  • tests/v1/kv_connector/unit/test_mooncake_store_hma_e2e.py
  • tests/v1/kv_connector/unit/test_mooncake_store_scheduler.py
  • tests/v1/kv_connector/unit/test_mooncake_store_worker.py
  • tests/v1/kv_connector/unit/test_offloading_connector.py
  • tests/v1/kv_connector/unit/test_scheduler_kv_connector_override.py
  • vllm/distributed/kv_events.py
  • vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/coordinator.py
  • vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/data.py
  • vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/scheduler.py
  • vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py
  • vllm/distributed/kv_transfer/kv_connector/v1/offloading/scheduler.py
  • vllm/platforms/interface.py
  • vllm/v1/core/block_pool.py
  • vllm/v1/core/kv_cache_coordinator.py
  • vllm/v1/core/kv_cache_manager.py
  • vllm/v1/core/sched/output.py
  • vllm/v1/core/sched/scheduler.py
  • vllm/v1/core/single_type_kv_cache_manager.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: logprobz <321553542+logprobz@users.noreply.github.com>
@lukealonso
lukealonso merged commit 86acae9 into local-inference-lab:dev/jovian-judgement Sep 6, 2026
1 of 2 checks passed
@original-el8

Copy link
Copy Markdown

Spark qualification of this PR (four-node DGX Spark, GB10 SM121, TP4 over RoCE, GLM-5.3-Flash NVFP4 + DFlash2 k=5, fp8 KV, --block-size 2048 --mamba-block-size 256 --prefix-match-unit 256, 8192-token chunks, retention interval 0, full cudagraphs), built as 1e5110fce + #667, b12x master@b58f34e:

Cache reuse. Identical replay of page-aligned prompt lengths, which misses entirely on the #646 head (this is the #655 reproducer; it reproduces on Spark for every aligned length I tried), now hits:

prompt tokens #646 head: identical replay this PR + #667: identical replay prefix + 2 new tokens (both)
65,536 0 hits, 22.9 s 65,280 hits, 0.31 s 65,280
32,768 0 hits, 11.5 s 32,512 hits, 0.30 s 32,512
8,192 0 hits, 2.9 s 7,936 hits, 0.28 s 7,936
2,048 0 hits, 0.93 s 1,792 hits, 0.27 s 1,792

Non-aligned lengths were already fine on #646 and are unchanged here (99,303-token prompt: 99,072 reused in 0.44 s; 49,043: 48,896 in 0.31 s; shared-prefix variants identical).

Throughput and quality, same image pair, same day. KV pool 4,297,015 tokens (unchanged). Decode c1/c8/c16 at 0k context 47.7 / 131.7 / 229.0 tok/s versus a #646-head band of 42.6–46.9 / 137–151 / 201–229 across paired arms; standalone cold prefill 2840 / 2899 / 2820 tok/s at 8k/32k/128k versus 2849 / 2907 / 2802. Speculative acceptance 2.5–2.8 throughout (that needs #667 on these heads). GSM8K-100 at c16: 92/100 and 96/100 on two runs, against 94–97 on the #646 head.

CPU: tests/v1/core/prefix_cache 109, test_prefix_caching.py 128, test_mamba_align_chunk_split.py 38 (the four test_mamba_align_split_* cases that fail on the untouched head pass here), GDN builder 26 — all pass on 1e5110fce + #667.

No regressions observed on Spark; the aligned-length replay fix is a real improvement over #646 on this cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants