@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 75f0d516c4
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 4, 03:45 UTC

[Bugfix] Fix GLM4-MoE weight loading for NVFP4 quantized checkpoints (#41755)

Signed-off-by: Stoyan Yanev <stoyan.yanev@cleverpine.com>

s-yanev committed May 7, 2026 at 15:55 UTC 75f0d516c43cc664bec51409e0f0ddccef5d53e6
1 file changed +10 -2
vllm/model_executor/models/glm4_moe.py
+10 -2
@@ -506,16 +506,24 @@ class Glm4MoeModel(nn.Module):
506 # for mlp.experts[0].gate_gate_up_proj, which breaks load.
507 if ("mlp.experts." in name) and name not in params_dict:
508 continue
509 +
510 name = name.replace(weight_name, param_name)
511 # Skip loading extra bias for GPTQ models.
512 if name.endswith(".bias") and name not in params_dict:
513 continue
514 +
515 + name = maybe_remap_kv_scale_name(name, params_dict)
516 + if name is None:
517 + continue
518 if is_pp_missing_parameter(name, self):
519 continue
520
521 param = params_dict[name]
517 - weight_loader = param.weight_loader
518 - weight_loader(param, loaded_weight, shard_id)
522 + weight_loader = getattr(param, "weight_loader", default_weight_loader)
523 + if weight_loader == default_weight_loader:
524 + weight_loader(param, loaded_weight)
525 + else:
526 + weight_loader(param, loaded_weight, shard_id)
527 break
528 else:
529 is_expert_weight = False