Skip to content

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

@pytorch-bot
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 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 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: e41814a
Pull Request resolved: #133572
[ghstack-poisoned]
[ghstack-poisoned]
@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
@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 <[email protected]>
[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

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/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.

8 participants