From a5b6ef802a1ffddda581f5df452d2cecd2534171 Mon Sep 17 00:00:00 2001 From: Uri Livne Date: Sun, 28 Jul 2024 13:34:04 +0300 Subject: [PATCH] [SW-184689] Adjust correct condition for one step flow align to 1.17 Change-Id: I588680b463a9f8304d95863306b6d5b2503e6e62 --- neural_compressor/torch/algorithms/fp8_quant/fp8_quant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neural_compressor/torch/algorithms/fp8_quant/fp8_quant.py b/neural_compressor/torch/algorithms/fp8_quant/fp8_quant.py index f168d322844..f79e9810a04 100644 --- a/neural_compressor/torch/algorithms/fp8_quant/fp8_quant.py +++ b/neural_compressor/torch/algorithms/fp8_quant/fp8_quant.py @@ -38,8 +38,8 @@ def prepare(self, model): return model def convert(self, model): - if getattr(model, "prepared", False) and with_patched_module(model): # if model was calibrated on hpu - finish_measurements(model) + if with_patched_module(model): # if model was calibrated on hpu + finish_measurements(model) # dump the measurements into files to be loaded in _convert # for INC flow, it calls `prepare` and then `convert` user-facing API in one run restore_patched_module(model) _convert(model, self.quant_config)