-
Notifications
You must be signed in to change notification settings - Fork 26.3k
TensorIteratorConfig: Check memory overlap by default #43422
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
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 4ff43a9 (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
[ghstack-poisoned]
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
zou3519
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.
Still working my way through a list of all TensorIteratorConfig() callsites. I am around 30% done through that list. Here are some initial comments
| at::assert_no_internal_overlap(result); | ||
| at::assert_no_partial_overlap(result, self); | ||
| at::assert_no_partial_overlap(result, mask); | ||
|
|
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 file also adds memory overlap support for:
- index_select out= variant (we should add a test for this)
- masked_fill_ (we should add a test for this)
- masked_select out=variant (we should add a test for this)
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.
@peterbell10 did you want to add tests for these? I'm fine without them but it is nice to have them to check parity between CPU/CUDA (and to detect regressions)
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.
They have tests in #43423 and I moved the asserts to that PR as well.
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.
Got it, I didn't realize. Thanks for clarifying
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
I think we shouldn't check memory overlap here. It looks like the output is being restrided so that it has a zero stride, so that would trigger the memory overlap check always when this function is called. |
zou3519
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.
OK, done reading through all callsites of TensorIteratorConfig. I had some comments above, other than that, this looks good
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
Differential Revision: [D23298653](https://our.internmc.facebook.com/intern/diff/D23298653) [ghstack-poisoned]
|
BC-breaking note:
|
Stack from ghstack:
Differential Revision: D23298653