Skip to content

Add uv-based build_wheels_linux_v2.yml + torchvision test (replaces conda) - #8336

Draft
atalman wants to merge 3 commits into
pytorch:mainfrom
atalman:add-build-wheels-linux-v2-uv
Draft

Add uv-based build_wheels_linux_v2.yml + torchvision test (replaces conda)#8336
atalman wants to merge 3 commits into
pytorch:mainfrom
atalman:add-build-wheels-linux-v2-uv

Conversation

@atalman

@atalman atalman commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a uv-based replacement for the conda build path, plus a test that exercises it:

  1. build_wheels_linux_v2.yml — V2 of build_wheels_linux.yml that provisions Python and the build toolchain with uv instead of conda/miniforge.
  2. test_build_wheels_linux_v2.yml — builds torchvision (pytorch/vision) through v2 as an end-to-end shakedown. Matrix trimmed to Python 3.12 for now; expand once green.

Draft: build-critical, needs CI validation across variants.

What changed vs v1 (conda)

  • No conda / miniforge. uv installs the requested Python (incl. free-threaded 3.13t/3.14t + pre-releases via python-build-standalone) and creates a --seed venv activated for every build/test step. Drops the 3.14t special-case and the aarch64 Miniforge step.
  • pytorch_pkg_helpers (which produces BUILD_ENV_FILE) is run via uv.
  • Build tools cmake/ninja/wheel/build via uv pip; system libs conda used to supply (openssl/libpng/libwebp/pkg-config) come from the manylinux builder image or the caller's pre-script.
  • Drop-in caller surface (same inputs/secrets/outputs as v1; setup-miniconda kept but ignored), plus optional python-version override. CONDA_RUN kept as an empty string to keep step bodies diff-minimal.

Why torchvision for the test

Compiled C++/CUDA extension (setup-py + pre/post scripts + smoke test) → exercises the uv interpreter, cmake/ninja, torch-dep install, manylinux repair, and smoke test end-to-end. Its pre_build_script.sh installs several system deps, so it's a good canary for the "does the image still provide openssl/libpng/…?" question.

Not yet validated (why draft)

  • CPU / CUDA / ROCm / XPU builds (torchvision) on Python 3.12
  • Confirm builder images provide openssl/libpng/libwebp/pkg-config (or move to pre-script)
  • Expand matrix (more Python versions incl. a free-threaded build) once green
  • aarch64 (no Miniforge now)

Open questions

  • Refactor the inlined uv setup into a shared setup-binary-builds-uv action (like v1 uses setup-binary-builds)?
  • Keep v1 + v2 during migration, or gate v2 behind an input?

V2 of build_wheels_linux.yml that provisions Python and the build toolchain
with uv instead of conda/miniforge:
- uv installs the requested Python (incl. free-threaded 3.13t/3.14t and
  pre-releases) and creates a --seed venv activated for all build/test steps.
- pytorch_pkg_helpers (BUILD_ENV_FILE) is run via uv.
- Build tools cmake/ninja/wheel/build installed via uv pip; system libs are
  expected from the manylinux builder image / caller pre-script.
- Same input/secret/output surface as v1 (drop-in), plus an optional
  python-version override; no aarch64 miniforge step.

Needs CI validation across CPU/CUDA/ROCm/XPU + aarch64 before use.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

@atalman is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@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 Jul 21, 2026
@atalman
atalman force-pushed the add-build-wheels-linux-v2-uv branch from ba869ab to 9265993 Compare July 21, 2026 11:42
…3.12

Exercises build_wheels_linux_v2.yml end-to-end by building pytorch/vision
(compiled C++/CUDA extension). Matrix trimmed to Python 3.12 for the initial
uv shakedown; expand once green.
@atalman atalman changed the title Add build_wheels_linux_v2.yml (uv-based, replaces conda) Add uv-based build_wheels_linux_v2.yml + torchvision test (replaces conda) Jul 21, 2026
…lcheck

`BUILD_VENV: ${{ runner.temp }}/build_venv` used the `runner` context in a
job-level env: block, where it is not available (only github/inputs/matrix/
needs/secrets/strategy/vars are). actionlint flags this as an error and GitHub
rejects the whole reusable workflow at parse time, so the test_build_wheels_
linux_v2 caller produced 0 jobs and failed immediately ("workflow not running").

Set BUILD_VENV from $RUNNER_TEMP in an early step (via $GITHUB_ENV) instead.

Also clear the remaining actionlint/shellcheck findings on the new v2 file so
the Lint check (which lints the diff, i.e. every line of a new file) passes:
- SC1090: add `# shellcheck disable=SC1090` before each `source "$BUILD_ENV_FILE"`
- SC2155: add `# shellcheck disable=SC2155` on `export PYTORCH_VERSION=$(...)`
- SC2086: quote "$pkg" / "$abs_pkg" in the manylinux repair loop
- SC2115: `rm -rf "${RUNNER_TEMP:?}/"*` (also fixes a quoted-glob bug that
  removed a literal `*` and cleaned nothing)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant