@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / daec4d2624
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

[Model]Improve Qwen3VLMoeForConditionalGeneration packed_modules_mapping (#27096)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>

Jee Jee Li committed Oct 17, 2025 at 19:47 UTC daec4d2624cb816b92d5463c7f47878a342c7e76
1 file changed +13
vllm/model_executor/models/qwen3_vl_moe.py
+13
@@ -350,6 +350,14 @@ class Qwen3MoeLLMForCausalLM(Qwen3MoeForCausalLM):
350 dummy_inputs=Qwen3VLDummyInputsBuilder,
351 )
352 class Qwen3VLMoeForConditionalGeneration(Qwen3VLForConditionalGeneration):
353 + packed_modules_mapping = {
354 + "qkv_proj": [
355 + "q_proj",
356 + "k_proj",
357 + "v_proj",
358 + ],
359 + }
360 +
361 def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
362 super(Qwen3VLForConditionalGeneration, self).__init__()
363 config: Qwen3VLMoeConfig = vllm_config.model_config.hf_config
@@ -376,6 +384,11 @@ class Qwen3VLMoeForConditionalGeneration(Qwen3VLForConditionalGeneration):
384 self.language_model = Qwen3MoeLLMForCausalLM(
385 vllm_config=vllm_config, prefix=maybe_prefix(prefix, "language_model")
386 )
387 + # Whether to include the gate_up_proj mapping is determined by
388 + # the language model.
389 + self.packed_modules_mapping = (
390 + self.packed_modules_mapping | self.language_model.packed_modules_mapping
391 + )
392
393 self.make_empty_intermediate_tensors = (
394 self.language_model.make_empty_intermediate_tensors