[Sleep] Retain draft-private weights with existing parameter selector by aoshen02 · Pull Request #61046 · vllm-project/vllm · GitHub
Skip to content

[Sleep] Retain draft-private weights with existing parameter selector - #61046

Merged
aoshen02 merged 6 commits into
vllm-project:mainfrom
aoshen02:codex/draft-parameter-retention-upstream
Oct 11, 2026
Merged

aoshen02 merged 6 commits into
vllm-project:mainfrom
aoshen02:codex/draft-parameter-retention-upstream

Conversation

@aoshen02

@aoshen02 aoshen02 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Overview

The existing sleep_preserve_parameter_names API preserves frozen Engram table weights and scales across level-2 sleep, without retransmitting them during target weight updates (#57891). Extend the same API to draft-private weights for target-only updates; both use cases are documented. Related: #52479.

Claims

  • Select draft-private parameters with --sleep-preserve-parameter-names 'draft.*', or individual draft.<name> patterns.
  • Reuse existing CPU snapshots and in-place restoration; exclude target-shared Parameter identities.
  • Allow an empty draft.* selection (no draft, or no private parameters). Other unmatched patterns still raise.
  • No new switch, runner hook, RPC, inference-loop work, or graph recapture. Core diff: two files, 17 additions / 3 deletions.
  • Document both the original frozen Engram table use case and draft.* in the existing Sleep Mode section; preserve the distinction between retention and Engram inference-time CPU offload.

Validation

Changed-file pre-commit passes. Focused CPU regression command:

.venv/bin/python -m pytest --confcutdir=tests/v1/worker \
  tests/v1/worker/test_gpu_worker.py -k sleep_preservation -v

The tests check shared ownership, in-place restoration, an absent/all-shared draft, and unmatched target names: baseline 3 failed, simplified pinned candidate 3 passed, main-based candidate 3 passed. Current-main base: 3c062d391d15cfa41d3f321cad24f3030c892a97. Tests used the experimental container's dependencies with current-main Python source; no kernels were exercised by these CPU tests.

H200 model evaluation on the earlier equivalent nonempty-selection implementation, based on 43b4aaea with the composed Vime patches:

Qwen3.8-27B, TP4, MTP3 Accepted draft tokens Private parameters
Before sleep 498/813 (61.25%) 48 fingerprints recorded
Level-2 sleep, staged wake, target-only reload 499/816 (61.15%) All 48 values and addresses unchanged
Retention disabled, isolated baseline 0/2286 Private values lost

Six requests per phase; temperature 1, top-p 0.95, context 65,536, eager execution; model revision 1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0. This is not an otherwise-unpatched current-main GPU result. No throughput improvement or ROCm/CPU/XPU/all-drafter validation is claimed.

The graph-enabled eight-GPU Agent training/rollout E2E also passes on the earlier 2ec58c52 implementation in the installed experimental image: two training steps, maximum observed MTP acceptance 87.6%, mean acceptance length up to 3.63. This does not substitute for a clean current-main GPU test.

Details

Level-2 sleep discards target and draft weights. Reloading only the target leaves draft-private storage undefined: verification still works, but speculative acceptance can disappear. This opt-in extension saves the current draft before sleep and restores it at weight wake, using the existing narrow no-grad restore helper. Draft-buffer handling is unchanged.

This is distinct from #52487 (restore a configured disk checkpoint during reload_weights) and #60139 (explicitly load a new draft checkpoint). Neither retains the current draft across target-only IPC/NCCL updates. Those disk APIs remain useful and unchanged.

The measured snapshot is approximately 203 MiB per rank for this model; CPU storage and copies occur only at sleep/wake. Retained parameters must not also be supplied by the weight-update sender, as with the existing retention API.

AI assistance was used for implementation, investigation, and validation. Submitted at the human maintainer's explicit request; kept as a draft for human line-by-line review, which is not asserted complete.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).
  • AI assistance was used during the creation of this PR.
  • Design Fit: Reuses parameter retention and restoration; no separate state machine.
  • Testing and Validation: Targeted CPU regression, prior GPU reproducer and model results; version/platform limits stated.
  • Code Quality and Style: Changed-file pre-commit passes; existing test file extended.
  • Pull Request Contents: Root cause, distinct related PRs, usage, cost, and limitations included.

BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing

Extend the existing retention namespace instead of adding another backup switch. Preserve current draft-private values in place without restoring target-shared parameters, and allow empty draft wildcard selections.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
Document the wildcard serving example and shared ownership rule in the existing retention section, rather than adding another configuration surface.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
@mergify

mergify Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--61046.org.readthedocs.build/en/61046/

@mergify mergify Bot added the documentation Improvements or additions to documentation label Oct 11, 2026
@aoshen02 aoshen02 added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 11, 2026
@aoshen02
aoshen02 marked this pull request as ready for review October 11, 2026 03:32

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@aoshen02

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #94044 for commit 3d297433be76.

aoshen02 and others added 2 commits October 11, 2026 03:35
Keep both retention use cases explicit and distinguish Engram inference-time CPU offload from level-2 sleep preservation. Use the narrow runtime table-and-scale pattern rather than selecting trainable Engram projections.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
@aoshen02

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #94046 for commit 982c598f2298.

aoshen02 and others added 2 commits October 11, 2026 06:16
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: aoshen02 <aoshen@inferact.ai>
@aoshen02

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

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

Labels

documentation Improvements or additions to documentation ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants