Skip to content

Commit

Permalink
align tests to new MCTQ release
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-c committed Apr 11, 2024
1 parent c52b994 commit f6a728d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ def get_weights_quantization_config(self):
def run_test(self):
with self.unit_test.assertRaises(Exception) as e:
ZeroWeightsQuantizer(self.get_weights_quantization_config())
# TODO: In next MCTQ release, this test will fail due to KMEANS removal. Fix: "QuantizationMethod.SYMMETRIC: 3" -> "QuantizationMethod.SYMMETRIC: 2"
self.unit_test.assertEqual(f'Quantization method mismatch. Expected methods: [<QuantizationMethod.POWER_OF_TWO: 0>, '
f''f'<QuantizationMethod.SYMMETRIC: 3>], received: QuantizationMethod.UNIFORM.',
f'<QuantizationMethod.SYMMETRIC: 2>], received: QuantizationMethod.UNIFORM.',
str(e.exception))

with self.unit_test.assertRaises(Exception) as e:
Expand Down Expand Up @@ -73,9 +72,8 @@ def get_activation_quantization_config(self):
def run_test(self):
with self.unit_test.assertRaises(Exception) as e:
ZeroActivationsQuantizer(self.get_activation_quantization_config())
# TODO: In next MCTQ release, this test will fail due to KMEANS removal. Fix: "QuantizationMethod.SYMMETRIC: 3" -> "QuantizationMethod.SYMMETRIC: 2"
self.unit_test.assertEqual(f'Quantization method mismatch. Expected methods: [<QuantizationMethod.POWER_OF_TWO: 0>, '
f'<QuantizationMethod.SYMMETRIC: 3>], received: QuantizationMethod.UNIFORM.',
f'<QuantizationMethod.SYMMETRIC: 2>], received: QuantizationMethod.UNIFORM.',
str(e.exception))

with self.unit_test.assertRaises(Exception) as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def run_test(self):

with self.unit_test.assertRaises(Exception) as e:
ZeroWeightsQuantizer(self.get_weights_quantization_config())
# TODO: In next MCTQ release, this test will fail due to KMEANS removal. Fix: "QuantizationMethod.SYMMETRIC: 3" -> "QuantizationMethod.SYMMETRIC: 2"
self.unit_test.assertEqual(f'Quantization method mismatch. Expected methods: [<QuantizationMethod.POWER_OF_TWO: 0>, <QuantizationMethod.SYMMETRIC: 3>], received: QuantizationMethod.UNIFORM.', str(e.exception))
self.unit_test.assertEqual(f'Quantization method mismatch. Expected methods: [<QuantizationMethod.POWER_OF_TWO: 0>, <QuantizationMethod.SYMMETRIC: 2>], received: QuantizationMethod.UNIFORM.', str(e.exception))

with self.unit_test.assertRaises(Exception) as e:
ZeroWeightsQuantizer(self.get_activation_quantization_config())
Expand All @@ -67,8 +66,7 @@ def run_test(self):

with self.unit_test.assertRaises(Exception) as e:
ZeroActivationsQuantizer(self.get_activation_quantization_config())
# TODO: In next MCTQ release, this test will fail due to KMEANS removal. Fix: "QuantizationMethod.SYMMETRIC: 3" -> "QuantizationMethod.SYMMETRIC: 2"
self.unit_test.assertEqual(f'Quantization method mismatch. Expected methods: [<QuantizationMethod.POWER_OF_TWO: 0>, <QuantizationMethod.SYMMETRIC: 3>], received: QuantizationMethod.UNIFORM.', str(e.exception))
self.unit_test.assertEqual(f'Quantization method mismatch. Expected methods: [<QuantizationMethod.POWER_OF_TWO: 0>, <QuantizationMethod.SYMMETRIC: 2>], received: QuantizationMethod.UNIFORM.', str(e.exception))

with self.unit_test.assertRaises(Exception) as e:
ZeroActivationsQuantizer(self.get_weights_quantization_config())
Expand Down

0 comments on commit f6a728d

Please sign in to comment.