ashutosh-arm commented on code in PR #12353:
URL: https://github.com/apache/tvm/pull/12353#discussion_r942615935
##########
tests/python/contrib/test_cmsisnn/test_conv2d.py:
##########
@@ -403,6 +401,109 @@ def test_conv2d_asymmetric_padding_int8(
)
[email protected]_cmsisnn
[email protected]("ifm_shape", [(1, 25, 25, 12), (1, 64, 100, 4)])
[email protected](
+ "pad_width",
+ [
+ ((0, 0), (0, 1), (1, 2), (0, 0)),
+ ((0, 0), (1, 1), (1, 1), (0, 0)),
+ ((0, 0), (2, 2), (3, 4), (0, 0)),
+ ],
+)
+def test_conv2d_separate_padding_int8(
+ ifm_shape,
+ pad_width,
+):
+ """Tests QNN Conv2D where the padding is asymmetric on different sides of
input"""
+ interface_api = "c"
+ use_unpacked_api = True
+ test_runner = AOT_USMP_CORSTONE300_RUNNER
+
+ ifm_shape = (1, 25, 25, 12)
+ kernel_size = (5, 5)
+ strides = (2, 2)
+ dilation = (1, 1)
+ padding = "SAME"
+ dtype = "int8"
+ enable_bias = True
+ relu_type = "NONE"
+ input_zero_point = 10
+ input_scale = 0.0128
+ kernel_scale = [0.11, 0.22]
+ out_channels = 2
+ groups = 1
+ weight_format = "HWIO"
+ kernel_h = kernel_size[0]
+ kernel_w = kernel_size[1]
+ kernel_shape = (kernel_h, kernel_w, ifm_shape[3] // groups, out_channels)
+ kernel_zero_point = 0
+ in_min, in_max = get_range_for_dtype_str(dtype)
+
+ output_scale, output_zero_point = get_conv2d_qnn_params(
+ kernel_shape,
+ input_scale,
+ input_zero_point,
+ kernel_scale,
+ kernel_zero_point,
+ dtype,
Review Comment:
ACK
##########
tests/python/contrib/test_cmsisnn/test_conv2d.py:
##########
@@ -403,6 +401,109 @@ def test_conv2d_asymmetric_padding_int8(
)
[email protected]_cmsisnn
[email protected]("ifm_shape", [(1, 25, 25, 12), (1, 64, 100, 4)])
[email protected](
+ "pad_width",
+ [
+ ((0, 0), (0, 1), (1, 2), (0, 0)),
+ ((0, 0), (1, 1), (1, 1), (0, 0)),
+ ((0, 0), (2, 2), (3, 4), (0, 0)),
+ ],
+)
+def test_conv2d_separate_padding_int8(
+ ifm_shape,
+ pad_width,
+):
+ """Tests QNN Conv2D where the padding is asymmetric on different sides of
input"""
+ interface_api = "c"
+ use_unpacked_api = True
+ test_runner = AOT_USMP_CORSTONE300_RUNNER
+
+ ifm_shape = (1, 25, 25, 12)
+ kernel_size = (5, 5)
+ strides = (2, 2)
+ dilation = (1, 1)
+ padding = "SAME"
+ dtype = "int8"
+ enable_bias = True
+ relu_type = "NONE"
+ input_zero_point = 10
+ input_scale = 0.0128
+ kernel_scale = [0.11, 0.22]
+ out_channels = 2
+ groups = 1
+ weight_format = "HWIO"
+ kernel_h = kernel_size[0]
+ kernel_w = kernel_size[1]
+ kernel_shape = (kernel_h, kernel_w, ifm_shape[3] // groups, out_channels)
+ kernel_zero_point = 0
+ in_min, in_max = get_range_for_dtype_str(dtype)
+
+ output_scale, output_zero_point = get_conv2d_qnn_params(
+ kernel_shape,
+ input_scale,
+ input_zero_point,
+ kernel_scale,
+ kernel_zero_point,
+ dtype,
+ dtype,
Review Comment:
ACK
##########
tests/python/contrib/test_cmsisnn/test_conv2d.py:
##########
@@ -403,6 +401,109 @@ def test_conv2d_asymmetric_padding_int8(
)
[email protected]_cmsisnn
[email protected]("ifm_shape", [(1, 25, 25, 12), (1, 64, 100, 4)])
[email protected](
+ "pad_width",
+ [
+ ((0, 0), (0, 1), (1, 2), (0, 0)),
+ ((0, 0), (1, 1), (1, 1), (0, 0)),
+ ((0, 0), (2, 2), (3, 4), (0, 0)),
+ ],
+)
+def test_conv2d_separate_padding_int8(
+ ifm_shape,
+ pad_width,
+):
+ """Tests QNN Conv2D where the padding is asymmetric on different sides of
input"""
+ interface_api = "c"
+ use_unpacked_api = True
+ test_runner = AOT_USMP_CORSTONE300_RUNNER
+
+ ifm_shape = (1, 25, 25, 12)
+ kernel_size = (5, 5)
+ strides = (2, 2)
+ dilation = (1, 1)
+ padding = "SAME"
+ dtype = "int8"
+ enable_bias = True
+ relu_type = "NONE"
+ input_zero_point = 10
+ input_scale = 0.0128
+ kernel_scale = [0.11, 0.22]
+ out_channels = 2
+ groups = 1
+ weight_format = "HWIO"
+ kernel_h = kernel_size[0]
+ kernel_w = kernel_size[1]
+ kernel_shape = (kernel_h, kernel_w, ifm_shape[3] // groups, out_channels)
+ kernel_zero_point = 0
+ in_min, in_max = get_range_for_dtype_str(dtype)
+
+ output_scale, output_zero_point = get_conv2d_qnn_params(
+ kernel_shape,
+ input_scale,
+ input_zero_point,
+ kernel_scale,
+ kernel_zero_point,
+ dtype,
+ dtype,
+ dtype,
Review Comment:
ACK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]