From 2c976ecb58444da97dd0e33e775445b6717405f6 Mon Sep 17 00:00:00 2001 From: andrewwhitecdw Date: Wed, 12 Aug 2026 14:28:46 -0500 Subject: [PATCH] fix: guard MoE branch when quantization_format is None Signed-off-by: andrewwhitecdw --- modelopt/torch/export/unified_export_hf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modelopt/torch/export/unified_export_hf.py b/modelopt/torch/export/unified_export_hf.py index f51eea17b1a..0a0900d7a72 100644 --- a/modelopt/torch/export/unified_export_hf.py +++ b/modelopt/torch/export/unified_export_hf.py @@ -448,7 +448,8 @@ def requantize_resmooth_fused_llm_layers(model: torch.nn.Module): # For MoE models update pre_quant_scale to average pre_quant_scale amongst experts if is_moe(module) and ( - quantization_format is not QUANTIZATION_NONE + quantization_format is not None + and quantization_format != QUANTIZATION_NONE and ("awq" in quantization_format or quantization_format == QUANTIZATION_NVFP4_SVDQUANT) ): # update_experts_avg_prequant_scale(module)