Skip to content

Use container: directive for linux binary build/test workflows - #181599

Closed
atalman wants to merge 11 commits into
gh/atalman/13/basefrom
gh/atalman/13/head
Closed

atalman wants to merge 11 commits into
gh/atalman/13/basefrom
gh/atalman/13/head

Conversation

@atalman

@atalman atalman commented Apr 27, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native container: directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

_binary-build-linux.yml and _binary-test-linux.yml are converted in
place: runs-on: <runner> + container: image: <image>:<tag>. The
CUDA test job adds --gpus all -e NVIDIA_DRIVER_CAPABILITIES=... via
container.options. _binary-test-rocm-linux.yml and
_binary-test-xpu-linux.yml get the same treatment with their device
passthrough flags.

s390x carve-out: the s390x runners are self-hosted, only register
with the bare linux.s390x label, and lack a host-level docker CLI
compatible with GHA's container directive (they use podman). Two new
reusables, _binary-build-linux-s390x.yml and
_binary-test-linux-s390x.yml, hold the legacy docker run-from-step
flow for s390x; the template routes s390x to those and everything
else to the new container-based reusables.

Build scripts in .ci/* are unchanged.

Authored with Claude.

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Updated to use the new reusables:
  - linux-binary-manywheel-nightly.yml (x86 cpu/cuda standard tests)
  - linux-aarch64-binary-manywheel-nightly.yml (aarch64 cpu/cuda)
  - linux-s390x-binary-manywheel-nightly.yml
  - _binary-test-rocm-linux.yml (was inline DinD; now container:
    directive with ROCm device passthrough via container.options)
  - _binary-test-xpu-linux.yml (same approach with /dev/dri passthrough)

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 14 New Failures, 14 Cancelled Jobs

As of commit 09b27bb with merge base d3b8bf0 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

…lows"

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Updated to use the new reusables:
  - linux-binary-manywheel-nightly.yml (x86 cpu/cuda standard tests)
  - linux-aarch64-binary-manywheel-nightly.yml (aarch64 cpu/cuda)
  - linux-s390x-binary-manywheel-nightly.yml
  - _binary-test-rocm-linux.yml (was inline DinD; now container:
    directive with ROCm device passthrough via container.options)
  - _binary-test-xpu-linux.yml (same approach with /dev/dri passthrough)

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request Apr 27, 2026
Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Updated to use the new reusables:
  - linux-binary-manywheel-nightly.yml (x86 cpu/cuda standard tests)
  - linux-aarch64-binary-manywheel-nightly.yml (aarch64 cpu/cuda)
  - linux-s390x-binary-manywheel-nightly.yml
  - _binary-test-rocm-linux.yml (was inline DinD; now container:
    directive with ROCm device passthrough via container.options)
  - _binary-test-xpu-linux.yml (same approach with /dev/dri passthrough)

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

ghstack-source-id: 9966c43
Pull Request resolved: #181599
@atalman atalman added ciflow/binaries Trigger all binary build and upload jobs on the PR ciflow/nightly Trigger all jobs we run nightly (nightly.yml) labels Apr 27, 2026
…lows"

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Updated to use the new reusables:
  - linux-binary-manywheel-nightly.yml (x86 cpu/cuda standard tests)
  - linux-aarch64-binary-manywheel-nightly.yml (aarch64 cpu/cuda)
  - linux-s390x-binary-manywheel-nightly.yml
  - _binary-test-rocm-linux.yml (was inline DinD; now container:
    directive with ROCm device passthrough via container.options)
  - _binary-test-xpu-linux.yml (same approach with /dev/dri passthrough)

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request Apr 27, 2026
Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Linux template (linux_binary_build_workflow.yml.j2) now points the
manywheel-build / manywheel-test jobs at these new reusables, and
_binary-test-rocm-linux.yml / _binary-test-xpu-linux.yml are converted
in-place to container: directive (ROCm device passthrough + XPU
/dev/dri passthrough via container.options).

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

ghstack-source-id: 7e27a52
Pull Request resolved: #181599
@atalman atalman changed the title Use container: directive for linux binary build/test workflows [BE] Use container: directive for linux binary build/test workflows Apr 27, 2026
…t workflows"

## Summary

Replace the docker-in-docker dance in the matrix-driven Linux binary workflows with GitHub Actions' native `container:` directive. Each matrix-cell job now starts directly inside the build container — the existing `.ci/*` shell scripts read the same env vars (`PYTORCH_ROOT`, `PYTORCH_FINAL_PACKAGE_DIR`, `BINARY_ENV_FILE`, ...) and run unchanged.

Stacked on top of #181586 (slim templates).

## What's new

- `.github/workflows/_binary-container-build-linux.yml`
- `.github/workflows/_binary-container-test-linux.yml`

Both follow the same pattern: `runs-on: <runner>` + `container: image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via `container.options`.

## What's modified

- `linux_binary_build_workflow.yml.j2` — `manywheel-build` / `manywheel-test` jobs now `uses:` the new `_binary-container-{build,test}-linux.yml` reusables.
- `_binary-test-rocm-linux.yml` — converted in-place to `container:` directive; ROCm device passthrough (`--device=/dev/mem --device=/dev/kfd --device=/dev/dri --group-add video --group-add daemon`) supplied via `container.options`.
- `_binary-test-xpu-linux.yml` — same approach, with `/dev/dri` passthrough.

## What's unchanged

- `.ci/*` build scripts — same env contract as the legacy `_binary-build-linux.yml` / `_binary-test-linux.yml` flow.
- The legacy `_binary-build-linux.yml` / `_binary-test-linux.yml` reusables are not deleted (other consumers may reference them); they're simply unused by the matrix-driven workflows after this PR.
- macOS / Windows workflows untouched (no `container:` support on those runners).

## Test plan

- [ ] Linux x86 build + test (cpu, cuda, rocm, xpu) on `ciflow/binaries_wheel/*` tag.
- [ ] Linux aarch64 build + test (cpu, cuda) on tag.
- [ ] Linux s390x build + test on tag.
- [ ] Verify uploaded wheels match the legacy DinD output for at least one config (cpu + cuda12.6).

## Caveats

- ROCm `container.options: --device=...` may need additional flags (e.g. `--privileged` or `--security-opt`); verify on first CI run.
- XPU dropped the legacy `setup-xpu` / `teardown-xpu` host-side actions — the docker image already carries oneAPI runtime, so no host-side setup should be needed inside the container.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request Apr 28, 2026
Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Linux template (linux_binary_build_workflow.yml.j2) now points the
manywheel-build / manywheel-test jobs at these new reusables, and
_binary-test-rocm-linux.yml / _binary-test-xpu-linux.yml are converted
in-place to container: directive (ROCm device passthrough + XPU
/dev/dri passthrough via container.options).

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

ghstack-source-id: a6b0f28
Pull Request resolved: #181599
…t workflows"

## Summary

Replace the docker-in-docker dance in the matrix-driven Linux binary workflows with GitHub Actions' native `container:` directive. Each matrix-cell job now starts directly inside the build container — the existing `.ci/*` shell scripts read the same env vars (`PYTORCH_ROOT`, `PYTORCH_FINAL_PACKAGE_DIR`, `BINARY_ENV_FILE`, ...) and run unchanged.

Stacked on top of #181586 (slim templates).

## What's new

- `.github/workflows/_binary-container-build-linux.yml`
- `.github/workflows/_binary-container-test-linux.yml`

Both follow the same pattern: `runs-on: <runner>` + `container: image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via `container.options`.

## What's modified

- `linux_binary_build_workflow.yml.j2` — `manywheel-build` / `manywheel-test` jobs now `uses:` the new `_binary-container-{build,test}-linux.yml` reusables.
- `_binary-test-rocm-linux.yml` — converted in-place to `container:` directive; ROCm device passthrough (`--device=/dev/mem --device=/dev/kfd --device=/dev/dri --group-add video --group-add daemon`) supplied via `container.options`.
- `_binary-test-xpu-linux.yml` — same approach, with `/dev/dri` passthrough.

## What's unchanged

- `.ci/*` build scripts — same env contract as the legacy `_binary-build-linux.yml` / `_binary-test-linux.yml` flow.
- The legacy `_binary-build-linux.yml` / `_binary-test-linux.yml` reusables are not deleted (other consumers may reference them); they're simply unused by the matrix-driven workflows after this PR.
- macOS / Windows workflows untouched (no `container:` support on those runners).

## Test plan

- [ ] Linux x86 build + test (cpu, cuda, rocm, xpu) on `ciflow/binaries_wheel/*` tag.
- [ ] Linux aarch64 build + test (cpu, cuda) on tag.
- [ ] Linux s390x build + test on tag.
- [ ] Verify uploaded wheels match the legacy DinD output for at least one config (cpu + cuda12.6).

## Caveats

- ROCm `container.options: --device=...` may need additional flags (e.g. `--privileged` or `--security-opt`); verify on first CI run.
- XPU dropped the legacy `setup-xpu` / `teardown-xpu` host-side actions — the docker image already carries oneAPI runtime, so no host-side setup should be needed inside the container.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request Apr 28, 2026
Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

What's new:
  - .github/workflows/_binary-container-build-linux.yml
  - .github/workflows/_binary-container-test-linux.yml

Both follow the same pattern: `runs-on: <runner>` + `container:
image: <DOCKER_IMAGE>:<DOCKER_IMAGE_TAG_PREFIX>`. The CUDA test job
adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options.

Linux template (linux_binary_build_workflow.yml.j2) now points the
manywheel-build / manywheel-test jobs at these new reusables, and
_binary-test-rocm-linux.yml / _binary-test-xpu-linux.yml are converted
in-place to container: directive (ROCm device passthrough + XPU
/dev/dri passthrough via container.options).

Build scripts in .ci/* are unchanged — same env contract as the
legacy _binary-build-linux.yml / _binary-test-linux.yml flow.

Authored with Claude.

ghstack-source-id: 7875107
Pull Request resolved: #181599
@atalman atalman changed the title [BE] Use container: directive for linux binary build/test workflows [BE] Use container: directive for binary build/test workflows Apr 28, 2026
atalman added a commit that referenced this pull request May 5, 2026
…it env setup, deps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 5, 2026
…ps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 5, 2026
Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
helpers, and write the new helpers in Python rather than shell:

- build_env_setup.py    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.py shared build-time dependency install
- build_wheel.py        the actual wheel build (python -m build)
- repair_wheel.py       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.py +
build_wheel.py) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

build_env_setup.py writes its build-flag exports (USE_CUDA,
TH_BINARY_BUILD, ...) to a file via --env-out which build.sh sources;
this is what lets those flags reach the wheel-build subprocess (a plain
`bash build_env_setup.sh` would have dropped them).

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

ghstack-source-id: e620cd3
Pull Request resolved: #182409
atalman added a commit that referenced this pull request May 6, 2026
…it env setup, deps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 6, 2026
…ps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 6, 2026
Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
helpers, and write the new helpers in Python rather than shell:

- build_env_setup.py    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.py shared build-time dependency install
- build_wheel.py        the actual wheel build (python -m build)
- repair_wheel.py       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.py +
build_wheel.py) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

build_env_setup.py writes its build-flag exports (USE_CUDA,
TH_BINARY_BUILD, ...) to a file via --env-out which build.sh sources;
this is what lets those flags reach the wheel-build subprocess (a plain
`bash build_env_setup.sh` would have dropped them).

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

ghstack-source-id: d892d0d
Pull Request resolved: #182409
atalman added a commit that referenced this pull request May 6, 2026
…it env setup, deps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 6, 2026
…ps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 6, 2026
Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
helpers, and write the new helpers in Python rather than shell:

- build_env_setup.py    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.py shared build-time dependency install
- build_wheel.py        the actual wheel build (python -m build)
- repair_wheel.py       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.py +
build_wheel.py) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

build_env_setup.py writes its build-flag exports (USE_CUDA,
TH_BINARY_BUILD, ...) to a file via --env-out which build.sh sources;
this is what lets those flags reach the wheel-build subprocess (a plain
`bash build_env_setup.sh` would have dropped them).

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

ghstack-source-id: a6345a5
Pull Request resolved: #182409
atalman added a commit that referenced this pull request May 6, 2026
…it env setup, deps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 6, 2026
…ps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
atalman added a commit that referenced this pull request May 6, 2026
Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
helpers, and write the new helpers in Python rather than shell:

- build_env_setup.py    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.py shared build-time dependency install
- build_wheel.py        the actual wheel build (python -m build)
- repair_wheel.py       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.py +
build_wheel.py) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

build_env_setup.py writes its build-flag exports (USE_CUDA,
TH_BINARY_BUILD, ...) to a file via --env-out which build.sh sources;
this is what lets those flags reach the wheel-build subprocess (a plain
`bash build_env_setup.sh` would have dropped them).

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

ghstack-source-id: 7a45e73
Pull Request resolved: #182409
atalman added a commit that referenced this pull request May 7, 2026
…ps, wheel, repair)"

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request May 7, 2026
…repair) (#182409)

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via #181586 (and follow-ups #181599, #182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.
Pull Request resolved: #182409
Approved by: https://github.com/seemethere, https://github.com/huydhn
@chuanqi129

Copy link
Copy Markdown
Collaborator

Hi @atalman, based on this PR change, seems we lose the chance to test manylinux build docker image update PR with label ciflow labels, any suggestions on this?

@huydhn

huydhn commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Hi @atalman, based on this PR change, seems we lose the chance to test manylinux build docker image update PR with label ciflow labels, any suggestions on this?

@chuanqi129 Could you elaborate a bit more here? I think I know what you are referring to, but a concrete example to illustrate the issue helps a lot. Maybe an old PR with the correct behavior and a new PR with what things are atm so that I can compare them.

For more context, we have solved a similar issue on CI images via this change #182843, but I haven't looked into release workflows yet

@chuanqi129

Copy link
Copy Markdown
Collaborator

Thanks @huydhn for the reply. You can refer my XPU support package upgrade PR #182003. In this PR, the xpu nightly build docker image will be updated, but it can't be used in the CI tests because the new workflow used the hardcode dockerhub manylinux build docker image. Before this PR land, the old version build workflow support it

Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…ch#181599)

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

_binary-build-linux.yml and _binary-test-linux.yml are converted in
place: `runs-on: <runner>` + `container: image: <image>:<tag>`. The
CUDA test job adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options. _binary-test-rocm-linux.yml and
_binary-test-xpu-linux.yml get the same treatment with their device
passthrough flags.

s390x carve-out: the s390x runners are self-hosted, only register
with the bare `linux.s390x` label, and lack a host-level docker CLI
compatible with GHA's container directive (they use podman). Two new
reusables, _binary-build-linux-s390x.yml and
_binary-test-linux-s390x.yml, hold the legacy `docker run`-from-step
flow for s390x; the template routes s390x to those and everything
else to the new container-based reusables.

Build scripts in .ci/* are unchanged.

Authored with Claude.
Pull Request resolved: pytorch#181599
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#181586
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…#182018)

Make GHA's `container:` directive optional via a new
`use_container_directive` input on `_binary-build-linux.yml` and
`_binary-test-linux.yml`:

- true (default, used by x86 / aarch64 / cuda): launch the build/test
  container via the `container:` directive — checkout, env-setup, and
  the .ci/* scripts all run directly inside it.
- false (used by s390x): the container.image expression resolves to an
  empty string, GHA treats it as no-container, and the build/test
  container is spawned via `docker run` from a step (podman-compatible
  on s390x self-hosted runners, which only register with the bare
  `linux.s390x` label and lack a host-level docker CLI compatible with
  the container directive).

This deletes the s390x-specific reusables `_binary-build-linux-s390x.yml`
and `_binary-test-linux-s390x.yml` introduced in pytorch#181599 — both arches
now share the same files, with the per-arch divergence collapsed to
the new boolean input plus a small `if:`-gated branch in each step.

Authored with Claude.
Pull Request resolved: pytorch#182018
Approved by: https://github.com/huydhn
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
…repair) (pytorch#182409)

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via pytorch#181586 (and follow-ups pytorch#181599, pytorch#182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.
Pull Request resolved: pytorch#182409
Approved by: https://github.com/seemethere, https://github.com/huydhn
@github-actions
github-actions Bot deleted the gh/atalman/13/head branch June 14, 2026 02:27
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…ch#181599)

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

_binary-build-linux.yml and _binary-test-linux.yml are converted in
place: `runs-on: <runner>` + `container: image: <image>:<tag>`. The
CUDA test job adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options. _binary-test-rocm-linux.yml and
_binary-test-xpu-linux.yml get the same treatment with their device
passthrough flags.

s390x carve-out: the s390x runners are self-hosted, only register
with the bare `linux.s390x` label, and lack a host-level docker CLI
compatible with GHA's container directive (they use podman). Two new
reusables, _binary-build-linux-s390x.yml and
_binary-test-linux-s390x.yml, hold the legacy `docker run`-from-step
flow for s390x; the template routes s390x to those and everything
else to the new container-based reusables.

Build scripts in .ci/* are unchanged.

Authored with Claude.
Pull Request resolved: pytorch#181599
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#181586
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…#182018)

Make GHA's `container:` directive optional via a new
`use_container_directive` input on `_binary-build-linux.yml` and
`_binary-test-linux.yml`:

- true (default, used by x86 / aarch64 / cuda): launch the build/test
  container via the `container:` directive — checkout, env-setup, and
  the .ci/* scripts all run directly inside it.
- false (used by s390x): the container.image expression resolves to an
  empty string, GHA treats it as no-container, and the build/test
  container is spawned via `docker run` from a step (podman-compatible
  on s390x self-hosted runners, which only register with the bare
  `linux.s390x` label and lack a host-level docker CLI compatible with
  the container directive).

This deletes the s390x-specific reusables `_binary-build-linux-s390x.yml`
and `_binary-test-linux-s390x.yml` introduced in pytorch#181599 — both arches
now share the same files, with the per-arch divergence collapsed to
the new boolean input plus a small `if:`-gated branch in each step.

Authored with Claude.
Pull Request resolved: pytorch#182018
Approved by: https://github.com/huydhn
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
…repair) (pytorch#182409)

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via pytorch#181586 (and follow-ups pytorch#181599, pytorch#182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.
Pull Request resolved: pytorch#182409
Approved by: https://github.com/seemethere, https://github.com/huydhn
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…ch#181599)

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

_binary-build-linux.yml and _binary-test-linux.yml are converted in
place: `runs-on: <runner>` + `container: image: <image>:<tag>`. The
CUDA test job adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options. _binary-test-rocm-linux.yml and
_binary-test-xpu-linux.yml get the same treatment with their device
passthrough flags.

s390x carve-out: the s390x runners are self-hosted, only register
with the bare `linux.s390x` label, and lack a host-level docker CLI
compatible with GHA's container directive (they use podman). Two new
reusables, _binary-build-linux-s390x.yml and
_binary-test-linux-s390x.yml, hold the legacy `docker run`-from-step
flow for s390x; the template routes s390x to those and everything
else to the new container-based reusables.

Build scripts in .ci/* are unchanged.

Authored with Claude.
Pull Request resolved: pytorch#181599
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#181586
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…#182018)

Make GHA's `container:` directive optional via a new
`use_container_directive` input on `_binary-build-linux.yml` and
`_binary-test-linux.yml`:

- true (default, used by x86 / aarch64 / cuda): launch the build/test
  container via the `container:` directive — checkout, env-setup, and
  the .ci/* scripts all run directly inside it.
- false (used by s390x): the container.image expression resolves to an
  empty string, GHA treats it as no-container, and the build/test
  container is spawned via `docker run` from a step (podman-compatible
  on s390x self-hosted runners, which only register with the bare
  `linux.s390x` label and lack a host-level docker CLI compatible with
  the container directive).

This deletes the s390x-specific reusables `_binary-build-linux-s390x.yml`
and `_binary-test-linux-s390x.yml` introduced in pytorch#181599 — both arches
now share the same files, with the per-arch divergence collapsed to
the new boolean input plus a small `if:`-gated branch in each step.

Authored with Claude.
Pull Request resolved: pytorch#182018
Approved by: https://github.com/huydhn
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…repair) (pytorch#182409)

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via pytorch#181586 (and follow-ups pytorch#181599, pytorch#182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.
Pull Request resolved: pytorch#182409
Approved by: https://github.com/seemethere, https://github.com/huydhn
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…ch#181599)

Replace the docker-in-docker dance in the matrix-driven Linux binary
workflows with GitHub Actions' native `container:` directive. Each
matrix-cell job now starts directly inside the build container — the
existing .ci/* shell scripts read the same env vars (PYTORCH_ROOT,
PYTORCH_FINAL_PACKAGE_DIR, BINARY_ENV_FILE, ...) and run unchanged.

_binary-build-linux.yml and _binary-test-linux.yml are converted in
place: `runs-on: <runner>` + `container: image: <image>:<tag>`. The
CUDA test job adds `--gpus all -e NVIDIA_DRIVER_CAPABILITIES=...` via
container.options. _binary-test-rocm-linux.yml and
_binary-test-xpu-linux.yml get the same treatment with their device
passthrough flags.

s390x carve-out: the s390x runners are self-hosted, only register
with the bare `linux.s390x` label, and lack a host-level docker CLI
compatible with GHA's container directive (they use podman). Two new
reusables, _binary-build-linux-s390x.yml and
_binary-test-linux-s390x.yml, hold the legacy `docker run`-from-step
flow for s390x; the template routes s390x to those and everything
else to the new container-based reusables.

Build scripts in .ci/* are unchanged.

Authored with Claude.
Pull Request resolved: pytorch#181599
Approved by: https://github.com/huydhn
ghstack dependencies: pytorch#181586
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…#182018)

Make GHA's `container:` directive optional via a new
`use_container_directive` input on `_binary-build-linux.yml` and
`_binary-test-linux.yml`:

- true (default, used by x86 / aarch64 / cuda): launch the build/test
  container via the `container:` directive — checkout, env-setup, and
  the .ci/* scripts all run directly inside it.
- false (used by s390x): the container.image expression resolves to an
  empty string, GHA treats it as no-container, and the build/test
  container is spawned via `docker run` from a step (podman-compatible
  on s390x self-hosted runners, which only register with the bare
  `linux.s390x` label and lack a host-level docker CLI compatible with
  the container directive).

This deletes the s390x-specific reusables `_binary-build-linux-s390x.yml`
and `_binary-test-linux-s390x.yml` introduced in pytorch#181599 — both arches
now share the same files, with the per-arch divergence collapsed to
the new boolean input plus a small `if:`-gated branch in each step.

Authored with Claude.
Pull Request resolved: pytorch#182018
Approved by: https://github.com/huydhn
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…repair) (pytorch#182409)

Split the monolithic .ci/manywheel/build_cuda.sh and the duplicated
sections of build_cpu.sh / build_common.sh into focused, reusable
scripts:

- build_env_setup.sh    GPU/toolchain environment setup (CUDA, ROCm, XPU)
- build_install_deps.sh shared build-time dependency install
- build_wheel.sh        the actual wheel build (python -m build)
- repair_wheel.sh       auditwheel-style repair using the `wheel` python
                        package (unpack/pack/tags), bundling aarch64
                        BLAS/LAPACK/ACL when needed

Drops build_cuda.sh (its logic is now in build_env_setup.sh +
build_wheel.sh) and trims x86/aarch64-specific branches out of
build_cpu.sh / build_common.sh. The legacy entry point .ci/manywheel/build.sh
now dispatches x86/aarch64 cuda/cpu through the new chain
(set_desired_python -> build_env_setup -> build_install_deps -> build_wheel
-> repair_wheel) and keeps rocm/xpu/cpu-s390x on the legacy build_*.sh
helpers.

Also drops obsolete numpy version pins in .ci/pytorch/run_tests.sh.

The matching workflow / Jinja-template rework that originally lived in
this branch is no longer needed -- the matrix-driven binary workflows
already landed via pytorch#181586 (and follow-ups pytorch#181599, pytorch#182018), so the
new scripts plug into the existing _binary-build-linux.yml.

Authored with Claude.
Pull Request resolved: pytorch#182409
Approved by: https://github.com/seemethere, https://github.com/huydhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorevert: disable Disable autorevert for a specific PR ciflow/binaries Trigger all binary build and upload jobs on the PR ciflow/nightly Trigger all jobs we run nightly (nightly.yml) Merged module: rocm AMD GPU support for Pytorch topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants