spec-decode: honor the speculative-config attention backend for the DFlash draft - #19
Conversation
…Flash draft
load_dflash_model rewrites the draft's attention config to set its
causal/non-causal mode but does not propagate
speculative_config.attention_backend. The draft therefore always
auto-selects an attention backend, which on Blackwell prefers FlashInfer
regardless of what the speculative config requests (e.g. TRITON_ATTN).
With a DFlash draft beside an MLA target (Kimi-K2.7-Code):
- under DCP the engine fails to start with "FlashInfer non-causal
prefill is not supported with DCP yet";
- without DCP the spec-decode cudagraph is downgraded FULL -> PIECEWISE
("CUDAGraphMode.FULL_AND_PIECEWISE is not supported with spec-decode
for attention backend FlashInferBackend");
- the user's speculative_config.attention_backend is silently ignored.
Thread the speculative-config backend into the draft's attention config,
matching what llm_base_proposer already does ("never inherit the
attention backend from base ... unless explicitly specified in the
speculative config"). When the spec config leaves it unset the behaviour
is unchanged (auto-select).
Validated on Kimi-K2.7-Code TP8 + Kimi-K2.6 DFlash draft, V2 runner,
attention_backend=TRITON_ATTN, kv-fp8:
- DCP8: previously failed to start; now boots, FULL draft graph captured,
0k C1 decode 113.6 tok/s vs 81.5 target-only (+39%), output coherent.
- DCP1: 0k C1 decode 140 tok/s vs 125 with the auto-selected FlashInfer.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesDFlash draft model attention config override
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The V2 DFlash draft loader (
load_dflash_model) rewrites the draft's attentionconfig to set its causal/non-causal mode, but drops
speculative_config.attention_backend. The draft then auto-selects anattention backend, which on Blackwell prefers FlashInfer regardless of what
the speculative config requests (e.g.
TRITON_ATTN).Symptoms (DFlash draft beside an MLA target, e.g. Kimi-K2.7-Code)
FlashInfer non-causal prefill is not supported with DCP yet.CUDAGraphMode.FULL_AND_PIECEWISE is not supported with spec-decode for attention backend FlashInferBackend.speculative_config.attention_backendis silently ignored.Root cause / fix
load_dflash_modeldoesreplace(attention_config, use_non_causal=...)butnever sets
backend=. The V1llm_base_proposeralready threads thespec-config backend through (with the comment "never inherit the attention
backend from base ... unless explicitly specified in the speculative config").
This restores that one line for the V2 DFlash path. When the spec config leaves
attention_backendunset, behaviour is unchanged (auto-select).Testing
Kimi-K2.7-Code TP8 + Kimi-K2.6 DFlash draft, V2 model runner, kv-fp8,
--speculative-config '{"method":"dflash", ..., "attention_backend":"TRITON_ATTN"}'.Smoke + throughput at 0k context, concurrency 1:
Both configurations confirmed running on the V2 model runner with coherent
output.
Why this is not duplicating an existing PR
gh pr list --repo local-inference-lab/vllm --state open— the only open PR (#8,codex/ds4-step35-mtp-local-argmax-spec-step) targets MTP local-argmax, anunrelated area. No open PR touches the DFlash draft attention backend.
AI assistance
This change was drafted with AI assistance (Claude, Anthropic) and reviewed,
built, and validated end-to-end by the submitter on a Blackwell rig.
Summary by CodeRabbit