KEMBAR78
[MPS] Support torch.Event for MPS by guangyey · Pull Request #142468 · pytorch/pytorch · GitHub
Skip to content

Conversation

@guangyey
Copy link
Collaborator

@guangyey guangyey commented Dec 10, 2024

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 10, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/142468

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit c8b0153 with merge base 1cb2ebd (image):

UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:

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

@pytorch-bot pytorch-bot bot added ciflow/mps Run MPS tests (subset of trunk) release notes: mps Release notes category labels Dec 10, 2024
@guangyey guangyey changed the title [MPS] Support torch.Event for MPS [WIP] [MPS] Support torch.Event for MPS Dec 10, 2024
@guangyey guangyey added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 10, 2024
@guangyey
Copy link
Collaborator Author

@malfet May I know if this PR is reasonable to you?

@guangyey guangyey changed the title [WIP] [MPS] Support torch.Event for MPS [MPS] Support torch.Event for MPS Dec 10, 2024
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@kulinseth
Copy link
Collaborator

Don't we have this support here ?
https://github.com/pytorch/pytorch/blob/main/torch/mps/event.py

@kulinseth
Copy link
Collaborator

@guangyey can you take a look and see what's missing ?

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Thank you very much for the prompt fix

@malfet malfet added the topic: improvements topic category label Dec 10, 2024
@malfet
Copy link
Contributor

malfet commented Dec 10, 2024

@pytorchbot merge -f "Lint + MPS are green"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: PR #142468 has not been reviewed yet

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@malfet
Copy link
Contributor

malfet commented Dec 10, 2024

Don't we have this support here ? https://github.com/pytorch/pytorch/blob/main/torch/mps/event.py

This PR is step forward towards the idea of being able to write accelerator agnostic code and replace neverending

event = torch.cuda.Event() if torch.cuda.is_available() else torch.mps.Event() if torch.mps.is_available() else DummyEvent()

with something torch.Event()

@malfet
Copy link
Contributor

malfet commented Dec 10, 2024

@pytorchbot merge -f "Lint + MPS are green"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@guangyey
Copy link
Collaborator Author

@guangyey can you take a look and see what's missing ?

As @malfet explained, this PR will support device-agnostic torch.Event("MPS") on the MPS backend. This will make it easier for the user to write device-agnostic code.

pytorchmergebot pushed a commit that referenced this pull request Dec 11, 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: #142468
pytorchmergebot pushed a commit that referenced this pull request Dec 11, 2024
# 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 #142468. The previous commit is f84e533

Pull Request resolved: #138677
Approved by: https://github.com/albanD, https://github.com/EikanWang
ghstack dependencies: #142468, #133572
Copy link
Collaborator

@kulinseth kulinseth left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@guangyey
Copy link
Collaborator Author

Looks good to me.

Thanks.

Esquains pushed a commit to Esquains/study1 that referenced this pull request Dec 15, 2024
ghstack-source-id: ffe3755
Pull Request resolved: pytorch/pytorch#142468
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
aditew01 pushed a commit to aditew01/pytorch that referenced this pull request Dec 18, 2024
…h#133572)

# 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 pytorch#142468. The previous commit is pytorch@952514f

Pull Request resolved: pytorch#133572
Approved by: https://github.com/EikanWang, https://github.com/albanD
ghstack dependencies: pytorch#143171
aditew01 pushed a commit to aditew01/pytorch that referenced this pull request Dec 18, 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/106/head branch January 14, 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.

5 participants