File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2424
2525def save_calib_result (model ):
2626 import habana_quantization_toolkit as hqt
27- hqt .finish_measurements (model )
27+ if (hasattr (model , "__hqt_config__" ) and
28+ isinstance (model .__hqt_config__ , hqt ._quant_common .quant_config .Fp8cfg )):
29+ # TODO SW-184714 modify hqt notation to inc notation once code is ported
30+ hqt .finish_measurements (model )
31+ else :
32+ raise NotImplementedError ("Saving calibration results currently supported only in HPU." )
33+
2834
2935
3036def update_mode (config_path , measure_step = False , quant_step = False ):
Original file line number Diff line number Diff line change @@ -220,9 +220,5 @@ def convert(
220220
221221
222222def finalize_calibration (model ):
223- if hasattr (model , "quant_config" ) and isinstance (model .quant_config , FP8Config ): # FP8
224223 from neural_compressor .torch .algorithms .fp8_quant import save_calib_result
225-
226224 save_calib_result (model )
227- else :
228- raise NotImplementedError ("`finalize_calibration` only supports FP8 measurement now." )
You can’t perform that action at this time.
0 commit comments