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 8, 03:45 UTC
[Bugfix] Fix prefix creation for Qwen3.5 (#34723)
Signed-off-by: mgoin <mgoin64@gmail.com>
Michael Goin committed
Feb 18, 2026 at 02:39 UTC
909b14719725f9647591b63151c45ff396fb4524
1 file changed
+6
-5
vllm/model_executor/models/qwen3_5.py
+6
-5
@@ -676,9 +676,10 @@ class Qwen3_5ForCausalLMBase(
676
super().__init__()
677
self.config = config
678
self.scheduler_config = scheduler_config
679
- self.model = Qwen3_5Model(
680
- vllm_config=vllm_config, prefix=maybe_prefix(prefix, "model")
681
- )
679
+ # Deal with the case where the prefix is already "language_model" since
680
+ # Qwen/Qwen3.5-397B-A17B has naming like: model.language_model.layers.0
681
+ model_prefix = prefix if "model" in prefix else "model"
682
+ self.model = Qwen3_5Model(vllm_config=vllm_config, prefix=model_prefix)
683
684
if get_pp_group().is_last_rank:
685
if config.tie_word_embeddings:
@@ -754,7 +755,7 @@ class Qwen3_5MoeForCausalLM(Qwen3_5ForCausalLMBase, QwenNextMixtureOfExperts):
755
dummy_inputs=Qwen3VLDummyInputsBuilder,
756
)
757
class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration, IsHybrid):
757
- def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
758
+ def __init__(self, *, vllm_config: VllmConfig, prefix: str = "model"):
759
# protocols have not __init__ method, so we need to use nn.Module.__init__
760
nn.Module.__init__(self)
761
config: Qwen3_5Config = vllm_config.model_config.hf_config
@@ -962,7 +963,7 @@ class Qwen3_5_MoeMixtureOfExperts(MixtureOfExperts):
963
class Qwen3_5MoeForConditionalGeneration(
964
Qwen3_5ForConditionalGeneration, Qwen3_5_MoeMixtureOfExperts
965
):
965
- def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
966
+ def __init__(self, *, vllm_config: VllmConfig, prefix: str = "model"):
967
# protocols have not __init__ method, so we need to use nn.Module.__init__
968
nn.Module.__init__(self)
969
config: Qwen3_5MoeConfig = vllm_config.model_config.hf_config