Skip to content

[xpu][feature] Add device-wide synchronization - #182630

Closed
guangyey wants to merge 3 commits into
gh/guangyey/333/basefrom
gh/guangyey/333/head
Closed

guangyey wants to merge 3 commits into
gh/guangyey/333/basefrom
gh/guangyey/333/head

Conversation

@guangyey

@guangyey guangyey commented May 6, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Motivation

This PR adds a device synchronization feature to XPU. It will block the calling until all commands previously submitted to any queue on this device have completed.

Additional Context

We will deprecate syncStreamsOnDevice when oneapi upgrade to 2026.1
Refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_wait.asciidoc

@pytorch-bot

pytorch-bot Bot commented May 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 1 Unrelated Failure, 2 Unclassified Failures

As of commit ad2d071 with merge base 7c2af59 (image):

NEW FAILURE - The following job has failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@guangyey
guangyey marked this pull request as draft May 6, 2026 09:15
@guangyey guangyey added ciflow/trunk Trigger trunk jobs on your pull request release notes: xpu release notes category labels May 6, 2026
@guangyey guangyey changed the title [xpu][feature] Add synchronization of any queue on the device [xpu][feature] Add synchronization api for any queue on the device May 6, 2026
[ghstack-poisoned]
@guangyey guangyey changed the title [xpu][feature] Add synchronization api for any queue on the device [xpu][feature] Add device-wide synchronization May 11, 2026
@guangyey
guangyey marked this pull request as ready for review May 18, 2026 06:29
guangyey added a commit that referenced this pull request May 29, 2026
@guangyey guangyey added the ciflow/xpu Run XPU CI tasks label May 29, 2026
guangyey added a commit that referenced this pull request May 29, 2026
guangyey added 2 commits May 29, 2026 11:09
[ghstack-poisoned]
[ghstack-poisoned]
@guangyey

Copy link
Copy Markdown
Collaborator Author

All XPU test case passed. The build failure is unrelated.
@pytorchbot merge -i

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 4 checks: trunk / win-vs2022-cpu-py3 / build, trunk / win-vs2022-cuda13.0-py3 / build, xpu / win-vs2022-xpu-n-1-py3 / build, xpu / win-vs2022-xpu-n-py3 / build

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

daisyden pushed a commit to daisyden/pytorch that referenced this pull request Jun 1, 2026
# Motivation
This PR adds a device synchronization feature to XPU. It will block the calling until all commands previously submitted to any queue on this device have completed.

# Additional Context
We will deprecate `syncStreamsOnDevice` when oneapi upgrade to 2026.1
Refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_wait.asciidoc
Pull Request resolved: pytorch#182630
Approved by: https://github.com/EikanWang
ghstack dependencies: pytorch#182624
khushi-411 pushed a commit to khushi-411/pytorch that referenced this pull request Jun 1, 2026
# Motivation
This PR adds a device synchronization feature to XPU. It will block the calling until all commands previously submitted to any queue on this device have completed.

# Additional Context
We will deprecate `syncStreamsOnDevice` when oneapi upgrade to 2026.1
Refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_wait.asciidoc
Pull Request resolved: pytorch#182630
Approved by: https://github.com/EikanWang
ghstack dependencies: pytorch#182624
pytorchmergebot pushed a commit that referenced this pull request Jun 16, 2026
# Motivation
This PR reverts #182630 to fix #187277

Root cause is `ext_oneapi_wait_and_throw` will introduce SYCL Graph to sync an invalid queue.

# Additional Context

This needs to be cherry-picked to the release branch.

Why isn't it captured on CI?
This issue is only found on BMG (Xe2), and the current CI is on Data Center GPU (Xe).
Pull Request resolved: #187306
Approved by: https://github.com/EikanWang, https://github.com/atalman
ghstack dependencies: #181233, #187137, #187232
atalman pushed a commit that referenced this pull request Jun 22, 2026
Revert XPU device-wide synchronization (#187306)

# Motivation
This PR reverts #182630 to fix #187277

Root cause is `ext_oneapi_wait_and_throw` will introduce SYCL Graph to sync an invalid queue.

# Additional Context

This needs to be cherry-picked to the release branch.

Why isn't it captured on CI?
This issue is only found on BMG (Xe2), and the current CI is on Data Center GPU (Xe).
Pull Request resolved: #187306
Approved by: https://github.com/EikanWang, https://github.com/atalman
ghstack dependencies: #181233, #187137, #187232

(cherry picked from commit 421abac)

Co-authored-by: Yu, Guangye <[email protected]>
@github-actions
github-actions Bot deleted the gh/guangyey/333/head branch June 29, 2026 02:30
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
# Motivation
This PR adds a device synchronization feature to XPU. It will block the calling until all commands previously submitted to any queue on this device have completed.

# Additional Context
We will deprecate `syncStreamsOnDevice` when oneapi upgrade to 2026.1
Refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_wait.asciidoc
Pull Request resolved: pytorch#182630
Approved by: https://github.com/EikanWang
ghstack dependencies: pytorch#182624
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
# Motivation
This PR reverts pytorch#182630 to fix pytorch#187277

Root cause is `ext_oneapi_wait_and_throw` will introduce SYCL Graph to sync an invalid queue.

# Additional Context

This needs to be cherry-picked to the release branch.

Why isn't it captured on CI?
This issue is only found on BMG (Xe2), and the current CI is on Data Center GPU (Xe).
Pull Request resolved: pytorch#187306
Approved by: https://github.com/EikanWang, https://github.com/atalman
ghstack dependencies: pytorch#181233, pytorch#187137, pytorch#187232
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
# Motivation
This PR adds a device synchronization feature to XPU. It will block the calling until all commands previously submitted to any queue on this device have completed.

# Additional Context
We will deprecate `syncStreamsOnDevice` when oneapi upgrade to 2026.1
Refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_device_wait.asciidoc
Pull Request resolved: pytorch#182630
Approved by: https://github.com/EikanWang
ghstack dependencies: pytorch#182624
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
# Motivation
This PR reverts pytorch#182630 to fix pytorch#187277

Root cause is `ext_oneapi_wait_and_throw` will introduce SYCL Graph to sync an invalid queue.

# Additional Context

This needs to be cherry-picked to the release branch.

Why isn't it captured on CI?
This issue is only found on BMG (Xe2), and the current CI is on Data Center GPU (Xe).
Pull Request resolved: pytorch#187306
Approved by: https://github.com/EikanWang, https://github.com/atalman
ghstack dependencies: pytorch#181233, pytorch#187137, pytorch#187232
pytorchmergebot pushed a commit that referenced this pull request Aug 4, 2026
…hronize (#191900)

1.Re-land #182630 . Formerly it is disabled because of bug on XPUGraph

# Motivation
This PR adds a device synchronization feature to XPU. It will block the calling until all commands previously submitted to any queue on this device have completed.

Related Spec: https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_wait.asciidoc

# Next Plan
Since the LTS driver for platforms like PVC are not rolled out for the full support, we are not deprecating the old `syncStreamsOnDevice`, will switch to `device_synchronize` once LTS driver are fully supported.

Pull Request resolved: #191900
Approved by: https://github.com/guangyey, https://github.com/EikanWang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request ciflow/xpu Run XPU CI tasks Merged open source release notes: xpu release notes category

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants