You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "dmilosevic252 (via GitHub)" <gi...@apache.org> on 2023/10/13 10:27:32 UTC

[PR] [Fix][Unity] Fix TVMError when using relax to load model with Trilu operator [tvm]

dmilosevic252 opened a new pull request, #15924:
URL: https://github.com/apache/tvm/pull/15924

   Sets the default value 0 for the k variable, if the value has not been previously set.
   This is a code patch for fixing this issue: https://github.com/apache/tvm/issues/15729


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


Re: [PR] [Fix][Unity] Fix TVMError when using relax to load model with Trilu operator [tvm]

Posted by "dmilosevic252 (via GitHub)" <gi...@apache.org>.
dmilosevic252 commented on code in PR #15924:
URL: https://github.com/apache/tvm/pull/15924#discussion_r1361756821


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -637,6 +637,11 @@ def _impl_v14(cls, bb, inputs, attr, params):
         x = inputs[0]
         k = inputs[1] if len(inputs) > 1 else 0
 
+        if isinstance(k, relax.Var) and k.name_hint in params:
+            k = get_constant(k, params)
+        else:
+            k = 0

Review Comment:
   > Why do we need to set `k` to 0? It should already be done in line 638
   
   In line 638 'k' is set to 0 if its value hasn't been passed. In line 643 we set it to 0 if 'k' is passed but it's value (constant) cannot be obtained.
   
   > Also, what will happen if `k` is a constant instead of an input? Please also add a test case for it.
   
   Thank you for the feedback! I will add a test case.



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


Re: [PR] [Fix][Unity] Fix TVMError when using relax to load model with Trilu operator [tvm]

Posted by "Hzfengsy (via GitHub)" <gi...@apache.org>.
Hzfengsy commented on code in PR #15924:
URL: https://github.com/apache/tvm/pull/15924#discussion_r1358136474


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -637,6 +637,11 @@ def _impl_v14(cls, bb, inputs, attr, params):
         x = inputs[0]
         k = inputs[1] if len(inputs) > 1 else 0
 
+        if isinstance(k, relax.Var) and k.name_hint in params:
+            k = get_constant(k, params)
+        else:
+            k = 0

Review Comment:
   Also, what will happen if `k` is a constant instead of an input? Please also add a test case for it.



##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -637,6 +637,11 @@ def _impl_v14(cls, bb, inputs, attr, params):
         x = inputs[0]
         k = inputs[1] if len(inputs) > 1 else 0
 
+        if isinstance(k, relax.Var) and k.name_hint in params:
+            k = get_constant(k, params)
+        else:
+            k = 0

Review Comment:
   Why do we need to set `k` to 0? It should already be done in line 638 



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


Re: [PR] [Fix][Unity] Fix TVMError when using relax to load model with Trilu operator [tvm]

Posted by "Hzfengsy (via GitHub)" <gi...@apache.org>.
Hzfengsy merged PR #15924:
URL: https://github.com/apache/tvm/pull/15924


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