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/07/21 16:37:10 UTC
[GitHub] [tvm] JoeyChou-SiMa-ai opened a new pull request #8522: [ONNX] Use static broadcast_to for ONNX's Expand operator if possible
JoeyChou-SiMa-ai opened a new pull request #8522:
URL: https://github.com/apache/tvm/pull/8522
While translating ONNX's `Expand` operator, if the value in shape input tensor are known at the compile time, use it to get the output shape of Expand operator so it can create a static `broadcast_to` instead of a dynamic one.
--
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] comaniac commented on a change in pull request #8522: [ONNX] Use static broadcast_to for ONNX's Expand operator if possible
Posted by GitBox <gi...@apache.org>.
comaniac commented on a change in pull request #8522:
URL: https://github.com/apache/tvm/pull/8522#discussion_r674422187
##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -2099,6 +2099,14 @@ def expand_shape(in_shape, shape):
new_shape = _op.maximum(in_shape, shape)
Review comment:
FoldConstant seems not help here, as it has been used after this function (L2110: `shape = fold_constant(expand_shape(in_shape, shape))`).
Meanwhile, I also agree that using parameters to avoid dynamic ops is not a good practice. From compiler's perspective, they are "parameters" because their values can be changed anytime, so we should not make any assumption here. A good practice is going through `from_onnx -> bind_param_by_name -> fold_constant -> dynamic_to_static`. Since parameters become constants after binding, it's now safe to say these ops can be static.
--
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] JoeyChou-SiMa-ai commented on a change in pull request #8522: [ONNX] Use static broadcast_to for ONNX's Expand operator if possible
Posted by GitBox <gi...@apache.org>.
JoeyChou-SiMa-ai commented on a change in pull request #8522:
URL: https://github.com/apache/tvm/pull/8522#discussion_r674426002
##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -2099,6 +2099,14 @@ def expand_shape(in_shape, shape):
new_shape = _op.maximum(in_shape, shape)
Review comment:
I agree that (1) not using the param and (2) using `dynamic_to_static` are the right solution here. I was simply thinking about getting all static operators from this frozen model but the concept is not correct here.
I will decline this PR. Thank you for the feedback.
--
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] mbrookhart commented on a change in pull request #8522: [ONNX] Use static broadcast_to for ONNX's Expand operator if possible
Posted by GitBox <gi...@apache.org>.
mbrookhart commented on a change in pull request #8522:
URL: https://github.com/apache/tvm/pull/8522#discussion_r674240277
##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -2099,6 +2099,14 @@ def expand_shape(in_shape, shape):
new_shape = _op.maximum(in_shape, shape)
Review comment:
I wonder if it would do the same thing to add fold_constant here? I don't love the use of params, but I'm not strictly opposed to it.
--
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] JoeyChou-SiMa-ai closed pull request #8522: [ONNX] Use static broadcast_to for ONNX's Expand operator if possible
Posted by GitBox <gi...@apache.org>.
JoeyChou-SiMa-ai closed pull request #8522:
URL: https://github.com/apache/tvm/pull/8522
--
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