From 9321e4447e7ffc857a5ed304e2641e789198aa9f Mon Sep 17 00:00:00 2001 From: Sandeep Maddipatla Date: Tue, 10 Jun 2025 07:20:17 +0000 Subject: [PATCH] Handle module names from Dynamo compiler in FP8 Quantizer - Quantizer equivalent for how the measure component handles the same scenario --- neural_compressor/torch/algorithms/fp8_quant/_core/quantize.py | 1 + 1 file changed, 1 insertion(+) diff --git a/neural_compressor/torch/algorithms/fp8_quant/_core/quantize.py b/neural_compressor/torch/algorithms/fp8_quant/_core/quantize.py index b3ff133f0d7..f93c2d0caf4 100644 --- a/neural_compressor/torch/algorithms/fp8_quant/_core/quantize.py +++ b/neural_compressor/torch/algorithms/fp8_quant/_core/quantize.py @@ -139,6 +139,7 @@ def prepare_model(model, mod_list, measurement, scale_file, scaling_method_name, should_quantize_cond = True # In static quantization we quantize everything with torch.no_grad(): for name, mod in model.named_modules(): + name = name.replace("_orig_mod.", "") # remove _orig_mod part added by dynamo mechanism mod_type_str = mod.__class__.__name__ if is_dynamic_quantization: # TODO [SW-217813]: support dynamic quantization in all ops and remove supported_dynamic_ops, then move outside the loop