Repository navigation
[BE] Build all XPU wheels on a single runner - #188136
Closed
chuanqi129 wants to merge 1 commit into
Closed
chuanqi129 wants to merge 1 commit into
chuanqi129 wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/188136
Note: Links to docs will display an error until the docs builds have been completed. ❌ 11 Unclassified FailuresAs of commit 2ae6280 with merge base c9fded8 ( 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:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
chuanqi129
marked this pull request as draft
June 25, 2026 14:37
Collaborator
Author
|
Current it will timeout, need to figure out it |
Contributor
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Add XPU to the unified wheel build path so all Python versions are built sequentially on one runner, reusing build/ across iterations. This matches the existing CPU/CUDA unified build pattern. The ExternalProject for oneDNN XPU (xpu_mkldnn_proj) is expensive (~1h24m) and would be re-cloned and rebuilt on every cmake reconfigure triggered by Python version switches. FindMKLDNN.cmake now detects an existing build and skips ExternalProject_Add on subsequent iterations. Template changes: - Add 'xpu' to unified_arch_types - XPU build gets 420-minute timeout (vs default 240) - XPU test jobs use _binary-test-xpu-linux.yml (separate from standard tests) - Per-group upload so XPU does not block CPU/CUDA uploads Test Plan: CI on this PR will exercise the unified XPU build with all Python versions on a single runner: ``` git push origin xpu-unified-wheel-build ``` Co-authored-by: AI assistant (Claude)
chuanqi129
force-pushed
the
xpu-unified-wheel-build
branch
from
August 31, 2026 05:19
d3f0354 to
2ae6280
Compare
Collaborator
Author
|
Close it due to #195699 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 16, 2026
Take over #188136. Builds all Linux XPU manywheel variants in one job, reusing ABI-independent C++/SYCL artifacts across Python versions while rebuilding Python-bound artifacts per interpreter. ## Before vs after Comparing the eight XPU matrix builds from [#195438 run 33729050328](https://github.com/pytorch/pytorch/actions/runs/33729050328) with the unified build from [this PR, run 34123506914](https://github.com/pytorch/pytorch/actions/runs/34123506914): ### Linux XPU build runner-minutes | Before (per-Python matrix, 8 jobs) | After (1 unified job) | Delta | |---|---:|---:| | 8 x ~78m = **623m** ([matrix jobs](https://github.com/pytorch/pytorch/actions/runs/33729050328)) | **139m** ([unified job](https://github.com/pytorch/pytorch/actions/runs/34123506914/job/101746866663)) | **-78%** | This saves approximately **484 runner-minutes per XPU manywheel build**. ### Per-Python build breakdown - First Python (cp310): **~74m** from a clean build. - Following seven Pythons (cp311 through cp315t): **~7m each** on average. - The unified job produced all eight XPU wheel artifacts successfully. The first build establishes the shared XPU backend. Subsequent interpreters reuse the SYCL kernel objects and device link, rebuilding only Python-ABI-bound components. ### Fix for SYCL reuse The earlier PATH-only tool pin did not prevent scikit-build-core from selecting the importable CMake/Ninja packages in each Python environment. The final implementation explicitly sets `CMAKE_EXECUTABLE` and passes the shared Ninja path through `CMAKE_ARGS`, keeping CMake's generated SYCL depfile commands stable across the loop. Local Python 3.10 then Python 3.11 XPU builds confirmed **zero SYCL object recompilations** and **zero XPU device relinks** on the second build. > AI-assisted drafting; CI measurements and implementation reviewed by the PR author. Pull Request resolved: #195699 Approved by: https://github.com/chuanqi129, https://github.com/atalman Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the unified single-runner wheel build pattern (from #184045 for CUDA and #183931 for CPU) to XPU nightly wheel builds.
manywheel-xpu-buildjob loops over all CPython versions sequentially, reusingbuild/across iterationslibtorch_python+_Care recompiled per interpreter via thecmake.pycache invalidationmanywheel-testdoes NOT depend on XPU build)Dependency chain
Test Plan
Regenerated workflow via:
Verified:
manywheel-xpu-buildjob generated with correct container, env, and artifact upload steps for all 8 Python versionsmanywheel-buildmatrix (ROCm-only now)manywheel-test-xpudepends onmanywheel-xpu-buildmanywheel-testdoes NOT depend on XPU (isolation preserved)manywheel-uploadincludesmanywheel-xpu-buildin its needscc @gujinghui @PenghuiCheng @XiaobingSuper @jianyuh @jgong5 @mingfeima @sanchitintel @ashokei @jingxu10 @min-jean-cho @yanbing-j @Guobing-Chen @Xia-Weiwen @snadampal