ashutosh-arm commented on a change in pull request #9409:
URL: https://github.com/apache/tvm/pull/9409#discussion_r752179676
##########
File path: tests/python/contrib/test_cmsisnn/test_conv2d.py
##########
@@ -147,40 +149,45 @@ def test_op_int8(
input_scale,
kernel_scale,
out_channels,
+ conv_type,
+ depth_multiplier,
):
interface_api = "c"
use_unpacked_api = True
test_runner = AOT_CORSTONE300_RUNNER
- kernel_zero_point = 0
+ dtype = "int8"
groups = 1
weight_format = "HWIO"
kernel_h = kernel_size[0]
kernel_w = kernel_size[1]
- dtype = "int8"
+ 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)
- weight_shape = None
- if weight_format == "HWIO":
- weight_shape = (kernel_h, kernel_w, ifm_shape[3] // groups,
out_channels)
- else:
- weight_shape = (kernel_h, kernel_w, ifm_shape[3], out_channels)
+ if conv_type == "depthwise":
+ groups = ifm_shape[3]
+ weight_format = "HWOI"
+ kernel_shape = (kernel_h, kernel_w, ifm_shape[3], depth_multiplier)
+ out_channels = ifm_shape[3] * depth_multiplier
+ ks_len = len(kernel_scale)
+ kernel_scale = [kernel_scale[i % ks_len] for i in range(out_channels)]
Review comment:
Since depthwise uses convolution everywhere, does it not make sense to
keep them combined? In Relay only few attrs differ. Although, CMSIS-NN apis are
different for them.
--
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]