Skip to content

feat(router): add decode-to-prefill KV reuse with retained GPU transport - #16748

Draft
yifjiang wants to merge 29 commits into
mainfrom
codex/decode-to-prefill-kv-reuse
Draft

yifjiang wants to merge 29 commits into
mainfrom
codex/decode-to-prefill-kv-reuse

Conversation

@yifjiang

@yifjiang yifjiang commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Enable opt-in reuse of a longer completed prefix retained by a decode worker during a later prefill. Bounded donor lookup is separate from execution selection; unavailable donors, cancellation and incomplete delivery preserve fallback. The feature is disabled by default and does not modify production vLLM.

Each role’s manager owns one TP1 bank or rank-local TP2 banks sharing logical slot IDs. Atomic descriptors bind geometry, GPU identity and owner lifetime. Inventory becomes ready after every worker acknowledges its store. Workers import their same-GPU bank, with source pins and destination storage protected through native quiescence.

CUDA IPC is default. Explicit MNNVL uses CUDA FABRIC and isolated UCX GPU RMA, TCP control and no CPU payload fallback. Scope: raw TP1/TP2, local multiprocessing, DP=PP=CP=1. The new D-to-P RDMA profile and native peer-death recovery remain unsupported. Companion typed hints/multipart delivery and experimental native patches: KVCR #104. Part of #16747 and #16746.

Source and validation

Public head be2fbeba includes main cb5f9a67, with exercised source inventories unchanged. Actual ARM runtime/components producer remains 0c8cea0c, KVCR 83e5e9e6, image sha256:f727f1274998d6fdd40c8147cd156e2e190157c36be220c46cff0ae869bb3451. Source equivalence does not relabel the benchmark producer.

  • Allocated producer gates: router 1,427, LLM 3,828, both admission integrations; Python feature 190, runtime arguments 44, TCP admission 58. Format, selected Clippy, release/package/native/import QA pass. Separate public be2 CI: 84 successful /43 skipped, no failed or pending reported checks.
  • Fresh GB200 native oracle: positive 7 keys /229,376 B /14 PtoP copies; missing-key 6 keys /196,608 B /12 copies, untouched missing rows, no false completion. Both ranks, guards, pins, close and zero host payload pass. Bank tests: 19 mocks plus one real two-GPU case.
  • Earlier coherent 1.7: four real GPU adapter/IPC cases; Qwen's seven requests/twelve traces pass under batch-invariant FLASH_ATTN/FA2, with complete OFF/ON/fallback IDs. ON delivers 37,748,736 B, computing 18 versus 274 tokens. The default-backend mismatch is preserved.
  • An independent MiniMax 4,096→1,024 pilot passes complete raw/counter replay.
Fresh MiniMax on SLURM GB200 TP2 Actual result
OFF4 and profiled reuse correctness Full raw IDs/counters pass; six-actor second-turn proof delivers 136,249,344 B, equally across ranks, with zero host payload
Original three-sample normal-policy calibration NEGATIVE: headroom −59.479 ms, no positive token coefficient or calibrated mode
New adaptive forced diagnostic: six balanced pairs TTFT 2.90% slower in 6/6 pairs (median +12.00 ms); completion time mixed and essentially flat; fixed control coefficients, not calibrated gain

The adaptive comparison was separately declared after negative calibration and before its own first paired request; it was not predeclared before overall traffic. Prior STOP failure and the separate DGD counter/expired-authentication block remain preserved. SLURM evidence is not a DGD result. No MiniMax calibrated gain is claimed. This PR remains draft.

No performance gain was observed on this tested MiniMax workload. All reported latencies are second-turn client observations; profile/calibration timings are excluded. After all 36 requests completed, prefill exited 1 during post-finish SIGTERM/cancellation; both owned model groups stopped and fresh process-absence checks passed.

Exact sources, commands, all six pairs and preserved failures are in the reproduction record.

@github-actions github-actions Bot added feat backend::vllm Relates to the vllm backend frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` router Relates to routing, KV-aware routing, etc. labels Oct 18, 2026
@devin-ai-integration

devin-ai-integration Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Dynamo PR CI passed — run 41178467317 (attempt 1) on be2fbeba95

Gate checks: ✅ backend-status-check · ✅ deploy-status-check · ✅ dynamo-status-check

Posted automatically by Devin for run 41178467317. Updated on every full-CI run of this PR.

@yifjiang
yifjiang force-pushed the codex/decode-to-prefill-kv-reuse branch 5 times, most recently from b388b6f to 077d3e5 Compare October 20, 2026 17:25
@yifjiang yifjiang changed the title feat(router): add gated decode-to-prefill KV reuse Add opt-in decode-to-prefill KV reuse with direct GPU transport Oct 20, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

config.get("control_advertise_host") or socket.gethostname(),
)
with socket.socket() as listener:
listener.bind(("", 0))
@yifjiang
yifjiang force-pushed the codex/decode-to-prefill-kv-reuse branch from d53de57 to 01bf6cd Compare October 20, 2026 19:24
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
…clears

Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
@yifjiang
yifjiang force-pushed the codex/decode-to-prefill-kv-reuse branch from c00e29d to d0cd1b8 Compare October 22, 2026 23:46
@yifjiang yifjiang changed the title Add opt-in decode-to-prefill KV reuse with direct GPU transport feat(router): add decode-to-prefill KV reuse with retained GPU transport Oct 22, 2026
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Merge public main a99d917 and preserve its selection and booking architecture. Add per-rank retained GPU banks, atomic rank manifests, multipart KVCR registration and typed hint delivery without changing production vLLM. Allocated SLURM validation is pending.

Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Defer advisory prompt hashing into the existing bounded blocking job and skip expired queued work. Query retained target residency without enumerating unrelated owners. Add deadline, hash-parity and target-prefix regression coverage.

Refs #16747

Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
…into codex/mnnvl-tp2-gb200

Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>

This branch has not been deployed

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

Labels

backend::vllm Relates to the vllm backend documentation Improvements or additions to documentation feat frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` router Relates to routing, KV-aware routing, etc. size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants