Skip to content

Refresh cross-layer draft buffers after loading and reload - #51

Draft
aoshen02 wants to merge 2 commits into
mainfrom
fix/model-post-load-draft-buffers
Draft

aoshen02 wants to merge 2 commits into
mainfrom
fix/model-post-load-draft-buffers

Conversation

@aoshen02

@aoshen02 aoshen02 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Partial draft reloads can build fused KV/norm tensors while untouched weights or RoPE buffers are still meta placeholders. Refresh cross-layer derived buffers only after all layers are ready, and copy into existing nonpersistent buffers to preserve captured storage addresses.

The owning backbone exposes refresh_derived_buffers(). Cold-load postprocessing and reload finalization both invoke it after their existing processing. This operation only refreshes derived buffers; it does not rerun model-level weight conversion. Qwen DFlash/DSpark, DFlash2, Gemma DSpark, Laguna DFlash and Kimi K3 MLA DSpark share this lifecycle through existing inheritance. Production code has a net increase of 25 lines.

Scope: no DeepSeek MoE changes or reload-capability flags. This does not establish general reload safety for arbitrary model-level PWAL hooks.

Related work: upstream vllm-project#55076 guards the same meta-placeholder failure; this changes the lifecycle and preserves derived-buffer storage. vllm-project#52487 also rebuilds DSpark fused state after finalize, so there is partial overlap; its broader scope is disk-backed sleep/wake recovery, whereas this covers the shared checkpoint reload finalizer. vllm-project#56706 / fork #46 remove HPC QK-norm mirrors. Fork #47 and #48 address iteration and reload API organization. This draft targets aoshen02/vllm:main only.

Validation:

  • Repository-pinned pre-commit run <hook> --files <changed Python files> passed for ruff-check, ruff-format, check-spdx-header, check-root-lazy-imports, check-forbidden-imports, check-torch-cuda-call and check-boolean-context-manager. git diff --check passed.
  • .venv/Scripts/python.exe ../run_cpu_checks.py: 12 CPU source-isolated checks passed. The local harness executes actual loader/reload functions, builder methods and committed test bodies with lightweight model shells and isolated accelerator imports. This is not a full pytest run.
  • Removing the refresh dispatch fails stale-value assertions; replacing buffers instead of copying fails identity assertions. Tests cover fresh-versus-reloaded values across two partial updates, storage addresses, restored caches, inherited builders, and cold-only model hooks running once.
  • Full pre-commit installation remains blocked by Windows Application Control rejecting Go's assembler for actionlint. Commit hooks were bypassed after the focused checks above. Editable vLLM installation has no compatible Windows AMD64 precompiled wheel. Full pytest, GPU inference, CUDA Graph replay and model evaluations remain unverified. On supported hardware, run .venv/bin/python -m pytest tests/model_executor/model_loader/test_reload.py tests/model_executor/model_loader/test_draft_post_load.py, then draft-model inference/evaluations.

AI assistance: implemented and self-audited with Codex. Draft for the owner's line-by-line review and accelerator validation; no human review or model evaluation is claimed.

aoshen524 and others added 2 commits September 14, 2026 21:11
Build cross-layer draft buffers after layerwise restoration and refresh their storage in place. Opt migrated model hooks into reload without replaying unrelated cold-start transforms.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: aoshen524 <aoshen524@gmail.com>
Refresh derived buffers on their owning backbones after cold load and reload. Remove speculative MoE changes and root hook wrappers, and consolidate buffer updates and regression coverage.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: aoshen524 <aoshen524@gmail.com>
@aoshen02 aoshen02 changed the title Fix model-level post-load processing for DFlash and DSpark Refresh cross-layer draft buffers after loading and reload Sep 14, 2026
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.

1 participant