8000 [MPS] Support torch.accelerator.synchronize() on mps by guangyey · Pull Request #143171 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[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

Closed
wants to merge 3 commits into from

Conversation

guangyey
Copy link
Collaborator
@guangyey guangyey commented Dec 13, 2024

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.

Copy link
pytorch-bot bot commented Dec 13, 2024

🔗 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 Failures

As of commit 956dcd9 with merge base cf538ef (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@guangyey
Copy link
Collaborator Author

@malfet, may I know if this code change is reasonable for you?

@guangyey guangyey added the topic: improvements topic category label Dec 13, 2024
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Copy link
Collaborator
@albanD albanD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol SGTM

@guangyey
Copy link
Collaborator Author

lol SGTM

Thanks very much~

pytorchmergebot pushed a commit that referenced this pull request Dec 16, 2024
# 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
majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Dec 16, 2024
…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
@github-actions github-actions bot deleted the gh/guangyey/109/head branch January 16, 2025 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/mps Run MPS tests (subset of trunk) ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: mps Release notes category topic: improvements topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0