GLM-5/5.1 MXFP4 Checkpoint Inference Compatibility Fix (#22543)

Co-authored-by: HAI <hixiao@gmail.com>
This commit is contained in:
Colin Z
2026-04-13 23:56:48 -07:00
committed by GitHub
co-authored by HAI
parent 8fe9bbffb6
commit b10f852118
3 changed files with 8 additions and 0 deletions
+3
View File
@@ -198,6 +198,9 @@ def _get_quantization_config(
packed_modules_mapping = getattr(model_class, "packed_modules_mapping", {})
remap_prefix = getattr(model_class, "remap_prefix", None)
# TODO: we should remove this code and switch to the packed_modules_mapping declared inside the modeling files
if model_config.quantization == "quark":
packed_modules_mapping.update({"gate_up_proj": ["gate_proj", "up_proj"]})
if _is_npu:
packed_modules_mapping.update(
{
@@ -560,6 +560,9 @@ class DeepseekV2WeightLoaderMixin:
_use_aiter_gfx95
and self.quant_config is not None
and self.quant_config.get_name() == "quark"
and self.config.architectures
and self.config.architectures[0]
== "DeepseekV3ForCausalLM" # Avoid processing other models like GlmMoeDsaForCausalLM
):
w_kc, self_attn.w_scale_k, w_vc, self_attn.w_scale_v = (
quark_post_load_weights(self_attn, w, "mxfp4")
+2
View File
@@ -1016,6 +1016,8 @@ class ServerArgs:
self.served_model_name = self.model_path
if self.device is None:
self.device = get_device()
# strip device index from user if any (e.g. "cuda:0" -> "cuda")
self.device = self.device.split(":")[0]
if self.random_seed is None:
self.random_seed = random.randint(0, 1 << 30)
if self.mm_process_config is None: