8000 [RELAND] Add UTs for accelerator device-agnostic runtime APIs by guangyey · Pull Request #133572 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[RELAND] Add UTs for accelerator device-agnostic runtime APIs #133572

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 69 commits into from

Conversation

guangyey
Copy link
Collaborator
@guangyey guangyey commented Aug 15, 2024

Stack from ghstack (oldest at bottom):

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

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10

Copy link
pytorch-bot bot commented Aug 15, 2024

🔗 Helpful Links

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

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 ac1aefd with merge base cf538ef (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Aug 15, 2024
guangyey added a commit that referenced this pull request Aug 15, 2024
ghstack-source-id: 3b5de65
Pull Request resolved: #133572
@guangyey guangyey marked this pull request as draft August 15, 2024 14:54
@guangyey guangyey changed the title Add UTs for accelerator device-agnostic runtime APIs [WIP] Add UTs for accelerator device-agnostic runtime APIs Aug 15, 2024
[ghstack-poisoned]
guangyey added a commit that referenced this pull request Aug 16, 2024
ghstack-source-id: 337ac20
Pull Request resolved: #133572
@guangyey guangyey added the intel This tag is for PR from Intel label Aug 16, 2024
guangyey added a commit that referenced this pull request Aug 16, 2024
ghstack-source-id: 6438fec
Pull Request resolved: #133572
@guangyey guangyey changed the title [WIP] Add UTs for accelerator device-agnostic runtime APIs Add UTs for accelerator device-agnostic runtime APIs Aug 16, 2024
@guangyey guangyey marked this pull request as ready for review August 16, 2024 08:39
@guangyey guangyey requested a review from albanD August 16, 2024 08:39
[ghstack-poisoned]
[ghstack-poisoned]
self.assertEqual(torch.current_accelerator(), "xpu")

@unittest.skipIf(not TEST_ACCELERATOR, "no avaliable accelerators detected")
def test_generic_multi_device_behavior(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add device to the input parameter. So that you can check if the current device type is the same as the input device type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refine the UTs to be more general.

guangyey added a commit that referenced this pull request Oct 4, 2024
ghstack-source-id: a1b18c0
Pull Request resolved: #133572
guangyey added a commit that referenced this pull request Oct 4, 2024
ghstack-source-id: e41814a
Pull Request resolved: #133572
[ghstack-poisoned]
[ghstack-poisoned]
guangyey added a commit that referenced this pull request Oct 8, 2024
ghstack-source-id: 2b51455
Pull Request resolved: #133572
guangyey added a commit that referenced this pull request Oct 8, 2024
ghstack-source-id: 70812fe
Pull Request resolved: #133572
guangyey added a commit that referenced this pull request Oct 8, 2024
ghstack-source-id: 2f42f77
Pull Request resolved: #133572
@guangyey guangyey marked this pull request as draft October 8, 2024 01:47
@guangyey guangyey changed the title Add UTs for accelerator device-agnostic runtime APIs [WIP] Add UTs for accelerator device-agnostic runtime APIs Oct 8, 2024
guangyey added a commit that referenced this pull request Oct 8, 2024
ghstack-source-id: a4c9660
Pull Request resolved: #133572
@huydhn
Copy link
Contributor
huydhn commented Dec 11, 2024

@pytorchbot revert -m 'Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore' -c nosignal

test_accelerator.py::TestAccelerator::test_generic_stream_behavior GH job link HUD commit link

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Dec 11, 2024
…138677)"

This reverts commit 734bb01.

Reverted #138677 on behalf of https://github.com/huydhn due to Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore ([comment](#133572 (comment)))
pytorchmergebot added a commit that referenced this pull request Dec 11, 2024
…#133572)"

This reverts commit 2091194.

Reverted #133572 on behalf of https://github.com/huydhn due to Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore ([comment](#133572 (comment)))
@pytorchmergebot
Copy link
Collaborator

@guangyey your PR has been successfully reverted.

kit1980 added a commit that referenced this pull request Dec 12, 2024
* Revert "[RELAND] Add device-agnostic runtime Device/Stream C++ API (#138677)"

This reverts commit 734bb01.

Reverted #138677 on behalf of https://github.com/huydhn due to Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore ([comment](#133572 (comment)))

* Revert "[RELAND] Add UTs for accelerator device-agnostic runtime APIs (#133572)"

This reverts commit 2091194.

Reverted #133572 on behalf of https://github.com/huydhn due to Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore ([comment](#133572 (comment)))

---------

Co-authored-by: PyTorch MergeBot <pytorchmergebot@users.noreply.github.com>
[ghstack-poisoned]
[ghstack-poisoned]
@guangyey
Copy link
Collaborator Author

@albanD I rebased these APIs used in test_accelerator.py to #140542 (set/current_device_idx => set/current_device_index)

[ghstack-poisoned]
[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.

SGTM

bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 2024
…8677)"

This reverts commit f84e533.

Reverted pytorch#138677 on behalf of https://github.com/malfet due to Sorry for reverting your PR, but it segfaults on MacOS ([comment](pytorch#133572 (comment)))
bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 2024
…#133572)"

This reverts commit 952514f.

Reverted pytorch#133572 on behalf of https://github.com/malfet due to Sorry for reverting your PR, but it segfaults on MacOS ([comment](pytorch#133572 (comment)))
bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 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#142468
bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 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#142468, pytorch#133572
bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 2024
…dx => index}` (pytorch#140542)"

This reverts commit fb02b40.

Reverted pytorch#140542 on behalf of https://github.com/huydhn due to Sorry for reverting your change, but I need to revert this in order to revert pytorch#133572 (comment) due to a conflict ([comment](pytorch#140542 (comment)))
bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 2024
…ytorch#138677)"

This reverts commit 734bb01.

Reverted pytorch#138677 on behalf of https://github.com/huydhn due to Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore ([comment](pytorch#133572 (comment)))
bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 2024
…pytorch#133572)"

This reverts commit 2091194.

Reverted pytorch#133572 on behalf of https://github.com/huydhn due to Sorry for reverting your change but the new test is still very flaky on MacOS even when it does not segfault anymore ([comment](pytorch#133572 (comment)))
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/62/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
ci-no-td Do not run TD on this PR ciflow/mps Run MPS tests (subset of trunk) ciflow/rocm Trigger "default" config CI on ROCm ciflow/trunk Trigger trunk jobs on your pull request ciflow/xpu Run XPU CI tasks intel This tag is for PR from Intel Merged open source Reverted topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0