Skip to content

Enable the SYCL launcher path for XPU builds - #195436

Closed
xuhancn wants to merge 12 commits into
pytorch:mainfrom
xuhancn:agent/enable-compiler-cache-for-xpu-linux
Closed

xuhancn wants to merge 12 commits into
pytorch:mainfrom
xuhancn:agent/enable-compiler-cache-for-xpu-linux

Conversation

@xuhancn

@xuhancn xuhancn commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Enable the SYCL launcher path for XPU builds.

Highlights:

  • CMakeLists.txt includes SYCL in the USE_CCACHE launcher loop, so CMAKE_SYCL_COMPILER_LAUNCHER is set through the same top-level CMake logic as the other compiler launchers.
  • The downstream support in intel/torch-xpu-ops#5154 has merged as commit 8cad22eb640c5df28b7592f0d559a80ea7b09252.
  • This PR intentionally does not update third_party/xpu.txt. The current PyTorch pin, c513b6ad85ffe36858bfbf39fb1103d19cecd8e2, predates the downstream support, so per-TU SYCL launcher coverage becomes active after a normal torch-xpu-ops pin update reaches 8cad22eb640c5df28b7592f0d559a80ea7b09252 or newer.
  • The launcher wiring is shared by Linux and Windows XPU builds.

Performance:

Platform Without SYCL sccache With SYCL sccache Improvement
Linux XPU 25 min 20 min 20%
Windows XPU 1 hr 40 min 1 hr 33 min 7%

The measurements compare the baseline PR with this PR, using a torch-xpu-ops revision containing the downstream support. See the source results and CI links.

Test Plan:

  • Local Linux XPU build with the downstream support; torch_xpu_ops with ccache depend_mode rebuilds 376/376 objects through the cache.
  • Linux and Windows XPU CI measurements linked above.
  • lintrunner -a CMakeLists.txt
  • git diff --check -- CMakeLists.txt

AI-assisted update: The downstream dependency note, conflict resolution, performance clarification, and verification commands above were drafted with an AI coding assistant and reviewed by the PR author.

@xuhancn
xuhancn requested a review from a team as a code owner August 31, 2026 11:41
@pytorch-bot

pytorch-bot Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

✅ No Failures

As of commit 8781cc4 with merge base 8013239 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@xuhancn xuhancn added topic: not user facing topic category ciflow/trunk Trigger trunk jobs on your pull request ciflow/xpu Run XPU CI tasks labels Aug 31, 2026
@xuhancn
xuhancn force-pushed the agent/enable-compiler-cache-for-xpu-linux branch from d5b0a07 to e2484a2 Compare August 31, 2026 11:53
@xuhancn xuhancn changed the title [CI] Enable sccache for the host compiler of XPU Linux builds Update torch-xpu-ops pin to pick up per-TU SYCL launcher support Aug 31, 2026
@xuhancn
xuhancn marked this pull request as draft August 31, 2026 12:28
@xuhancn xuhancn changed the title Update torch-xpu-ops pin to pick up per-TU SYCL launcher support Enable SYCL launcher in CMake for XPU builds Sep 1, 2026
@xuhancn xuhancn changed the title Enable SYCL launcher in CMake for XPU builds Enable the SYCL launcher path for XPU builds on Linux Sep 1, 2026
@xuhancn
xuhancn marked this pull request as ready for review September 2, 2026 02:20
@xuhancn xuhancn changed the title Enable the SYCL launcher path for XPU builds on Linux Enable the SYCL launcher path for XPU builds Sep 2, 2026
@xuhancn
xuhancn force-pushed the agent/enable-compiler-cache-for-xpu-linux branch from 07fab40 to 9ca978e Compare September 2, 2026 02:54
Bump third_party/xpu.txt to c150ee84 (intel/torch-xpu-ops), which
routes the per-TU icpx -fsycl -c object compiles through
CMAKE_SYCL_COMPILER_LAUNCHER (extends pytorch#2260's device-link-only
support), so a compiler cache can cover the torch_xpu_ops SYCL
objects.

The XPU host fraction is already cached via the existing USE_CCACHE
default (sccache auto-selected when ccache is absent, as on the CI
image), matching how CUDA builds enable sccache.

Test: local Linux XPU build; torch_xpu_ops with ccache depend_mode
rebuilds 376/376 object compiles (host + SYCL) and hits on warm
rebuild.
@EikanWang
EikanWang marked this pull request as draft September 3, 2026 14:01
Comment thread CMakeLists.txt Resolved
Comment thread third_party/xpu.txt Resolved
Comment thread .gitmodules Resolved
…er-cache-for-xpu-linux

# Conflicts:
#	third_party/xpu.txt
CMAKE_SYCL_COMPILER_LAUNCHER is a normal cache variable read by torch-xpu-ops FindSYCL.cmake, not a dependency on native CMake SYCL-language support. Document that contract next to the ccache/sccache launcher wiring.\n\nTest Plan:\n\n\n\nAI-assisted: This commit was authored with the help of an AI coding assistant.
@xuhancn
xuhancn marked this pull request as ready for review September 14, 2026 03:00
@xuhancn
xuhancn requested a review from atalman September 14, 2026 03:00
Pin torch-xpu-ops to the latest main commit, which includes the merged
SYCL compiler launcher support from intel/torch-xpu-ops#5154.

Test Plan:

```
lintrunner -a third_party/xpu.txt
git diff --check -- third_party/xpu.txt
```

AI-assisted: This commit was authored with the help of an AI coding assistant.
Keep the newer torch-xpu-ops main pin from this branch while merging the
latest PyTorch main changes. The selected pin contains the merged SYCL
compiler launcher support from intel/torch-xpu-ops#5154.

Test Plan:

```
lintrunner -a CMakeLists.txt third_party/xpu.txt
git diff --check upstream/main -- CMakeLists.txt third_party/xpu.txt
```

AI-assisted: This commit was authored with the help of an AI coding assistant.
@xuhancn

xuhancn commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

@atalman please review this PR.

Keep this PR focused on wiring the top-level SYCL compiler launcher. The downstream per-TU support merged after PyTorch's current pin and can arrive through the normal torch-xpu-ops pin update process, avoiding a conflict with concurrent pin bumps.

Test Plan:

```
lintrunner -a
git diff --check upstream/main -- CMakeLists.txt third_party/xpu.txt
```

Authored with the assistance of an AI coding assistant.
Advance the PR merge base so third_party/xpu.txt is inherited from current PyTorch main and no longer appears in this PR's effective diff.

Test Plan:

```
lintrunner -a
git diff --check upstream/main -- CMakeLists.txt third_party/xpu.txt
```

Authored with the assistance of an AI coding assistant.
@xuhancn

xuhancn commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
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

@xuhancn
xuhancn deleted the agent/enable-compiler-cache-for-xpu-linux branch September 16, 2026 16:45
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 topic: not user facing topic category

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants