From fbb1ef68030991a14291231bf8877063b57e1ada Mon Sep 17 00:00:00 2001 From: Colin Z <59755453+ColinZ22@users.noreply.github.com> Date: Mon, 27 Jul 2026 20:32:42 -0700 Subject: [PATCH] [Bugfix] Fix DeepseekV4FP8 Quark MXFP4 crash on list-valued weight (#49634) Signed-off-by: Colin Zeng Co-authored-by: Andreas Karatzas --- vllm/models/deepseek_v4/quant_config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vllm/models/deepseek_v4/quant_config.py b/vllm/models/deepseek_v4/quant_config.py index 89cf695baf..293d71f2f4 100644 --- a/vllm/models/deepseek_v4/quant_config.py +++ b/vllm/models/deepseek_v4/quant_config.py @@ -120,7 +120,11 @@ class DeepseekV4FP8Config(Fp8Config): @staticmethod def _is_quark_mxfp4_ocp(hf_quant_cfg: dict) -> bool: """True for AMD-Quark exports whose global scheme is MXFP4.""" - weight = (hf_quant_cfg.get("global_quant_config") or {}).get("weight") or {} + weight = (hf_quant_cfg.get("global_quant_config") or {}).get("weight") + # A non-dict weight (e.g. a list of multiple specs) means not an OCP + # MXFP4 scheme (e.g. NVFP4 with 2-level scale). + if not isinstance(weight, dict): + return False return ( weight.get("dtype") == "fp4" and weight.get("qscheme") == "per_group"