Skip to content

Conversation

@etaf
Copy link
Collaborator

@etaf etaf commented May 28, 2025

Stack from ghstack (oldest at bottom):

Following the design of #154413, this PR add XPU support for generating kernel binary files that support multiple archs.

Fixes #154682, Fixes #154683, Fixes 154689, Fixes #154685 , Fixes #154690, Fixes #154681

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov

@pytorch-bot
Copy link

pytorch-bot bot commented May 28, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit ef39ce7 with merge base 6cb6da6 (image):

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

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

@etaf etaf requested a review from desertfire May 28, 2025 14:31
@etaf etaf added topic: not user facing topic category ciflow/xpu Run XPU CI tasks labels May 28, 2025
@etaf etaf requested a review from EikanWang May 28, 2025 14:36
@etaf etaf moved this to Review Required in PyTorch Intel May 28, 2025
@etaf etaf added the ciflow/trunk Trigger trunk jobs on your pull request label May 28, 2025
@etaf etaf requested review from eellison and removed request for eellison May 28, 2025 23:16
@etaf
Copy link
Collaborator Author

etaf commented May 28, 2025

Hi, @desertfire @eellison Would you mind taking a look at this PR when you have time? We need it to address the XPU CI failures. Thank you very much!

Copy link
Contributor

@desertfire desertfire left a comment

Choose a reason for hiding this comment

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

I also did some config renaming in #154608. You will need to rebase after that.

binary = launcher.bin.asm[bin_type]
# Also store asm code which can be used for debugging and generating cpp package
asm_type = {"hip": "amdgcn", "cuda": "ptx"}.get(self.device_props.type, None)
asm_type = {"hip": "amdgcn", "cuda": "ptx", "xpu": "spv"}.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we already generate spv for xpu, shouldn't the added new option be a no-op for xpu?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @desertfire , Yes, in theory XPU doesn’t need this option. I added it to align with the user interface, and also to fix some errors that occur on XPU when this option is specified in UT. For example: https://hud.pytorch.org/pr/pytorch/pytorch/147693#43085076369

RuntimeError: Failed to run autotuning code block: Missing kernel assembly code

And this may also helps avoid adding multiple if-else checks in the code specifically for XPU.

if hash_type in {"amdgcn", "code", "ptx"}:
if hash_type in {"amdgcn", "code", "ptx", "spv"}:
return code_hash(content, extra)
if hash_type in {"cubin", "hsaco", "spv"}:
Copy link
Contributor

Choose a reason for hiding this comment

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

It probably doesn't matter in terms of functionality, but "spv" will not hit this branch anymore.

…for XPU."


Following the design of #154413, this PR add XPU support for generating kernel binary files that support multiple archs.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov

[ghstack-poisoned]
etaf added a commit that referenced this pull request Jun 3, 2025
…for XPU."


Following the design of #154413, this PR add XPU support for generating kernel binary files that support multiple archs.

Fixes #154682, Fixes #154683, Fixes 154689, Fixes #154685 , Fixes #154690, Fixes #154681

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov

[ghstack-poisoned]
etaf added a commit that referenced this pull request Jun 3, 2025
@etaf
Copy link
Collaborator Author

etaf commented Jun 3, 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

@github-project-automation github-project-automation bot moved this from Review Required to Done in PyTorch Intel Jun 3, 2025
iupaikov-amd pushed a commit to ROCm/pytorch that referenced this pull request Jun 4, 2025
angelayi pushed a commit to angelayi/pytorch that referenced this pull request Jun 5, 2025
@github-actions github-actions bot deleted the gh/etaf/133/head branch July 4, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants