10000 xpu: get xpu arch flags at runtime in cpp_extensions by dvrogozh · Pull Request #152192 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

xpu: get xpu arch flags at runtime in cpp_extensions #152192

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 1 commit into from

Conversation

dvrogozh
Copy link
Contributor
@dvrogozh dvrogozh commented Apr 25, 2025

This commit moves query for xpu arch flags to runtime when building SYCL extensions which allows to adjust TORCH_XPU_ARCH_LIST at python script level. That's handy for example in ci test which gives a try few variants of the list.

CC: @malfet, @jingxu10, @EikanWang, @guangyey

cc @gujinghui @EikanWang @fengyuan14 @guangyey

Copy link
pytorch-bot bot commented Apr 25, 2025

🔗 Helpful Links

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

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 96f1e66 with merge base 9608e7f (image):

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.

@dvrogozh
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Apr 25, 2025
@dvrogozh
Copy link
Contributor Author

@pytorchbot label "module: xpu"

@pytorch-bot pytorch-bot bot added the module: xpu Intel XPU related issues label Apr 25, 2025
@dvrogozh
Copy link
Contributor Author

@pytorchbot label "ciflow/xpu"

Copy link
pytorch-bot bot commented Apr 25, 2025

To add these label(s) (ciflow/xpu) to the PR, please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@guangyey guangyey added the ciflow/xpu Run XPU CI tasks label Apr 28, 2025
@guangyey guangyey moved this to Review Required in PyTorch Intel Apr 28, 2025
@guangyey guangyey added the release notes: xpu release notes category label Apr 28, 2025
@pytorch-bot pytorch-bot bot removed the ciflow/xpu Run XPU CI tasks label Apr 28, 2025
@dvrogozh
Copy link
Contributor Author

In the last push to PR - fix of linter issue, no other changes.

@guangyey guangyey added the ciflow/xpu Run XPU CI tasks label Apr 28, 2025
@pytorch-bot pytorch-bot bot removed the ciflow/xpu Run XPU CI tasks label Apr 28, 2025
@guangyey guangyey added keep-going Don't stop on first failure, keep running tests until the end ciflow/xpu Run XPU CI tasks labels Apr 29, 2025
@guangyey
Copy link
Collaborator
guangyey commented May 8, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased extension onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout extension && git pull --rebase)

@pytorch-bot pytorch-bot bot removed the ciflow/xpu Run XPU CI tasks label May 8, 2025
@guangyey guangyey added ciflow/xpu Run XPU CI tasks ciflow/trunk Trigger trunk jobs on your pull request labels May 8, 2025
@guangyey guangyey requested review from malfet, atalman and albanD May 8, 2025 02:25
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.

Sure

@@ -291,16 +291,25 @@ def _get_sycl_arch_list():
# If arch list returned by _get_sycl_arch_list() is empty, then sycl kernels will be compiled
# for default spir64 target and avoid device specific compilations entirely. Further, kernels
# will be JIT compiled at runtime.
def _get_sycl_target_flags():
if _get_sycl_arch_list() != '':
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you build the full arch list just to check if it's empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

User can either specify the empty arch list externally (via TORCH_XPU_ARCH_LIST building his extension) or default arch list can be empty if that's how user's pytorch version was originally built (with empty TORCH_XPU_ARCH_LIST when building pytorch). Further, empty arch list is still a valid case since it corresponds to JIT runtime compilation. This if handles options difference between JIT and AOT cases.

@guangyey
Copy link
Collaborator
guangyey commented May 9, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

This commit moves query for xpu arch flags to runtime when building
SYCL extensions which allows to adjust `TORCH_XPU_ARCH_LIST` at
python script level. That's handy for example in ci test which
gives a try few variants of the list.

Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
@pytorchmergebot
Copy link
Collaborator

Successfully rebased extension onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout extension && git pull --rebase)

8000

@pytorch-bot pytorch-bot bot removed ciflow/trunk Trigger trunk jobs on your pull request ciflow/xpu Run XPU CI tasks labels May 9, 2025
@guangyey guangyey added ciflow/xpu Run XPU CI tasks ciflow/trunk Trigger trunk jobs on your pull request labels May 9, 2025
@guangyey
Copy link
Collaborator
guangyey commented May 9, 2025

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

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

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 keep-going Don't stop on first failure, keep running tests until the end Merged module: xpu Intel XPU related issues open source release notes: xpu release notes category topic: not user facing topic category
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants
0