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 2021/12/22 15:19:15 UTC

[GitHub] [tvm] lhutton1 opened a new pull request #9794: [microNPU] Add support for scalar values

lhutton1 opened a new pull request #9794:
URL: https://github.com/apache/tvm/pull/9794


   PR #9515 enabled support for scalar constants, but didn't consider the case of a scalar value where the underlying constant data does not have a shape i.e. `constant.shape == []`. See the test case for a visual difference when the scalar value is 1.
   


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



[GitHub] [tvm] lhutton1 commented on pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
lhutton1 commented on pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#issuecomment-999663718


   cc @manupa-arm @mbaret @ekalda @NicolaLancellotti @jacobbohlin @dchauhan-arm 


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



[GitHub] [tvm] manupa-arm commented on a change in pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
manupa-arm commented on a change in pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#discussion_r786059348



##########
File path: python/tvm/relay/backend/contrib/ethosu/tir/scheduler.py
##########
@@ -135,7 +135,17 @@ def _visit(tensor, reader, lut):
             if tensor not in planned:
                 planned.add(tensor)
                 if isinstance(tensor.op, tvm.te.PlaceholderOp) and tensor != lut:
-                    index = list(cached_func.inputs).index(tensor)
+                    # Find index of input using 'same_as' check to prevent equality
+                    # ambiguity when encountering a scalar.
+                    index = -1
+                    for i, var in enumerate(cached_func.inputs):

Review comment:
       nit : could use something like : 
   [input for input in cached_func.inputs if input.same_as(tensor)] and then checking the resulting list ?




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



[GitHub] [tvm] manupa-arm commented on pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
manupa-arm commented on pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#issuecomment-1015189513


   Thanks! @lhutton1 


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



[GitHub] [tvm] manupa-arm merged pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
manupa-arm merged pull request #9794:
URL: https://github.com/apache/tvm/pull/9794


   


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



[GitHub] [tvm] lhutton1 commented on pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
lhutton1 commented on pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#issuecomment-1014598482


   friendly ping for comment/approval


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



[GitHub] [tvm] lhutton1 commented on a change in pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
lhutton1 commented on a change in pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#discussion_r786081778



##########
File path: python/tvm/relay/backend/contrib/ethosu/tir/scheduler.py
##########
@@ -135,7 +135,17 @@ def _visit(tensor, reader, lut):
             if tensor not in planned:
                 planned.add(tensor)
                 if isinstance(tensor.op, tvm.te.PlaceholderOp) and tensor != lut:
-                    index = list(cached_func.inputs).index(tensor)
+                    # Find index of input using 'same_as' check to prevent equality
+                    # ambiguity when encountering a scalar.
+                    index = -1
+                    for i, var in enumerate(cached_func.inputs):

Review comment:
       Agreed, I'll make the change here :) -- since it would probably be a good idea to retrigger CI anyway




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



[GitHub] [tvm] lhutton1 commented on a change in pull request #9794: [microNPU] Add support for scalar values

Posted by GitBox <gi...@apache.org>.
lhutton1 commented on a change in pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#discussion_r786081778



##########
File path: python/tvm/relay/backend/contrib/ethosu/tir/scheduler.py
##########
@@ -135,7 +135,17 @@ def _visit(tensor, reader, lut):
             if tensor not in planned:
                 planned.add(tensor)
                 if isinstance(tensor.op, tvm.te.PlaceholderOp) and tensor != lut:
-                    index = list(cached_func.inputs).index(tensor)
+                    # Find index of input using 'same_as' check to prevent equality
+                    # ambiguity when encountering a scalar.
+                    index = -1
+                    for i, var in enumerate(cached_func.inputs):

Review comment:
       Agreed, I'll make the change here :)




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