ibsidorenko commented on code in PR #13734:
URL: https://github.com/apache/tvm/pull/13734#discussion_r1066638617
##########
python/tvm/relay/qnn/op/legalizations.py:
##########
@@ -483,3 +488,68 @@ def _qnn_dense_legalize_cuda(attrs, inputs, types):
# CUDA prefers both datatypes to be the int8.
return helper_change_dtypes_to_int8(attrs, inputs, types,
relay.qnn.op.dense)
return None
+
+
+########################
+# Hexagon legalizations.
+########################
+
+IN_CHANNEL_VECTOR_LENGTH = 4
+OUT_CHANNEL_VECTOR_LENGTH = 32
+
+
+@qnn_conv2d_legalize.register("hexagon")
+def _qnn_conv2d_legalize_hexagon(attrs, inputs, types):
+ """Legalize qnn.conv2d op for vrmpy tensorization.
+
+ If the inputs are signed or unsigned int8 and data/kernel layouts are
NCHW/OIHW, then the input
+ and output channels are padded to be a multiple of 4 and 32 respectively.
Review Comment:
agree... dtype legalization will be the next step here.
--
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]