Skip to content

Commit

Permalink
Fix MP test and coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-c committed Jan 21, 2025
1 parent 182d9c9 commit 6e70525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion model_compression_toolkit/core/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def core_runner(in_model: Any,

# Checking whether to run mixed precision quantization
if target_resource_utilization is not None and target_resource_utilization.is_any_restricted():
if core_config.mixed_precision_config is None:
if core_config.mixed_precision_config is None: # pragma: no cover
Logger.critical("Provided an initialized target_resource_utilization, that means that mixed precision quantization is "
"enabled, but the provided MixedPrecisionQuantizationConfig is None.")
if target_resource_utilization.activation_restricted() or target_resource_utilization.total_mem_restricted():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,7 @@ def get_tpc(self):

def get_resource_utilization(self):
return mct.core.ResourceUtilization(activation_memory=6000)

def compare(self, quantized_model, float_model, input_x=None, quantization_info=None):
self.unit_test.assertTrue(len(quantization_info.mixed_precision_cfg) > 0, "Expected mixed-precision in test.")
super().compare(quantized_model, float_model, input_x=input_x, quantization_info=quantization_info)

0 comments on commit 6e70525

Please sign in to comment.