guberti commented on code in PR #12856:
URL: https://github.com/apache/tvm/pull/12856#discussion_r981709296


##########
python/tvm/topi/arm_cpu/conv2d_alter_op.py:
##########
@@ -121,7 +124,33 @@ def _alter_conv2d_layout(attrs, inputs, tinfos, out_type):
 
     idxd = tvm.tir.indexdiv
 
-    # We don't perform layout alteration for NHWC layout with real data types
+    if topi_tmpl == "depthwise_conv2d_nhwc_dsp.arm_cpu":
+        assert data_layout == "NHWC" and kernel_layout == "HWOI"
+        channels = get_const_tuple(data.shape)[3]
+        KH, KW, _, _ = get_const_tuple(kernel.shape)
+        simd_width = get_dtype_simd_width(data.dtype)
+
+        HWOI_kernel_np = inputs[1].data.numpy()

Review Comment:
   I'm not sure how easy it is to check if the kernel is a constant from 
`python/tvm/relay/op/strategy/arm_cpu.py`, but you're right that it is a thing 
we should check. I've added an assertion, though it is a bit of a stopgap 
solution.



-- 
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]

Reply via email to