You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/05 10:18:03 UTC

[GitHub] [tvm] guberti commented on a diff in pull request #12671: [Relay] Change when int8 operations are converted to int16 on Arm

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


##########
python/tvm/relay/qnn/op/legalizations.py:
##########
@@ -433,15 +443,15 @@ def _qnn_conv2d_legalize_arm_cpu(attrs, inputs, types):
         attrs["groups"],
     )
     use_int8_on_arm = (not is_depthwise) and is_aarch64_arm() and attrs["data_layout"] == "NHWC"
-    if use_int8_on_arm or is_fast_int8_on_arm():
+    if use_int8_on_arm or is_fast_int8_on_arm() or is_cortexm_arm():
         return helper_change_dtypes_to_be_same(attrs, inputs, types, relay.qnn.op.conv2d)
     return helper_no_fast_int8_hw_legalization(attrs, inputs, types, relay.nn.conv2d)

Review Comment:
   ~~Sounds good to me.~~ Actually, I'm not sure I understand. Are you proposing we do the checks like this?
   ```python
       if (
           (not is_depthwise) and has_asimd and attrs["data_layout"] == "NHWC"
           and (not is_fast_int8_on_arm())
       ):
           return helper_no_fast_int8_hw_legalization(attrs, inputs, types, relay.nn.conv2d)
       return helper_change_dtypes_to_be_same(attrs, inputs, types, relay.qnn.op.conv2d)
   ```
   I suspect I'm misunderstanding, as it seems `attrs["data_layout"] == "NHWC"` would make `int8` a *better* choice (plus previously, having `attrs["data_layout"] == "NHWC"` made us more likely to use `int8` operators). Would you mind clarifying @Mousius?



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org