Skip to content

[Bugfix][DeepSeek V4] Say why every MXFP4 MoE backend was rejected - #57821

Draft
aoshen02 wants to merge 1 commit into
vllm-project:mainfrom
aoshen02:fix/dsv4-mxfp4-backend-error
Draft

aoshen02 wants to merge 1 commit into
vllm-project:mainfrom
aoshen02:fix/dsv4-mxfp4-backend-error

Conversation

@aoshen02

@aoshen02 aoshen02 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Trying to start DeepSeek-V4.1-Flash with VLLM_BATCH_INVARIANT=1 on a GB200,
every worker died with exactly this and nothing else:

NotImplementedError: No MXFP4 MoE backend supports the deployment configuration.

The generic MXFP4 selector in the same file raises with the diagnosis attached:

raise NotImplementedError(
    "No MXFP4 MoE backend supports the deployment configuration. "
    f"weight_key=kMxfp4Static, activation_key={activation_key}. "
    f"Candidate backends were: {[b.value for b in AVAILABLE_BACKENDS]}. "
    f"Unsupported reasons: {unsupported_log}. "
)

select_deepseek_v4_mxfp4_moe_backend collects the same per-backend reasons,
logs them at debug_once, and then throws them away. So on the models most
likely to land in an unusual configuration, the failure says the least.

In my case the reason was the batch-invariance gate in
modular_kernel.is_supported_config (envs.VLLM_BATCH_INVARIANT and not cls._supports_batch_invariance()), which I could only find by reading the
source. With this PR the error says it.

Change

Collect the rejection reasons in the DeepSeek-V4 path and include them in the
error, with the wording the generic path already uses.

Not a duplicate

gh pr list --search "mxfp4 backend selection error" returns backend additions
and unrelated fixes (#55232, #54032, #55275, #54109); none of them touches the
error path.

Test plan

pytest tests/kernels/moe/test_dsv4_mxfp4_backend_error.py -q   # 1 passed
pytest tests/kernels/moe/test_b12x.py -q -k deepseek           # 3 passed

CPU-only. The new test stubs a kernel class that refuses with a known reason and
asserts both the candidate list and that reason reach the exception.

pre-commit run --files vllm/model_executor/layers/fused_moe/oracle/mxfp4.py \
  tests/kernels/moe/test_dsv4_mxfp4_backend_error.py
# passed

No behavior change beyond the message: the same configurations succeed and the
same ones fail.

AI assistance

Developed with AI assistance (Claude). This came out of an actual multi-node run
on DeepSeek-V4.1-Flash, not a code read — the empty message is what cost the
time. I reviewed every changed line, ran the tests above, and I am the
accountable submitter.

🤖 Generated with Claude Code

Review rounds

An adversarial automated review was run over this diff against origin/main,
asked specifically whether the collection loop changes which backend is
selected, whether the new error path is reachable where the old code succeeded
(or vice versa), whether each reported reason is the actual rejection cause,
whether any backend is now probed that was previously skipped (import side
effects, CUDA init), and whether the report can leak an internal name or come
out empty or duplicated. It found no defects.

@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

❌ This PR is 2 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

@mergify mergify Bot added deepseek Related to DeepSeek models DSv4 bug Something isn't working labels Sep 20, 2026
@aoshen02
aoshen02 force-pushed the fix/dsv4-mxfp4-backend-error branch from 1832b54 to 580e85d Compare September 20, 2026 18:14
@aoshen02

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

❌ This PR is 2 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

The generic MXFP4 selector lists the candidate backends and each one's
rejection reason when nothing matches. The DeepSeek-V4 selector logged the
same reasons at debug level and then raised a bare "No MXFP4 MoE backend
supports the deployment configuration", so a server that refuses to start
gives no way to tell a missing kernel from, for example, the batch
invariance gate in modular_kernel.is_supported_config -- without reading
the source.

Collect the reasons and put them in the error, matching the wording the
generic path already uses.

Signed-off-by: Ao Shen <aoshen@inferact.ai>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Signed-off-by: aoshen02 <aoshen@inferact.ai>
@aoshen02

Copy link
Copy Markdown
Contributor Author

/ci run

@aoshen02
aoshen02 force-pushed the fix/dsv4-mxfp4-backend-error branch from 580e85d to a482ac2 Compare September 20, 2026 18:33
@github-actions

Copy link
Copy Markdown

❌ This PR is 2 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

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

bug Something isn't working deepseek Related to DeepSeek models DSv4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant