[Relay] Add support for relay expressions as pad value for static pad#7860
Merged
mbrookhart merged 17 commits intoApr 20, 2021
Merged
Conversation
Contributor
Author
|
@mbrookhart @jwfromm please add appropriate reviewers. |
electriclilies
approved these changes
Apr 15, 2021
electriclilies
left a comment
Contributor
There was a problem hiding this comment.
Overall, looks good to me -- just one comment about adding a comment :)
Contributor
|
Thanks @AndrewZhaoLuo @electriclilies |
mehrdadh
pushed a commit
to mehrdadh/tvm
that referenced
this pull request
Apr 22, 2021
…apache#7860) * add support for expr as inputs to pad * fix improper amount of args * add dynamic padding test * infer type better test * add comments to type relations * fix infer type layouts * proper return shape * proper shape infer type * make the tests pass by setting the conditions * make codegen reflect reality * make ternary operations more pythonic * proper infer layout * fold explicit padding * fix pattern matching in contrib * revert tests for contrib now that pattern matching works * revert import changes * add newline
echuraev
pushed a commit
to echuraev/tvm
that referenced
this pull request
Apr 29, 2021
…apache#7860) * add support for expr as inputs to pad * fix improper amount of args * add dynamic padding test * infer type better test * add comments to type relations * fix infer type layouts * proper return shape * proper shape infer type * make the tests pass by setting the conditions * make codegen reflect reality * make ternary operations more pythonic * proper infer layout * fold explicit padding * fix pattern matching in contrib * revert tests for contrib now that pattern matching works * revert import changes * add newline
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…apache#7860) * add support for expr as inputs to pad * fix improper amount of args * add dynamic padding test * infer type better test * add comments to type relations * fix infer type layouts * proper return shape * proper shape infer type * make the tests pass by setting the conditions * make codegen reflect reality * make ternary operations more pythonic * proper infer layout * fold explicit padding * fix pattern matching in contrib * revert tests for contrib now that pattern matching works * revert import changes * add newline
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…apache#7860) * add support for expr as inputs to pad * fix improper amount of args * add dynamic padding test * infer type better test * add comments to type relations * fix infer type layouts * proper return shape * proper shape infer type * make the tests pass by setting the conditions * make codegen reflect reality * make ternary operations more pythonic * proper infer layout * fold explicit padding * fix pattern matching in contrib * revert tests for contrib now that pattern matching works * revert import changes * add newline
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
…apache#7860) * add support for expr as inputs to pad * fix improper amount of args * add dynamic padding test * infer type better test * add comments to type relations * fix infer type layouts * proper return shape * proper shape infer type * make the tests pass by setting the conditions * make codegen reflect reality * make ternary operations more pythonic * proper infer layout * fold explicit padding * fix pattern matching in contrib * revert tests for contrib now that pattern matching works * revert import changes * add newline
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
…apache#7860) * add support for expr as inputs to pad * fix improper amount of args * add dynamic padding test * infer type better test * add comments to type relations * fix infer type layouts * proper return shape * proper shape infer type * make the tests pass by setting the conditions * make codegen reflect reality * make ternary operations more pythonic * proper infer layout * fold explicit padding * fix pattern matching in contrib * revert tests for contrib now that pattern matching works * revert import changes * add newline
masahi
pushed a commit
that referenced
this pull request
Jul 12, 2021
* [Relay to Onnx conversion][Pool] * added missing ceil_mode in average pool and max pool conversion * [Relay to Onnx conversion][Pad] * Fixed issue in Pad conversion: changed pad_value to input instead of attrs * Refer to PR: #7860 * Updated unit test for Pad * Fixed some formatting errors
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Sep 29, 2021
* [Relay to Onnx conversion][Pool] * added missing ceil_mode in average pool and max pool conversion * [Relay to Onnx conversion][Pad] * Fixed issue in Pad conversion: changed pad_value to input instead of attrs * Refer to PR: apache#7860 * Updated unit test for Pad * Fixed some formatting errors
zxy844288792
pushed a commit
to zxy844288792/tvm
that referenced
this pull request
Mar 4, 2022
* [Relay to Onnx conversion][Pool] * added missing ceil_mode in average pool and max pool conversion * [Relay to Onnx conversion][Pad] * Fixed issue in Pad conversion: changed pad_value to input instead of attrs * Refer to PR: apache#7860 * Updated unit test for Pad * Fixed some formatting errors
This file contains hidden or 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
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.
This PR allow static padding to take in relay expressions for the padding value.
Previously if the padding value is an expression then dynamic padding will be performed instead even if the tensor shape cane be easily calculated based on constant padding widths. The output would be a dynamically shaped tensor which is not compatible with a lot of other operations. Now, dynamic padding is dispatched only when the pad widths themselves are expressions.
In particular this is useful for quantization work where we need to pad input tensors with an appropriate and variable zero point.