-
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
Fix broadcast InferCorrectLayout #10156
Merged
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
masahi
reviewed
Feb 4, 2022
masahi
reviewed
Feb 4, 2022
masahi
reviewed
Feb 4, 2022
masahi
reviewed
Feb 4, 2022
@masahi The code is changed according to your suggestions. |
masahi
approved these changes
Feb 5, 2022
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.
I didn't actually try to understand the code, but why not, ship it
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Feb 16, 2022
* Move function body to .cc file. * fix broadcast infer layout * add unittest * backward-compat: optimize for scalar layout * fix lint * fix lint and warning * Add newlines; Use std::vector * fix lint * jostle ci
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.
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.
I'm reviewing this function after PR #10118, and found several buggy places. For instance,
test_broadcast_respect_input_layouts
);test_broadcast_non_adaptable
.AdjustSubordinateFactors
should also be called in the else branchtvm/src/relay/transforms/infer_layout_utils.h
Lines 222 to 234 in 6a274af
test_alter_layout_nonscalar_broadcast
)This PR rewrites
BinaryBroadcastLayoutHelper
a bit, and I tried to make it as backward compatible as possible.Misc
BTW I seem to spot another bug when I was working on this PR. So I sometimes I need to create a scalar layout, and I used
Layout("")
, but it returned an undefined layout. From the doc it should return a scalar layout right? I checked the constructor, and it seems in this if statement:tvm/src/tir/ir/data_layout.cc
Line 99 in 6a274af
data_
field as in normal path:tvm/src/tir/ir/data_layout.cc
Line 144 in 6a274af