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 2020/09/25 23:02:27 UTC

[GitHub] [incubator-tvm] u99127 commented on a change in pull request #6445: Add dot product support for quantized convolution.

u99127 commented on a change in pull request #6445:
URL: https://github.com/apache/incubator-tvm/pull/6445#discussion_r495302617



##########
File path: python/tvm/topi/arm_cpu/arm_utils.py
##########
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=invalid-name,unused-variable,unused-argument,no-member
+"""Arm target utility functions"""
+
+import tvm
+
+
+def is_fast_int8_on_arm():
+    """ Checks whether the hardware has support for fast Int8 arithmetic operations. """
+    target = tvm.target.Target.current(allow_none=False)
+    return "+v8.2a" in target.mattr and "+dotprod" in target.mattr

Review comment:
       So, architecturally IIRC dot product is an optional feature in Armv8.2-A and Armv8.3-A. IIRC it becomes mandatory from Armv8.4-a. So in theory this needs a bit more proper hierarchical modelling of the architectural features and needs some cleanup. We would need some kind of mandatory and optional features for each arch level and rewrite the tests to be recast in that form rather than this. 
   
   Alternatively it might be worth checking if we can use llvm to see if it has an API to check architecture features in a level of the architecture string passed in via mattr. 
   
   It may also be worth renaming this function as is_int8_dotproduct_on_arm() rather than a generic name like is_fast_int8_on_arm especially as there are other instructions like SMMLA and UMMLA that can be pretty quick as well for int8 arithmetic on AArch64.
   
   
   
   




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

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