From 01ce30abf57eb23876a9a0fb88052f51c3fc2b58 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Fri, 17 Jul 2020 00:44:48 +0000 Subject: [PATCH 1/6] [Flaky] TFLite quantized conv test --- tests/python/frontend/tflite/test_forward.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index 46d4b46d7a6c..d60061c7b088 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -785,6 +785,7 @@ def representative_data_gen(): def _test_tflite2_quantized_depthwise_convolution(input_shape, kernel_shape, dilations, strides, padding, data_format, depth_multiplier): """One iteration of TFLite2 quantized depthwise convolution with given shapes and attributes""" + np.random.seed(0) data_format = "channels_last" if "NHWC" else "channels_first" data = np.random.uniform(0, 1, input_shape).astype('float32') kernel = np.random.uniform(0, 1, kernel_shape).astype('float32') @@ -818,7 +819,7 @@ def _test_convolution(tensor_in_sizes, filter_in_sizes, dilations, strides, padding, data_format, is_depthwise=False, quantized=False): """ One iteration of convolution with given shapes and attributes """ - + np.random.seed(0) total_size_1 = 1 total_size_2 = 1 for s in tensor_in_sizes: From 2b26b9c7574980c54970ad028f7028411e88c220 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Fri, 17 Jul 2020 15:32:35 +0000 Subject: [PATCH 2/6] Retrigger From 95eba9c135789745af04243e74295fe636cbca34 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Fri, 17 Jul 2020 19:27:03 +0000 Subject: [PATCH 3/6] Retrigger --- tests/python/frontend/tflite/test_forward.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index d60061c7b088..017ea1576573 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -819,6 +819,7 @@ def _test_convolution(tensor_in_sizes, filter_in_sizes, dilations, strides, padding, data_format, is_depthwise=False, quantized=False): """ One iteration of convolution with given shapes and attributes """ + np.random.seed(0) total_size_1 = 1 total_size_2 = 1 From b1bf55d7cc3b1e0d2d94e6ac5ec09fc8c0c47486 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Mon, 20 Jul 2020 18:53:21 +0000 Subject: [PATCH 4/6] Commenting out tests --- tests/python/frontend/tflite/test_forward.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index 017ea1576573..69268f381311 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -785,7 +785,7 @@ def representative_data_gen(): def _test_tflite2_quantized_depthwise_convolution(input_shape, kernel_shape, dilations, strides, padding, data_format, depth_multiplier): """One iteration of TFLite2 quantized depthwise convolution with given shapes and attributes""" - np.random.seed(0) + data_format = "channels_last" if "NHWC" else "channels_first" data = np.random.uniform(0, 1, input_shape).astype('float32') kernel = np.random.uniform(0, 1, kernel_shape).astype('float32') @@ -820,7 +820,6 @@ def _test_convolution(tensor_in_sizes, filter_in_sizes, is_depthwise=False, quantized=False): """ One iteration of convolution with given shapes and attributes """ - np.random.seed(0) total_size_1 = 1 total_size_2 = 1 for s in tensor_in_sizes: @@ -916,13 +915,14 @@ def test_forward_convolution(): _test_tflite2_quantized_convolution([1, 17, 17, 19], [3, 3, 19, 19], [1, 1], [2, 2], 'VALID', 'NHWC') _test_tflite2_quantized_convolution([1, 17, 17, 124], [1, 1, 124, 19], [1, 1], [1, 1], 'SAME', 'NHWC') + # Disable as tests are flaky - https://github.com/apache/incubator-tvm/issues/6064 # depthwise convolution - _test_tflite2_quantized_depthwise_convolution([1, 8, 8, 128], [1, 1, 128, 1], [1, 1], [1, 1], - 'SAME', 'NHWC', 1) - _test_tflite2_quantized_depthwise_convolution([1, 17, 17, 12], [3, 3, 12, 1], [1, 1], [2, 2], - 'VALID', 'NHWC', 1) - _test_tflite2_quantized_depthwise_convolution([1, 24, 24, 3], [7, 7, 3, 8], [1, 1], [2, 2], - 'SAME', 'NHWC', 8) + # _test_tflite2_quantized_depthwise_convolution([1, 8, 8, 128], [1, 1, 128, 1], [1, 1], [1, 1], + # 'SAME', 'NHWC', 1) + # _test_tflite2_quantized_depthwise_convolution([1, 17, 17, 12], [3, 3, 12, 1], [1, 1], [2, 2], + # 'VALID', 'NHWC', 1) + # _test_tflite2_quantized_depthwise_convolution([1, 24, 24, 3], [7, 7, 3, 8], [1, 1], [2, 2], + # 'SAME', 'NHWC', 8) From 6892dc7f53e42ff47e196d01e628d09464f7110f Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Wed, 22 Jul 2020 16:52:12 +0000 Subject: [PATCH 5/6] Retirgger From 067a33f9deac6a715098c753e806827d386d03ac Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Wed, 22 Jul 2020 20:19:45 +0000 Subject: [PATCH 6/6] Retrigger