Skip to content

Revert "[Perf] Narrow DeepSeek V4 eager CUDA graph region" (#51430) - #51750

Closed
vllm-agent wants to merge 1 commit into
vllm-project:mainfrom
vllm-agent:auto-revert/pr-51430
Closed

vllm-agent wants to merge 1 commit into
vllm-project:mainfrom
vllm-agent:auto-revert/pr-51430

Conversation

@vllm-agent

Copy link
Copy Markdown
Contributor

Reverts #51430 — "[Perf] Narrow DeepSeek V4 eager CUDA graph region" (merge commit 79c865b).

Why

Nightly CI build #83211 (commit 635dd6a) failed MoE Refactor Integration Test (B200 - TEMPORARY):

FAILED evals/gsm8k/test_gsm8k_correctness.py::test_gsm8k_correctness[DeepSeek-V4-Flash-deepgemm-mega-moe]
AssertionError: GSM8K metric too low: 0.0432 < 0.9500 - 0.0800 = 0.8700
metric build 83159 (fac808b3, before #51430) build 83211 (635dd6aa, after)
GSM8K accuracy 0.9424 0.0432
MTP mean acceptance length 2.52 1.08
MTP draft acceptance rate 75.8% 4.1%

The other 18 configurations in the same job (Llama-4-Scout, Qwen3-30B-A3B, Mixtral-8x7B, Nemotron-Nano-30B) match between the two builds within normal noise. Only the DeepSeek-V4-Flash arm collapsed, and the collapse affects both the target model and the MTP drafter, which points at the model forward pass rather than the eval harness or the sampler.

Suspected mechanism

#51430 moved the @eager_break_during_capture boundary from attention_impl to the new _sparse_indexer_and_attn. As a result the Q up-projection and _fused_qnorm_rope_kv_insert(q, kv, positions, attn_metadata) — which is metadata dependent — now run inside the captured CUDA graph rather than in the eager break, with attn_metadata bound at capture time. Replaying that graph reuses the captured slot mapping, so KV entries are written to stale locations and attention reads garbage.

Attribution

#51430 is the only change to vllm/models/deepseek_v4/attention.py in the range fac808b3..635dd6aa. Other DeepSeek-V4-adjacent commits in the range were ruled out: #50693 only relaxes a warmup assert in flashmla.py, #51296 touches the reasoning parser only (which cannot affect MTP acceptance), and #51602 touches parallel-drafting init for DSpark.

The revert applied cleanly with no conflicts and the resulting diff is an exact inverse of #51430.

This is a performance optimization, so reverting restores correctness at the cost of the TTFT improvement. Happy to close this in favor of a fix-forward that keeps the KV insert in the eager region.

Auto-generated by CI failure analyzer.

@mergify mergify Bot added deepseek Related to DeepSeek models nvidia labels Aug 11, 2026
@WoosukKwon

Copy link
Copy Markdown
Collaborator

On it.

WoosukKwon commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

I reproduced the regression as specific to the legacy V1 model runner's breakable PIECEWISE CUDA-graph path: the exact post-#51430 commit reached only 0.0311 GSM8K and 3–5% MTP draft acceptance under MRV1, while the unchanged code reached 0.9570 and 80.7–81.4% under MRV2. I revised #51768 into a narrower alternative to this revert: it leaves attention unchanged, defaults DeepseekV4ForCausalLM to MRV2, and raises only when DeepSeek V4 uses MRV1 with PIECEWISE or FULL_AND_PIECEWISE CUDA graphs. MRV1 eager/NONE, FULL, and FULL_DECODE_ONLY remain allowed. An unmodified current-main MRV2 run over all 1,319 questions reached 0.9500 GSM8K and 81.1–82.1% draft acceptance.

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

Labels

deepseek Related to DeepSeek models nvidia

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants