From acb0f1dcdb668d90bbbf50e57552d2f6f0987c87 Mon Sep 17 00:00:00 2001 From: Yongye Zhu Date: Fri, 14 Aug 2026 18:32:59 -0700 Subject: [PATCH] [Bugfix][Spec Decode] DSpark: inherit the target's attention backend when the speculative config names none (#52288) --- vllm/v1/worker/gpu/spec_decode/dspark/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vllm/v1/worker/gpu/spec_decode/dspark/utils.py b/vllm/v1/worker/gpu/spec_decode/dspark/utils.py index 13c7644315..78ae392132 100644 --- a/vllm/v1/worker/gpu/spec_decode/dspark/utils.py +++ b/vllm/v1/worker/gpu/spec_decode/dspark/utils.py @@ -21,12 +21,18 @@ def load_dspark_model(target_model: nn.Module, vllm_config: VllmConfig) -> nn.Mo from vllm.model_executor.models.qwen3_dflash import dflash_has_any_non_causal from vllm.model_executor.models.utils import get_draft_quant_config + # None re-runs backend auto-selection for the draft, which can pick a + # different attention class than the target; fall back to the target's. + draft_attention_backend = ( + speculative_config.attention_backend or vllm_config.attention_config.backend + ) + draft_vllm_config = replace( vllm_config, attention_config=replace( vllm_config.attention_config, use_non_causal=dflash_has_any_non_causal(draft_model_config.hf_config), - backend=speculative_config.attention_backend, + backend=draft_attention_backend, ), cache_config=( replace(