Build PyTorch wheel via PEP 517 instead of setup.py - #21562
Open
shoumikhin wants to merge 1 commit into
Open
Conversation
Recent PyTorch nightlies removed support for "python setup.py bdist_wheel" and build through scikit-build-core (PEP 517) via pyproject.toml. The CI Docker image still built PyTorch with setup.py, so pinning to a newer nightly failed the image build. Build the wheel with the standard frontend (python -m build) with build isolation disabled, so PyTorch builds against the image's numpy and toolchain and reuses sccache. Install the PEP 517 build requirements explicitly since the frontend does not fetch them when isolation is off.
This PR needs a
|
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.
Problem
Recent PyTorch nightlies removed
python setup.py bdist_wheel. PyTorch now builds through scikit-build-core using the standard PEP 517 interface (pyproject.toml). The CI Docker image still builds PyTorch withsetup.py, so bumping the pin to a newer nightly fails the image build with:Fix
Build the wheel with
python -m build --wheel --no-isolation:python -m buildis the standard PEP 517 frontend and works with PyTorch's scikit-build-core backend.--no-isolationmakes PyTorch build against the image'snumpyand toolchain (avoids a build-vs-runtime ABI mismatch) and lets the build reusesccache.[build-system].requires.The produced wheel still lands in
dist/, so the install step is unchanged.Testing
The Docker image build in this PR exercises the new build path end to end.