Repository navigation
[Bugfix][ROCm] Match the DeepSeek-V4.1 FP8 config in the shared-expert FSE compatibility check - #63099
Conversation
…t FSE compatibility check Generated-by: Hyperloom Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com>
| ) | ||
|
|
||
| if isinstance(quant_config, DeepseekV4FP8Config): | ||
| if isinstance(quant_config, (DeepseekV4FP8Config, DeepseekV41FP8Config)): |
There was a problem hiding this comment.
A V4.1 config with expert_dtype="fp8" now takes this branch, and its first check returns "routed experts are not MXFP4". Today that class misses this isinstance and can still pass the Fp8Config check lower in the function. The reported failure and the new test are the fp4 Quark checkpoint. Should the fp8 case stay on that FP8 check?
There was a problem hiding this comment.
Agreed, it should. On main, DeepSeek-V4-Flash-Base (FP8 experts) with the variable set runs fused (the MoE gets 257 experts, top-7), and GSM8K 5-shot stays within run-to-run noise of the unfused runs (0.917 vs 0.909 and 0.923; MI355X, TP2). The DeepSeek branch now only takes MXFP4 routed experts, so FP8 experts keep the FP8 check as on main. Added test_deepseek_v41_fp8_experts_keep_fp8_fse_check.
|
Thanks @BaoYunkai , is dsv4 pro also having the same issue here? |
There was a problem hiding this comment.
Please also update the log info to DeepSeek-V4/V4.1 ....
There was a problem hiding this comment.
Done, updated all five messages to DeepSeek-V4/V4.1 ....
| return ( | ||
| False, | ||
| f"DeepSeek-V4 excludes shared experts at {shared_expert_prefix}", | ||
| ) |
| return ( | ||
| False, | ||
| f"DeepSeek-V4 shared experts at {shared_expert_prefix} are not MXFP4", | ||
| ) |
|
Yes. DeepSeek-V4-Pro has the same checkpoint layout as V4-Flash. On main with |
The DeepSeek branch of is_shared_expert_quant_fse_compatible now also handles the V4.1 config, so its rejection messages say DeepSeek-V4/V4.1. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com>
|
/ci run |
|
✅ Triggered Buildkite CI #97236 for commit |
Only MXFP4 routed experts need the DeepSeek-specific check. FP8-expert checkpoints such as DeepSeek-V4-Flash-Base keep going through the generic Fp8Config check, as on main, where fused shared experts load and run correctly. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com>
|
✅ @BaoYunkai, CI is now available for this PR.
|
|
/ci run |
|
✅ Triggered Buildkite CI #97244 for commit |
Conflict: `tests/model_executor/layers/test_fused_shared_expert.py` also gained DeepSeek-V4.1 coverage from vllm-project#63099. Keep this branch's rewritten per-layer assertions (DSv4 mixed-precision skip reason, MTP layer-set expectations) and adopt the reworded `DeepSeek-V4/V4.1 ...` skip reason; vllm-project#63099's two new `test_deepseek_v41_*` tests merge in unchanged.
…t FSE compatibility check (vllm-project#63099) Signed-off-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com> Co-authored-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Shanshan Shen <467638484@qq.com> Signed-off-by: Christopher Mackenzie <christopher.mackenzie.software@gmail.com>
…t FSE compatibility check (vllm-project#63099) Signed-off-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com> Co-authored-by: BaoYunkai <269084791+BaoYunkai@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Shanshan Shen <467638484@qq.com> Signed-off-by: Christopher Mackenzie <christopher.mackenzie.software@gmail.com>
Overview
On CUDA and ROCm,
deepseek_v4_fp8always resolves to the DeepSeek-V4.1DeepseekV4FP8Config, which subclassesFp8Config, not the V4 class.is_shared_expert_quant_fse_compatibleruns its DeepSeek-V4 checks only for the V4 class, so on these platforms it falls through to the genericFp8Configbranch and reports every DeepSeek-V4 shared expert as FSE-compatible. This PR matches both classes for MXFP4 routed experts, as the online-quantization branch of the same function already does.Founded by Hyperloom.
Claims
VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=1. Quark MXFP4 checkpoints hit the same failure on the FP8 MTP shared expert.test_deepseek_v41_quant_config_rejects_fp8_mtp_shared_expert_fseandtest_deepseek_v41_fp8_experts_keep_fp8_fse_check.Validation
MI355X (gfx950),
deepseek-ai/DeepSeek-V4-Flash, TP1,--kv-cache-dtype fp8 --block-size 256, vLLM built from main at 15a78aa (the touched files are unchanged on current main).With
VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=1, main fails during weight loading in 2 of 2 runs:With this PR, all 43 layers reject FSE ("only implemented/tested with Quark MXFP4"), run the shared expert unfused, and serve.
vllm bench serve, random 1000 in / 200 out, 400 prompts, concurrency 50, a fresh server per run. 4 runs per arm, median of the last 3, within-arm spread in parentheses:GSM8K, 5-shot, greedy, 1319 items,
lm_eval --model local-completions:DeepSeek-V4-Flash-Base (FP8 experts), TP2, vLLM built from main at b3b0bc3: with the variable set, main runs the shared expert fused (257 experts, top-7 in the MoE), and GSM8K (same settings as above) stays within the noise of unfused runs: 0.9174 vs 0.9090 and 0.9234 from two runs without the variable. This PR gives the same FSE answer as main for this checkpoint.
Unit tests on MI355X against the built tree,
pytest tests/model_executor/layers/test_fused_shared_expert.py: this PR 107 passed. Main failstest_deepseek_v41_quant_config_rejects_fp8_mtp_shared_expert_fse;test_deepseek_v41_fp8_experts_keep_fp8_fse_checkpasses on both.Details
The existing unit test missed the bug because it constructs the V4 class directly. CI does not run DeepSeek-V4 with this variable set; the new tests are CPU-only.
AI assistance (Hyperloom with Claude) was used to find and prepare this change. I reviewed every changed line and reproduced the results above.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.