-
Notifications
You must be signed in to change notification settings - Fork 55
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
Unshard tensor sizes before binding. #3444
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
04e06a8
Add a repro for #3282
wujingyue 416f1d0
Remove an assumption in the transpose scheduler.
wujingyue 2c984c8
Reimplement unshardSizesAndStrides.
wujingyue 44b5091
Inherit parallel type for new allocation IDs
wujingyue 521c783
Fix broadcast tests
wujingyue 9ff10cf
Unify unshardedSizes.
wujingyue 8bd9486
Fix a test
wujingyue 5a16349
Refine the logic in the transpose scheduler
wujingyue 2768970
Comment
wujingyue e38962e
Merge branch 'main' into wjy/forward
wujingyue 400684e
Resolve two fixmes
wujingyue 261b831
Harden a test
wujingyue c9d748e
Apply suggestions from code review
wujingyue b6e3f40
Lint
wujingyue 61260cb
Add a test with reordering
wujingyue 2daf5b2
Lint
wujingyue d4532e6
Revert "Lint"
wujingyue a5f6eb3
Fix lint
wujingyue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
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 think there is a mistake here..
if we bind
{2,3}
to{N/D, M}
then
M=3
andN=2D
, and so according to the comment, it should return the shape corresponding to the logical domain, i.e.,[3, 2D]
. Am I missing something?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.
moreover, do we support transposition?
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.
The comment is correct and is consistent with the code.
ExpressionEvaluator::bindTensorDomain basically does the following
That's also why I prefer to say we bind the unsharded sizes to the logical domain instead of allocation.
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 see. Imo it is error prone to silently discard transposition. We should assert that only splits have been applied, OR, we should support transposition, which shouldn't be too hard...
I would say in this case that we bind to neither the logical nor the allocation, but to some hybrid domain where starting from the logical we only applied the splits. This is a bit counter-intuitive to me.
In your snippet above, everything is contained in the
unsharded_sizes
which basically embeds a mapping from allocation (or more precisely the hybrid domain I described earlier) to logical.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 believe code as is supports transposition. (I assume by transposition you mean TensorView::reorder). To assure you that, I added a test in the latest commit.