ashutosh-arm commented on a change in pull request #9409:
URL: https://github.com/apache/tvm/pull/9409#discussion_r752144585
##########
File path: src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
##########
@@ -173,18 +168,42 @@ class RelayToTIRVisitor : public MixedModeMutator {
Array<PrimExpr> input_shape =
conv2d_call->args[0]->type_as<TensorTypeNode>()->shape;
Array<PrimExpr> input_dims = CMSISNNDimensions(input_shape);
- // cmsis_nn_dims *filter_dims (OHWI)
+ // cmsis_nn_dims *filter_dims (OHWI for Conv2D and IHWO for depthwise)
Array<PrimExpr> filter_shape =
conv2d_call->args[1]->type_as<TensorTypeNode>()->shape;
Array<PrimExpr> filter_dims = CMSISNNDimensions(filter_shape);
- // cmsis_nn_dims *bias_dims (1,1,1,output_channels)
- Array<PrimExpr> bias_shape{1, 1, 1, filter_shape[0]};
+ // cmsis_nn_dims *bias_dims
+ Array<PrimExpr> bias_shape{1, 1, 1, out_channels};
Array<PrimExpr> bias_dims = CMSISNNDimensions(bias_shape);
- // cmsis_nn_dims *output_dims (NHWC)
+ // cmsis_nn_dims *output_dims (same order as input_dims)
Array<PrimExpr> output_shape =
conv2d_call->type_as<TensorTypeNode>()->shape;
Array<PrimExpr> output_dims = CMSISNNDimensions(output_shape);
+ int32_t depth_multiplier = -1;
+ int kernel_pos_o = kernel_layout.find("O");
+ if (groups == qnn::get_const_int(input_shape[3]) &&
Review comment:
Makes sense to have a common function for this.
--
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]