-
Notifications
You must be signed in to change notification settings - Fork 26.3k
TensorIterator: Check for memory overlap in all nullary_ops
#43421
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 a356b80 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
🚧 1 fixed upstream failure:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
…p`s" [ghstack-poisoned]
| ("log_normal_", ()), | ||
| ("exponential_", ()), | ||
| ("geometric_", (0.5,)), | ||
| ("normal_", ()), |
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.
We should add a test for bernoulli_, too, since we're turning on memory checking for it:
| auto iter = TensorIterator::nullary_op(self); |
| auto iter = TensorIterator::nullary_op(self); |
Some versions of bernoulli go through different code paths :/ we should probably try to keep them consistent in a single PR:
pytorch/aten/src/ATen/native/cpu/DistributionTemplates.h
Lines 318 to 322 in 284ff04
| auto iter = TensorIteratorConfig() | |
| .add_output(self) | |
| .add_input(p) | |
| .check_all_same_dtype(false) | |
| .build(); |
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.
(see #43421 (comment))
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.
I went through all use cases of nullary_op. Those look fine to me; we should add a test case for bernoulli_
|
Hmm, actually, I see the bernoulli_ test code in the next diff up. Is that because it is only in the next diff that we finish moving all of the bernoulli code paths to checking memory overlap? If so then I think it is OK to leave it there. I am probably going to try to land #43418 - #43421 together after this stack gets rebased and I'll take a look at #43422 and #43423 tomorrow |
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.
pre-emptive approve b/c the changes remaining are not that big
There are different code paths depending on if the probability is a tensor. One goes through
|
Okay, I see. This is fine as-is then |
…p`s" Differential Revision: [D23298654](https://our.internmc.facebook.com/intern/diff/D23298654) [ghstack-poisoned]
…p`s" Differential Revision: [D23298654](https://our.internmc.facebook.com/intern/diff/D23298654) [ghstack-poisoned]
…p`s" Differential Revision: [D23298654](https://our.internmc.facebook.com/intern/diff/D23298654) [ghstack-poisoned]
…p`s" Differential Revision: [D23298654](https://our.internmc.facebook.com/intern/diff/D23298654) [ghstack-poisoned]
Stack from ghstack:
nullary_ops #43421 TensorIterator: Check for memory overlap in allnullary_opscompare_ops #43420 TensorIterator: Check for memory overlap in allcompare_opsbinary_ops #43419 TensorIterator: Check for memory overlap in allbinary_opsunary_ops #43418 TensorIterator: Check memory overlap in allunary_opsDifferential Revision: D23298654