-
Notifications
You must be signed in to change notification settings - Fork 22.2k
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
[MPS] Fix bernoulli for int types #100946
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100946
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 93a2b00: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
test/test_mps.py
Outdated
@@ -7218,6 +7218,13 @@ def test_bernoulli(self): | |||
mps_out = torch.bernoulli(all_ones) | |||
self.assertEqual(mps_out, all_ones) | |||
|
|||
# Check it works for different dtypes | |||
for dtype in [torch.float16, torch.int8, torch.int32, torch.int16, torch.int64]: |
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.
Change looks good.
Can we please add test for random op as well. It has fixes for Bernoulli and random
069fd23
to
c7086d0
Compare
c7086d0
to
93a2b00
Compare
@pytorchbot merge -f "Lint and MPS tests are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) are pending/not yet run. The first few are:
Dig deeper by viewing the pending checks on hud |
/easycla |
@pytorchbot merge -f "Easy CLA, Lint and MPS tests are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
🤖 Generated by Copilot at 069fd23
This pull request enhances the MPS implementation of random operations in
Distributions.mm
and adds more dtype tests for the bernoulli distribution intest_mps.py
. This improves the performance, correctness, and usability of the MPS backend for PyTorch.Fixes #100717