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/02/16 10:25:20 UTC

[GitHub] [tvm] lhutton1 commented on a change in pull request #10251: [microNPU] Add support for conv2d running on two cores on U65

lhutton1 commented on a change in pull request #10251:
URL: https://github.com/apache/tvm/pull/10251#discussion_r806750749



##########
File path: python/tvm/relay/backend/contrib/ethosu/legalize.py
##########
@@ -1216,7 +1216,7 @@ def callback(
             )
         else:
             weight_scale = 1 / (filter_height * filter_width)
-            weight_values = np.ones([out_channels, filter_height, filter_width, in_channels])
+            weight_values = np.ones([out_channels, filter_height, filter_width, 1])

Review comment:
       Just curious - why did these change?

##########
File path: python/tvm/relay/backend/contrib/ethosu/tir/passes.py
##########
@@ -338,35 +340,91 @@ def _new_buffer(old_buffer, new_value):
         rewrite_buffer[old_buffer] = new_buffer
         rewrite_pointer[old_buffer.data] = new_buffer.data
 
+    def _encode_weights_or_bias(ptr1, ptr2, stmt, encode_func):
+        """Encode the weights or align the bias either for one or two cores,
+        depending on the variant."""
+        assert ptr1 in pointer_to_buffer

Review comment:
       I think it would be better to add a message to these assertions incase they do ever fail

##########
File path: tests/python/contrib/test_ethosu/test_codegen.py
##########
@@ -80,7 +80,7 @@ def tf_function(self, x):
                 op = tf.nn.conv2d(
                     x,
                     filters=tf.constant(
-                        np.random.uniform(size=[kernel_shape[0], kernel_shape[1], 3, 3]),
+                        np.random.uniform(size=[kernel_shape[0], kernel_shape[1], ifm_shape[3], 5]),

Review comment:
       Nit: perhaps make it clear at the top of the test that this is `out_channels = 5`, feel free to ignore.




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