-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[MPS] Support torch.accelerator.synchronize() on mps #143171
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/143171
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 956dcd9 with merge base cf538ef ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@malfet, may I know if this code change is reasonable for you? |
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.
lol SGTM
Thanks very much~ |
# Motivation This PR intends to add UTs for accelerator device-agnostic APIs. # Additional Context This PR is relanded. It is reverted because `torch.Event` doesn't support mps backend. We have fixed it in #142468. The previous commit is 952514f Pull Request resolved: #133572 Approved by: https://github.com/EikanWang, https://github.com/albanD ghstack dependencies: #143171
…38677) # Motivation This PR intends to add C++ accelerator device-agnostic APIs. # Additional Context This PR is relanded. It is reverted because `torch.Event` doesn't support mps backend. We have fixed it in pytorch#142468. The previous commit is pytorch@f84e533 Pull Request resolved: pytorch#138677 Approved by: https://github.com/albanD, https://github.com/EikanWang ghstack dependencies: pytorch#143171, pytorch#133572
Stack from ghstack (oldest at bottom):
Motivation
Support
torch.accelerator.synchronize()
on mps. The root cause is that MPS doesn't support lazy initialization. So we must check if the current accelerator supports device lazy initialization rather than early return.Additional Context
Add a mps UT to test code change.