[Bugfix][Quantization][MoE] Route weight only NVFP4 checkpoints through W4A16 (#54427)
Signed-off-by: Aditya Jha <4adityajha@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
Aditya Jha committed
Aug 30, 2026 at 22:32 UTC
9d0fe9bac89d0bda98f977770f5ae88b386e981a
1 file changed
+16
vllm/model_executor/layers/quantization/modelopt.py
+16
@@ -1081,6 +1081,22 @@ class ModelOptNvFp4Config(ModelOptQuantConfigBase):
1081
) -> "ModelOptNvFp4Config":
1082
is_checkpoint_nvfp4_serialized = "NVFP4" in quant_method
1083
1084
+ # A checkpoint can declare quant_algo "NVFP4" yet quantize weights
1085
+ # only (input_activations is null in every config group). The W4A4
1086
+ # MoE path then folds an uninitialized input_scale that was never
1087
+ # loaded and can zero every expert, so route it through W4A16.
1088
+ if quant_method == "NVFP4":
1089
+ config_groups = original_config.get("config_groups")
1090
+ if (
1091
+ isinstance(config_groups, dict)
1092
+ and config_groups
1093
+ and all(
1094
+ isinstance(group, dict) and group.get("input_activations") is None
1095
+ for group in config_groups.values()
1096
+ )
1097
+ ):
1098
+ quant_method = "W4A16_NVFP4"
1099
+
1100
if group_size is None:
1101
group_size = 16 # Default value
1102