ci: install pinned torch before requirements-ci.txt on macOS#19342
Open
rascani wants to merge 2 commits intopytorch:mainfrom
Open
ci: install pinned torch before requirements-ci.txt on macOS#19342rascani wants to merge 2 commits intopytorch:mainfrom
rascani wants to merge 2 commits intopytorch:mainfrom
Conversation
`setup-macos.sh` runs `install_pip_dependencies` before `install_pytorch_and_domains`. That order lets torchsr's transitive torch dep get pulled from PyPI before the pinned source-built or S3-cached torch lands; `install_pytorch_and_domains` then overwrites the wrong-source torch. The overwrite is small in the current state, but the same race forced --no-cache-dir`. That cascaded reinstalls of every torch transitive dep, pushed the macOS unittest past its 60-minute timeout, until pytorch#19334 reverted it. Reorder so `install_pip_dependencies` runs after `install_pytorch_and_domains`. With torch already at the pinned version, torchsr's dep is satisfied and pip skips re-downloading. Removes the structural footgun so any future re-land of centralized torch install does not need `--force-reinstall`. Also rewrite two adjacent comments: - Add a comment above `install_pytorch_and_domains` recording the ordering rationale. - Drop the now-misleading "We build PyTorch from source here" comment that drifted above `install_executorch`; replace with one explaining why `install_executorch --use-pt-pinned-commit` is correct (torch is already installed). Authored with Claude Code.
This PR needs a
|
JacobSzwejbka
approved these changes
May 6, 2026
`install_pytorch_and_domains`'s source-build fallback runs `python setup.py bdist_wheel`, which needs pyyaml, typing-extensions, ninja, and other PyTorch build-time deps. Those used to be present only because requirements-ci.txt happened to include them; the previous commit's reorder removed that incidental coverage and broke the fallback when the macOS wheel cache misses. Install PyTorch's own `requirements-build.txt` before the source build so it owns its deps and is order-independent. Authored with Claude Code.
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
setup-macos.shrunsinstall_pip_dependenciesbeforeinstall_pytorch_and_domains. That order lets torchsr's transitive torch dep get pulled from PyPI before the pinned source-built or S3-cached torch lands;install_pytorch_and_domainsthen overwrites the wrong-source torch.The overwrite is small in the current state, but the same race forced --no-cache-dir`. That cascaded reinstalls of every torch transitive dep, pushed the macOS unittest past its 60-minute timeout, until #19334 reverted it.
Reorder so
install_pip_dependenciesruns afterinstall_pytorch_and_domains. With torch already at the pinned version, torchsr's dep is satisfied and pip skips re-downloading. Removes the structural footgun so any future re-land of centralized torch install does not need--force-reinstall.Also rewrite two adjacent comments:
install_pytorch_and_domainsrecording the ordering rationale.install_executorch; replace with one explaining whyinstall_executorch --use-pt-pinned-commitis correct (torch is already installed).Authored with Claude Code.
Test plan
CI