-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix masked_select for discontiguous outputs #41841
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
Conversation
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.
This would be a no-op for contiguous tensors, but would create a copy for non-contiguous ones, right?
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.
And why the same fix does not need to be applied to TensorConfig() created on line 737 for parallel kernel?
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.
According to @zou3519 only serial kernel is affected, and I didn't figure out yesterday how to fix the kernel itself. I'll take a look now.
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 root-caused why its serial kernel only, so now I'm sending discontiguous inputs to parallel kernel that can handle them without making additional copies.
|
why don't we have tests for printing complex tensors? The tests for #41828 pass. |
|
|
Ok, maybe we don't need masked_select for complex printing after all, I just remember @anjali411 wanted original PR for something complex-replated. |
|
yep, I checked with @anjali411 and she said we split the real and imaginary parts before printing, so we should be good. |
💊 CI failures summary and remediationsAs of commit 535949c (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 18 times. |
|
Thanks for the fix. Is malfet doing the full review? Add me if you want me to review too. |
|
@malfet it's ready for review now. Unfortunately it's harder to review, as after revert I have to bring original porting PR back, but now it has a test that explicitly tests for discontiguous mask/value/out, so if that passes, should be good to go. |
facebook-github-bot
left a comment
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.
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
mruberry
left a comment
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.
Awesome fix to a couple silent errors!
facebook-github-bot
left a comment
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.
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This fixes #41473 for discontiguous input, mask and out. Tests to follow. Reverting #33269 is not a great solution because I'm told masked_select was needed for printing complex tensors.
cc @gchanan , @zou3519, @ezyang