Mousius commented on code in PR #12671:
URL: https://github.com/apache/tvm/pull/12671#discussion_r961512539
##########
python/tvm/relay/qnn/op/legalizations.py:
##########
@@ -417,6 +417,16 @@ def is_aarch64_arm():
return "aarch64" in target.attrs.get("mtriple", "")
+def is_cortexm_arm():
+ """Checks whether we are compiling for a Cortex-M target. We want to
preserve
+ int8 operations for these boards, because it halves the number of memory
loads
+ needed for dense layers and convolutions. It comes at a cost of needing
more
+ micro kernels and sign extension instructions to load these values, but
this
+ trade-off seems to be worth it on Cortex-M."""
+ target = tvm.target.Target.current(allow_none=False)
+ return "cortex-m" in target.attrs.get("mcpu", "")
Review Comment:
This may be unnecessary with my other comment 😸
--
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]