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/27 19:18:10 UTC

[GitHub] [tvm] areusch commented on a diff in pull request #12856: [microTVM] Generalize depthwise_conv2d schedule

areusch commented on code in PR #12856:
URL: https://github.com/apache/tvm/pull/12856#discussion_r981601645


##########
python/tvm/topi/arm_cpu/mprofile/dsp/micro_kernel/common.py:
##########
@@ -29,3 +29,18 @@
 #include <tvm/runtime/crt/error_codes.h>
 
 """
+
+MICRO_WORD_LENGTH = 32
+
+
+def get_dtype_simd_width(dtype: str) -> int:
+    """Takes a dtype, and returns how many of that dtype fit into a single microcontroller word.
+
+    >>> get_dtype_simd_width("int8")
+    4
+    >>> get_dtype_simd_width("int16")
+    2
+    """
+    assert dtype[0:3] == "int"

Review Comment:
   can also:
   ```suggestion
       assert dtype.startswith("int")
   ```



##########
python/tvm/topi/arm_cpu/mprofile/dsp/micro_kernel/common.py:
##########
@@ -29,3 +29,18 @@
 #include <tvm/runtime/crt/error_codes.h>
 
 """
+
+MICRO_WORD_LENGTH = 32
+
+
+def get_dtype_simd_width(dtype: str) -> int:

Review Comment:
   might be better named get_num_simd_ops_per_word(dtype: str)



##########
python/tvm/topi/arm_cpu/mprofile/dsp/micro_kernel/common.py:
##########
@@ -29,3 +29,18 @@
 #include <tvm/runtime/crt/error_codes.h>
 
 """
+
+MICRO_WORD_LENGTH = 32

Review Comment:
   add units e.g. MICRO_WORD_LENGTH_BITS. should this be a parameter to the below function instead of a const?



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