Move normal() to DistributionTemplates#35167
Move normal() to DistributionTemplates#35167pbelevich wants to merge 22 commits intogh/pbelevich/90/basefrom
Conversation
[ghstack-poisoned]
💊 CircleCI build failures summary and remediationsAs of commit 74050a3 (more details on the Dr. CI page):
1 job timed out:
Job pytorch_xla_linux_xenial_py3_6_clang7_test is failing. Please create an issue with title prefixed by This 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. This comment has been revised 89 times. |
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
|
@ailzhang what can be the cause of XLA failures? |
|
cc: @JackCaoG who lowered |
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
| } | ||
| } else { | ||
| AT_DISPATCH_ALL_TYPES_AND3(kHalf, kBool, kBFloat16, iter.dtype(0), "copy_", [&] { | ||
| AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND3(kHalf, kBool, kBFloat16, iter.dtype(0), "copy_", [&] { |
anjali411
left a comment
There was a problem hiding this comment.
lgtm after fixing the copy_() change :) thanks for the awesome work!
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
test/test_torch.py
Outdated
| self.assertEqual(r.mean(), 2, 0.2) | ||
| self.assertEqual(r.std(), 3, 0.2) | ||
| @dtypes(torch.float, torch.double, torch.complex64, torch.complex128) | ||
| @dtypesIfCUDA(torch.float, torch.double, torch.complex64, torch.complex128) |
There was a problem hiding this comment.
Curious: these two list are identical, is this intended?
The purpose of this PR is to move `normal`/`normal_`/`normal_out` to `native/DistributionTemplates.h`, `native/cpu/DistributionTemplates.h` and `native/cuda/DistributionTemplates.h` to make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG. Differential Revision: [D20588248](https://our.internmc.facebook.com/intern/diff/D20588248) [ghstack-poisoned]
|
Sorry, missed the email earlier. I think you can land this pr, xla will skip new tests for now. I will investigate it a bit more, most likely test issue. |
ailzhang
left a comment
There was a problem hiding this comment.
Thanks for waiting! This PR is good to go when you're ready.
[note to self]:
It's fine to remove device dispatch for normal here since we have derivatives defined for
normal(Tensor, double)
normal(double, Tensor)
normal(Tensor, Tensor)
So that they're still overridable by XLA.
normal(double, double) is a composite op defined in TensorFactories.cpp which points to normal_ as leaf node.
|
@pbelevich merged this pull request in 2dd867f. |
The purpose of this PR is to move
normal/normal_/normal_outtonative/DistributionTemplates.h,native/cpu/DistributionTemplates.handnative/cuda/DistributionTemplates.hto make it reusable for custom RNG, see cpu_rng_test.cpp as an example of custom RNG.Stack from ghstack:
Differential Revision: D20588248