@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / f5dfa07531
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 15, 04:45 UTC

[Bugfix] Skip loading extra parameters for modelopt Qwen3 MoE model (#19598)

Signed-off-by: noiji <>

noiji committed Jun 30, 2025 at 18:21 UTC f5dfa0753163530117b4766c4e79e8cb2dc7066e
1 file changed +15 -9
vllm/model_executor/models/qwen3_moe.py
+15 -9
@@ -386,6 +386,11 @@ class Qwen3MoeModel(nn.Module):
386 ("gate_up_proj", "up_proj", 1),
387 ]
388
389 + # Skip loading extra parameters for GPTQ/modelopt models.
390 + ignore_suffixes = (".bias", "_bias", ".k_scale", "_k_scale",
391 + ".v_scale", "_v_scale", ".weight_scale",
392 + "_weight_scale", ".input_scale", "_input_scale")
393 +
394 # Params for weights, fp8 weight scales, fp8 activation scales
395 # (param_name, weight_name, expert_id, shard_id)
396 expert_params_mapping = FusedMoE.make_expert_params_mapping(
@@ -410,10 +415,11 @@ class Qwen3MoeModel(nn.Module):
415 if "mlp.experts" in name:
416 continue
417 name = name.replace(weight_name, param_name)
413 - # Skip loading extra bias for GPTQ models.
414 - if ((name.endswith(".bias") or name.endswith("_bias"))
415 - and name not in params_dict):
418 +
419 + # Skip loading extra parameters for GPTQ/modelopt models.
420 + if name.endswith(ignore_suffixes) and name not in params_dict:
421 continue
422 +
423 # Skip layers on other devices.
424 if is_pp_missing_parameter(name, self):
425 continue
@@ -433,9 +439,9 @@ class Qwen3MoeModel(nn.Module):
439 # Skip layers on other devices.
440 if is_pp_missing_parameter(name, self):
441 continue
436 - # Skip loading extra bias for GPTQ models.
437 - if ((name.endswith(".bias") or name.endswith("_bias"))
438 - and name not in params_dict):
442 + # Skip loading extra parameters for GPTQ/modelopt models.
443 + if name.endswith(
444 + ignore_suffixes) and name not in params_dict:
445 continue
446 param = params_dict[name]
447 weight_loader = param.weight_loader
@@ -446,9 +452,9 @@ class Qwen3MoeModel(nn.Module):
452 expert_id=expert_id)
453 break
454 else:
449 - # Skip loading extra bias for GPTQ models.
450 - if ((name.endswith(".bias") or name.endswith("_bias"))
451 - and name not in params_dict):
455 + # Skip loading extra parameters for GPTQ/modelopt models.
456 + if name.endswith(
457 + ignore_suffixes) and name not in params_dict:
458 continue
459 # Skip layers on other devices.
460 if is_pp_missing_parameter(name, self):