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


##########
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:
   I think you're right, my boolean logic was off methinks, as I remember it 
the logic should cast for ASIMD and opt out if there's another option which 
might work better:
   
   ```
       use_int8_on_arm = (not is_depthwise) and attrs["data_layout"] == "NHWC"
       has_dotprod = is_fast_int8_on_arm()
       other_options = use_int8_on_arm or has_dotprod
       if has_asimd() and not other_options:
           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)
   ```
   
   Does that sound right to you? 😸



-- 
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-unsubscr...@tvm.apache.org

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

Reply via email to