[Bugfix] Fix fp8_ds_mla config leak in DSpark speculative decoding#48415
Closed
pranavthakur0-0 wants to merge 3 commits into
Closed
[Bugfix] Fix fp8_ds_mla config leak in DSpark speculative decoding#48415pranavthakur0-0 wants to merge 3 commits into
pranavthakur0-0 wants to merge 3 commits into
Conversation
…che dtype normalization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When an MLA model (like GLM-5.2 or DeepSeek) is initialized with
--kvcache-dtype fp8, theMLAAttentionandDeepseekV4Attentionconstructors secretly mutated the globally sharedcache_configinstance to forcecache_config.cache_dtype = "fp8_ds_mla".When running speculative decoding (like dspark) alongside it, the draft model uses standard attention layers that read this poisoned global config. Standard backends (FlashAttention, Triton) do not support the DeepSeek-specific MLA memory layout, causing the
AttentionSelectorto immediately crash with an unhandledValueError.Changes
vllm/model_executor/layers/attention/mla_attention.pyandvllm/models/deepseek_v4/attention.pycache_config.cache_dtype = "fp8_ds_mla"assignments.MLAAttentionnow isolates"fp8_ds_mla"strictly to its internalself.kv_cache_dtypestate.Related Issue
Closes #48406
Test Results
Legacy (Without patch):
Fixed (With patch):