2626from nncf .common .factory import NNCFGraphFactory
2727from nncf .common .utils .caching import ResultsCache
2828from nncf .common .utils .caching import cache_results
29- from nncf .openvino .cpu_info import is_arm_cpu
3029from nncf .openvino .graph .node_utils import get_const_value_as_ov_tensor
3130from nncf .quantization .algorithms .weight_compression .config import WeightCompressionConfig
3231from nncf .quantization .algorithms .weight_compression .weight_lowering import MIN_INPUT_SIZE_FOR_OPTIMIZED_COMPRESSION
@@ -123,10 +122,6 @@ def openvino_available(available: bool):
123122 yield
124123
125124
126- @pytest .mark .xfail (
127- is_arm_cpu (),
128- reason = "Due to a bug in CPU plugin compression models can fail at compilation on ARM CPUs. Ticket: 164135." ,
129- )
130125@pytest .mark .parametrize (
131126 "weight_shape,is_disabled" ,
132127 [
@@ -154,10 +149,6 @@ def test_optimized_compression_is_disabled(weight_shape, is_disabled, quantizati
154149 mock .assert_called_once ()
155150
156151
157- @pytest .mark .xfail (
158- is_arm_cpu (),
159- reason = "Due to a bug in CPU plugin compression models can fail at compilation on ARM CPUs. Ticket: 164135." ,
160- )
161152@pytest .mark .parametrize ("weight_shape" , [WEIGHT_SHAPE ], ids = ["" ])
162153@pytest .mark .parametrize ("config" , COMPRESSION_CONFIGS , ids = [str (c ) for c in COMPRESSION_CONFIGS ])
163154@pytest .mark .parametrize (
@@ -277,10 +268,6 @@ def test_quantization_alignment(weight_shape, config, quantization_task, tensor_
277268 _check_values (results )
278269
279270
280- @pytest .mark .xfail (
281- is_arm_cpu (),
282- reason = "Due to a bug in CPU plugin compression models can fail at compilation on ARM CPUs. Ticket: 164135." ,
283- )
284271@pytest .mark .parametrize ("weight_shape" , [WEIGHT_SHAPE ], ids = ["" ])
285272@pytest .mark .parametrize ("config" , INT4_COMPRESSION_CONFIGS , ids = [str (c ) for c in INT4_COMPRESSION_CONFIGS ])
286273@pytest .mark .parametrize ("tensor_backend" , [TensorBackend .numpy , "auto" ])
@@ -312,10 +299,6 @@ def test_integer_quantization_error_alignment(weight_shape, config, tensor_backe
312299 _check_values (results , atol = 1e-6 )
313300
314301
315- @pytest .mark .xfail (
316- is_arm_cpu (),
317- reason = "Due to a bug in CPU plugin compression models can fail at compilation on ARM CPUs. Ticket: 164135." ,
318- )
319302@pytest .mark .parametrize ("weight_shape" , [WEIGHT_SHAPE ], ids = ["" ])
320303@pytest .mark .parametrize ("weight_dtype" , SUPPORTED_WEIGHT_DTYPES )
321304@pytest .mark .parametrize ("config" , COMPRESSION_CONFIGS , ids = [str (c ) for c in COMPRESSION_CONFIGS ])
@@ -512,8 +495,8 @@ def _check_backends_and_dtypes(
512495
513496
514497def _check_values (results , atol = 0.0 ):
515- def format_list_of_floats (lst ):
516- return ", " .join (f"{ x :.10f} " for x in lst )
498+ def format_list_of_floats (lst , n_first = 32 ):
499+ return ", " .join (f"{ x :.10f} " for x in lst [: n_first ] )
517500
518501 # Check that the computed tensors are equal between implementations
519502 keys = set (results [ComputationBackend .OV ]).union (set (results [ComputationBackend .NumPy ]))
@@ -535,16 +518,18 @@ def format_list_of_floats(lst):
535518 msg = (
536519 f"Results do not align for { key } with "
537520 f"{ not_equal_mask .sum () / ov_result .data .size * 100 :.2f} % misalignment ratio.\n "
538- f"OV result: { format_list_of_floats (ov_result .data [not_equal_mask ])} \n "
539- f"NumPy result: { format_list_of_floats (numpy_result .data [not_equal_mask ])} \n "
521+ f"OV result (first 32 values) : { format_list_of_floats (ov_result .data [not_equal_mask ])} \n "
522+ f"NumPy result (first 32 values) : { format_list_of_floats (numpy_result .data [not_equal_mask ])} \n "
540523 )
541524 if "input" in results [ComputationBackend .OV ] and "input" in results [ComputationBackend .NumPy ]:
542525 numpy_input = results [ComputationBackend .NumPy ]["input" ].data
543526 ov_input = results [ComputationBackend .OV ]["input" ].data
544527 np .testing .assert_allclose (numpy_input , ov_input , atol = 0 , rtol = 0 )
545- msg += f"Input values : { format_list_of_floats (numpy_input [not_equal_mask ])} \n "
528+ if "weight" in key :
529+ msg += f"Input values (first 32 values) : { format_list_of_floats (numpy_input [not_equal_mask ])} \n "
546530 misaligned_groups_mask = np .any (not_equal_mask , axis = - 1 )
547531 misaligned_groups = numpy_input [misaligned_groups_mask , ...]
548532 misaligned_groups = np .reshape (misaligned_groups , (- 1 , misaligned_groups .shape [- 1 ]))
549- msg += f"First 10 misaligned groups: { [it for it in misaligned_groups ][:10 ]} \n "
533+ msg += "First 10 misaligned groups:\n "
534+ msg += "\n " .join (format_list_of_floats (it , misaligned_groups .shape [1 ]) for it in misaligned_groups [:10 ])
550535 raise AssertionError (msg )
0 commit comments