[Misc][Spec Decode] Detect DeepSeek-V4 DSpark checkpoints from config - #52165
[Misc][Spec Decode] Detect DeepSeek-V4 DSpark checkpoints from config#52165xuebwang-amd wants to merge 2 commits into
Conversation
|
I reproduced one config-flow gap in this PR and prepared a focused follow-up at calvarado2004@c1953d6. When a caller explicitly supplies both It also adds end-to-end config-flow coverage through real
The routing fields are shared by the official 0731 and Tom Sarihan NVFP4 variants, so the tests cover the checkpoint contract independently of expert quantization. Validation completed: Ruff check, Ruff format check, Python 3.12 |
|
Validated this PR on real hardware (8×MI325X, gfx942, ROCm 7.14) against both affected checkpoints — filling in the "coming soon" test-result slot: Before (both checkpoints, method='mtp'): worker dies deep in the weight loader —
With this PR applied (the
No KeyError, no worker start. The recommended path in that message is also verified end-to-end on this hardware: One detection detail worth noting: Pro-0813 carries |
|
NVIDIA H100 validation — complementing the MI325X results above. Hardware: 8×H100 SXM (SM90, one node), 1. The trap reproduces on a stock NVIDIA release build. 2. This PR's guard works as intended. The
3. One caveat on the guidance message for Hopper + current release. Following the message's advice — One deployment note for 80 GB parts: +1 to land — this closes the same trap we hit independently. |
|
Correction to my validation comment above, prompted by additional internal benchmarking data on this checkpoint: I attributed the
What I actually measured stands, but more narrowly: v0.27.1 + |
DeepSeek-V4-Flash-0731 and DeepSeek-V4-Pro-0813 ship DSpark drafters, not
MTP heads, but hf_config_override routes every deepseek_v4 config to
DeepSeekV4MTPModel and DSpark detection keys off the model name. Their
weights reach the MTP loader and die on
KeyError: model.layers.{43,61}.mtp_block.main_norm.weight.
Detect the drafter from the dspark_* config keys instead of the repo name,
and reject an explicit method="mtp" on such a checkpoint at startup with an
error naming method="dspark" and its token minimum.
Closes vllm-project#52111
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
25e4045 to
1114263
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Purpose
To close #52111.
DeepSeek-V4-Flash-0731andDeepSeek-V4-Pro-0813do not have MTP heads — theirmtp.*tensors are DSpark drafters. vLLM routes them toDeepSeekV4MTPModelanyway and dies deep in the weight loader:This PR resolves the drafter from
config.jsoninstead of the repo name, and turnsmethod="mtp"on a DSpark checkpoint into an actionable startup error.It is platform-independent: reproduced on MI325X, and on stock
vllm/vllm-openaiv0.23.0 and v0.27.1 on H100.Test Plan
Routing is decided from
config.jsonalone, so the decision is asserted end to end through a realModelConfig+SpeculativeConfigover a synthetic checkpoint directory holding nothing but aconfig.json.Covered: explicit
mtprejected on the self-speculation path for both DSpark checkpoint shapes and, for Flash-0731, on the named-draft-model path; plainDeepSeek-V4-Flashstill resolving toDeepSeekV4MTPModel; an omitted methodauto-detecting
dspark; and the pre-existing block-size minimum. The predicate and the variant mapping are pinned separately as unit tests.Test Result
TODO: 5 failures
Hardware validation
Hardware validation from the contributors in the thread below:
KeyErroron both Flash-0731 (layer 43) and Pro-0813 (layer 61); with this changemethod="mtp"fails at config validation instead, and the suggestedmethod="dspark",num_speculative_tokens=5serves Pro-0813 at 50 tok/s prose / 91 tok/s code single-stream, 2.1×/3.8× over no spec decode. Pro-0813's differingdspark_target_layer_idsis why detection keys on presence, not contents.vllm/vllm-openai:v0.27.1(and v0.23.0) at DP4 + EP, fp8 KV cache, where config validation acceptsmethod="mtp"and every DP engine core then dies on the sameKeyError. The patch applies to v0.27.1 in 3 hunks with zero rejects and aborts in ~15 s, before any engine process spawns.method="dspark"at k=5 and k=7: 0.89–0.93 acceptance, 2–3× speedup over the base model. This is the path the new error message points users at, on the drafter this PR routes to.No model-eval results from me: this is config validation only. It converts a crash into a startup error and does not alter any decoding path, nor the weights loaded on paths that already worked.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.