[Bugfix] Fix DeepseekV4FP8 Quark MXFP4 crash on list-valued weight (#49634)
Signed-off-by: Colin Zeng <Colin.Zeng@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
Colin Z committed
Jul 27, 2026 at 20:32 UTC
fbb1ef68030991a14291231bf8877063b57e1ada
1 file changed
+5
-1
vllm/models/deepseek_v4/quant_config.py
+5
-1
@@ -120,7 +120,11 @@ class DeepseekV4FP8Config(Fp8Config):
120
@staticmethod
121
def _is_quark_mxfp4_ocp(hf_quant_cfg: dict) -> bool:
122
"""True for AMD-Quark exports whose global scheme is MXFP4."""
123
- weight = (hf_quant_cfg.get("global_quant_config") or {}).get("weight") or {}
123
+ weight = (hf_quant_cfg.get("global_quant_config") or {}).get("weight")
124
+ # A non-dict weight (e.g. a list of multiple specs) means not an OCP
125
+ # MXFP4 scheme (e.g. NVFP4 with 2-level scale).
126
+ if not isinstance(weight, dict):
127
+ return False
128
return (
129
weight.get("dtype") == "fp4"
130
and weight.get("qscheme") == "per_group"