-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Frontend][Tensorflow] Support SAME padding for dynamic h, w when stride == 1 #7885
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trevor-m
force-pushed
the
dynamic-same-padding
branch
from
April 19, 2021 21:45
d62f764
to
3af29b4
Compare
kevinthesun
approved these changes
Apr 20, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for reviewing! |
Thanks @trevor-m |
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Apr 22, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
echuraev
pushed a commit
to echuraev/tvm
that referenced
this pull request
Apr 29, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
umangyadav
pushed a commit
to umangyadav/tvm
that referenced
this pull request
May 5, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
…ide == 1 (apache#7885) * Support SAME padding for dynamic workloads when stride == 1 * Fix lint * Fix lint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously TVM would throw an error if an operator was using SAME padding and also had a dynamic H or W dimension:
unsupported operand type(s) for %: 'Any' and 'int'
However, if stride == 1, then the input dimension value is actually not needed to compute the padding values.
Also added explicit message for the remaining unsupported case (strides != 1).
Added a test case for pooling, but this change helps all of the following operators:
If strides is not 1, we currently don't have a way to support the dynamic padding. I did some experiments, but it seems type inferencing through
dyn.nn.pad
is not sufficient because it doesn't know that only H and W dimensions are padded. Also, the output wouldn't be correct due tocount_include_pad=False
. So it seems we would need to modify all of these relay operators in order to fully support SAME or dynamic padding.