Skip to content

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Oct 18, 2025

Summary:

In recent versions of setuptools, the behavior of using PEP 517 (enforce build isolation, https://peps.python.org/pep-0517/) flipped from False to True. This broke torchao builds as our setup.py file depends on not having build isolation, as it imports build extension class definitions from torch (

ao/setup.py

Line 106 in 94dee9c

BuildExtension,
).

A long term fix would be modernize the torchao build system to honor PEP 517. However, to unbreak CI and buy us some time, in the short term we can just require build isolation for building torchao. This PR implements the short term workaround.

An AI-generated writeup I used to debug this, with more details: https://gist.github.com/vkuzo/5e6f282fda816c2cd4bce8c7fc1f30e2

Note that I had to add a pyproject.toml file to make pip install . run without warnings.

Test Plan:

// both of the commands below work
with-proxy USE_CPP=0 pip install -e . --no-build-isolation
with-proxy USE_CPP=1 pip install -e . --no-build-isolation --verbose

// will check CI

Reviewers:

Subscribers:

Tasks:

Tags:

Copy link

pytorch-bot bot commented Oct 18, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Cancelled Job, 1 Unrelated Failure

As of commit f58e799 with merge base 94dee9c (image):

NEW FAILURE - The following job has failed:

CANCELLED JOB - The following job was cancelled. Please retry:

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.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 18, 2025
@vkuzo vkuzo requested a review from atalman October 18, 2025 12:42
@vkuzo vkuzo added the topic: bug fix Use this tag for PRs that fix bugs label Oct 18, 2025
Summary:

TODO write me

Test Plan:

```bash
// both of the commands below work
with-proxy USE_CPP=0 pip install -e . --no-build-isolation
with-proxy USE_CPP=1 pip install -e . --no-build-isolation --verbose
```

Reviewers:

Subscribers:

Tasks:

Tags:
@vkuzo vkuzo force-pushed the 20251018_fix_build branch from 34b6ec5 to f58e799 Compare October 18, 2025 12:46
@vkuzo
Copy link
Contributor Author

vkuzo commented Oct 18, 2025

note: test-cpu-ops andtest-nightly are failing in main branch for other reasons, so looks like CI is as green as it can be

@vkuzo
Copy link
Contributor Author

vkuzo commented Oct 18, 2025

@atalman , I'm guessing if we go forward with this we'll also need to modify https://github.com/pytorch/test-infra/blob/a287d59209eb9221fa2428c3930efdc8643ad801/.github/workflows/build_wheels_linux.yml#L245 to use --no-build-isolation, gated to torchao only?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/4xh100 CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: rocm topic: bug fix Use this tag for PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants