@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 19f76ee68e
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[misc] refactor speculative config (#25657)

Signed-off-by: zxw <1020938856@qq.com>

yyzxw committed Sep 26, 2025 at 16:22 UTC 19f76ee68e60c71d7848ec73f5aa9e0d2ab9dbc4
1 file changed +6 -8
vllm/config/speculative.py
+6 -8
@@ -209,12 +209,9 @@ class SpeculativeConfig:
209
210 if self.model is None and self.num_speculative_tokens is not None:
211 # TODO(Shangming): Refactor mtp configuration logic when supporting
212 - # mtp acceleration for more models besides deepseek_v3
213 - if self.target_model_config and \
214 - (self.target_model_config.hf_text_config.model_type \
215 - == "deepseek_v3" or
216 - self.target_model_config.hf_text_config.model_type in
217 - ("mimo","ernie4_5_moe", "qwen3_next")):
212 + if (self.target_model_config
213 + and self.target_model_config.hf_text_config.model_type
214 + in ("deepseek_v3", "mimo", "ernie4_5_moe", "qwen3_next")):
215 # use the draft model from the same model:
216 self.model = self.target_model_config.model
217 # Align the quantization of draft model for cases such as
@@ -224,8 +221,9 @@ class SpeculativeConfig:
221 elif self.method in ("ngram", "[ngram]"):
222 self.model = "ngram"
223 else:
227 - raise ValueError("num_speculative_tokens was provided without "
228 - "speculative model.")
224 + raise ValueError(
225 + "num_speculative_tokens was provided but without "
226 + "speculative model.")
227
228 # Automatically configure the method for ngram when "model" is used
229 # instead of "method"