@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d3ade61e42
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 13, 09:30 UTC

[Model] fix glm4_moe_mtp load weights with GLM-4.6 checkpoint. (#27597)

Signed-off-by: wuao.scotty <wuao.scotty@bytedance.com> Co-authored-by: wuao.scotty <wuao.scotty@bytedance.com>

wuyaoxuehun committed Nov 12, 2025 at 17:14 UTC d3ade61e429fcae40829587244ced9c553120703
1 file changed +11 -4
vllm/model_executor/models/glm4_moe_mtp.py
+11 -4
@@ -256,11 +256,18 @@ class Glm4MoeMTP(nn.Module, SupportsPP, Glm4MixtureOfExperts):
256
257 params_dict = dict(self.named_parameters())
258 loaded_params: set[str] = set()
259 + spec_layer = self.model.mtp_start_layer_idx
260 for name, loaded_weight in weights:
260 - spec_layer = get_spec_layer_idx_from_weight_name(self.config, name)
261 - if spec_layer is None:
262 - continue
263 - name = self._rewrite_spec_layer_name(spec_layer, name)
261 + if name == "lm_head.weight":
262 + name = f"model.layers.{spec_layer}.shard_head.head.weight"
263 + elif name == "model.embed_tokens.weight":
264 + # This name is same with local model, rewriting is not needed.
265 + pass
266 + else:
267 + spec_layer = get_spec_layer_idx_from_weight_name(self.config, name)
268 + if spec_layer is None:
269 + continue
270 + name = self._rewrite_spec_layer_name(spec_layer, name)
271 for param_name, weight_name, shard_id in stacked_params_mapping:
272 # Skip non-stacked layers and experts (experts handled below).
273 if weight_name not in name: