From efd03082428141606dcf699037e02d9c07f691f2 Mon Sep 17 00:00:00 2001 From: irenab Date: Tue, 14 Jan 2025 18:39:05 +0200 Subject: [PATCH] fix tests --- .../feature_networks/mixed_precision_tests.py | 14 -------------- .../weights_mixed_precision_tests.py | 11 ----------- 2 files changed, 25 deletions(-) diff --git a/tests/keras_tests/feature_networks_tests/feature_networks/mixed_precision_tests.py b/tests/keras_tests/feature_networks_tests/feature_networks/mixed_precision_tests.py index bead6d017..7f0bed284 100644 --- a/tests/keras_tests/feature_networks_tests/feature_networks/mixed_precision_tests.py +++ b/tests/keras_tests/feature_networks_tests/feature_networks/mixed_precision_tests.py @@ -174,13 +174,6 @@ def compare(self, quantized_model, float_model, input_x=None, quantization_info= # test with its current setup (therefore, we don't check the input layer's bitwidth) self.unit_test.assertTrue((activation_bits == [4, 8])) - # Verify final resource utilization - self.unit_test.assertTrue( - quantization_info.final_resource_utilization.total_memory == - quantization_info.final_resource_utilization.weights_memory + quantization_info.final_resource_utilization.activation_memory, - "Running weights and activation mixed-precision, " - "final total memory should be equal to sum of weights and activation memory.") - class MixedPrecisionActivationSearch2BitsAvgTest(MixedPrecisionActivationBaseTest): def __init__(self, unit_test): @@ -206,13 +199,6 @@ def compare(self, quantized_model, float_model, input_x=None, quantization_info= activation_layers_idx=self.activation_layers_idx, unique_tensor_values=4) - # Verify final resource utilization - self.unit_test.assertTrue( - quantization_info.final_resource_utilization.total_memory == - quantization_info.final_resource_utilization.weights_memory + quantization_info.final_resource_utilization.activation_memory, - "Running weights and activation mixed-precision, " - "final total memory should be equal to sum of weights and activation memory.") - class MixedPrecisionActivationDepthwiseTest(MixedPrecisionActivationBaseTest): def __init__(self, unit_test): diff --git a/tests/keras_tests/feature_networks_tests/feature_networks/weights_mixed_precision_tests.py b/tests/keras_tests/feature_networks_tests/feature_networks/weights_mixed_precision_tests.py index b6e5344e2..328e3674d 100644 --- a/tests/keras_tests/feature_networks_tests/feature_networks/weights_mixed_precision_tests.py +++ b/tests/keras_tests/feature_networks_tests/feature_networks/weights_mixed_precision_tests.py @@ -341,12 +341,6 @@ def compare(self, quantized_model, float_model, input_x=None, quantization_info= self.unit_test.assertTrue(quantization_info.final_resource_utilization.activation_memory <= self.target_total_ru.activation_memory) - self.unit_test.assertTrue( - quantization_info.final_resource_utilization.weights_memory + quantization_info.final_resource_utilization.activation_memory == - quantization_info.final_resource_utilization.total_memory, - "Running weights mixed-precision with unconstrained Resource Utilization, " - "final weights and activation memory sum should be equal to total memory.") - class MixedPrecisionSearchTotalMemoryNonConfNodesTest(MixedPrecisionBaseTest): def __init__(self, unit_test): @@ -362,11 +356,6 @@ def compare(self, quantized_model, float_model, input_x=None, quantization_info= # we're only interested in the ResourceUtilization self.unit_test.assertTrue( quantization_info.final_resource_utilization.total_memory <= self.target_total_ru.total_memory) - self.unit_test.assertTrue( - quantization_info.final_resource_utilization.weights_memory + quantization_info.final_resource_utilization.activation_memory == - quantization_info.final_resource_utilization.total_memory, - "Running weights mixed-precision with unconstrained ResourceUtilization, " - "final weights and activation memory sum should be equal to total memory.") class MixedPrecisionDepthwiseTest(MixedPrecisionBaseTest):