From 9097f38f770096a873e6bb612b84d7f62019ab19 Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Tue, 20 Jan 2026 15:44:31 -0800 Subject: [PATCH 1/3] [RELEASE ONLY CHANGES] Install torch, vision and audio RC This change switches the release branch to install torch, audio, and vision from their respective release candidates, rather than building. See PR #14642 for previous example. --- .ci/docker/common/install_pytorch.sh | 32 +------------- .ci/scripts/utils.sh | 66 +--------------------------- 2 files changed, 4 insertions(+), 94 deletions(-) diff --git a/.ci/docker/common/install_pytorch.sh b/.ci/docker/common/install_pytorch.sh index df362108d6c..80f678eabe5 100755 --- a/.ci/docker/common/install_pytorch.sh +++ b/.ci/docker/common/install_pytorch.sh @@ -12,39 +12,11 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" install_domains() { echo "Install torchvision and torchaudio" - pip_install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}" - pip_install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}" + pip_install torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu } install_pytorch_and_domains() { - git clone https://github.com/pytorch/pytorch.git - - # Fetch the target commit - pushd pytorch || true - git checkout "${TORCH_VERSION}" - git submodule update --init --recursive - - chown -R ci-user . - - export _GLIBCXX_USE_CXX11_ABI=1 - # Then build and install PyTorch - conda_run python setup.py bdist_wheel - pip_install "$(echo dist/*.whl)" - - # Grab the pinned audio and vision commits from PyTorch - TORCHAUDIO_VERSION=release/2.10 - export TORCHAUDIO_VERSION - TORCHVISION_VERSION=release/0.25 - export TORCHVISION_VERSION - - install_domains - - popd || true - # Clean up the cloned PyTorch repo to reduce the Docker image size - rm -rf pytorch - - # Print sccache stats for debugging - as_ci_user sccache --show-stats + pip_install torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu } install_pytorch_and_domains diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index 7fb7517e771..7ce5ae30eb7 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -84,73 +84,11 @@ dedupe_macos_loader_path_rpaths() { install_domains() { echo "Install torchvision and torchaudio" - pip install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}" - pip install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}" + pip install torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu } install_pytorch_and_domains() { - pushd .ci/docker || return - TORCH_VERSION=$(cat ci_commit_pins/pytorch.txt) - popd || return - - git clone https://github.com/pytorch/pytorch.git - - # Fetch the target commit - pushd pytorch || return - git checkout "${TORCH_VERSION}" - - local system_name=$(uname) - if [[ "${system_name}" == "Darwin" ]]; then - local platform=$(python -c 'import sysconfig; import platform; v=platform.mac_ver()[0].split(".")[0]; platform=sysconfig.get_platform().split("-"); platform[1]=f"{v}_0"; print("_".join(platform))') - fi - local python_version=$(python -c 'import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")') - local torch_release=$(cat version.txt) - local torch_short_hash=${TORCH_VERSION:0:7} - local torch_wheel_path="cached_artifacts/pytorch/executorch/pytorch_wheels/${system_name}/${python_version}" - local torch_wheel_name="torch-${torch_release}%2Bgit${torch_short_hash}-cp${python_version}-cp${python_version}-${platform:-}.whl" - - local cached_torch_wheel="https://gha-artifacts.s3.us-east-1.amazonaws.com/${torch_wheel_path}/${torch_wheel_name}" - # Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part - # of the Docker image - local torch_wheel_not_found=0 - if [[ "${system_name}" == "Darwin" ]]; then - pip install "${cached_torch_wheel}" || torch_wheel_not_found=1 - else - torch_wheel_not_found=1 - fi - - # Found no such wheel, we will build it from source then - if [[ "${torch_wheel_not_found}" == "1" ]]; then - echo "No cached wheel found, continue with building PyTorch at ${TORCH_VERSION}" - - git submodule update --init --recursive - USE_DISTRIBUTED=1 python setup.py bdist_wheel - pip install "$(echo dist/*.whl)" - - # Only AWS runners have access to S3 - if command -v aws && [[ -z "${GITHUB_RUNNER:-}" ]]; then - for wheel_path in dist/*.whl; do - local wheel_name=$(basename "${wheel_path}") - echo "Caching ${wheel_name}" - aws s3 cp "${wheel_path}" "s3://gha-artifacts/${torch_wheel_path}/${wheel_name}" - done - fi - else - echo "Use cached wheel at ${cached_torch_wheel}" - fi - - dedupe_macos_loader_path_rpaths - # Grab the pinned audio and vision commits from PyTorch - TORCHAUDIO_VERSION=$(cat .github/ci_commit_pins/audio.txt) - export TORCHAUDIO_VERSION - TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt) - export TORCHVISION_VERSION - - install_domains - - popd || return - # Print sccache stats for debugging - sccache --show-stats || true + pip install torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu } build_executorch_runner_buck2() { From 7fa545f4c91df90e21949e194d565f1efa5ed437 Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Wed, 21 Jan 2026 15:00:49 -0800 Subject: [PATCH 2/3] Reverting install_domain change --- .ci/docker/common/install_pytorch.sh | 3 ++- .ci/scripts/utils.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/docker/common/install_pytorch.sh b/.ci/docker/common/install_pytorch.sh index 80f678eabe5..ed1230ca27b 100755 --- a/.ci/docker/common/install_pytorch.sh +++ b/.ci/docker/common/install_pytorch.sh @@ -12,7 +12,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" install_domains() { echo "Install torchvision and torchaudio" - pip_install torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu + pip_install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}" + pip_install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}" } install_pytorch_and_domains() { diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index 7ce5ae30eb7..28c1b087dbb 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -84,7 +84,8 @@ dedupe_macos_loader_path_rpaths() { install_domains() { echo "Install torchvision and torchaudio" - pip install torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu + pip install --no-build-isolation --user "git+https://github.com/pytorch/audio.git@${TORCHAUDIO_VERSION}" + pip install --no-build-isolation --user "git+https://github.com/pytorch/vision.git@${TORCHVISION_VERSION}" } install_pytorch_and_domains() { From f87c0406ec8bc1771ed6b7d86746bf27fce3aa15 Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Wed, 21 Jan 2026 16:26:27 -0800 Subject: [PATCH 3/3] Force reinstall --- .ci/docker/common/install_pytorch.sh | 2 +- .ci/scripts/utils.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/docker/common/install_pytorch.sh b/.ci/docker/common/install_pytorch.sh index ed1230ca27b..53a3eb5c045 100755 --- a/.ci/docker/common/install_pytorch.sh +++ b/.ci/docker/common/install_pytorch.sh @@ -17,7 +17,7 @@ install_domains() { } install_pytorch_and_domains() { - pip_install torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu + pip_install --force-reinstall torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu } install_pytorch_and_domains diff --git a/.ci/scripts/utils.sh b/.ci/scripts/utils.sh index 28c1b087dbb..a27e3b09576 100644 --- a/.ci/scripts/utils.sh +++ b/.ci/scripts/utils.sh @@ -89,7 +89,7 @@ install_domains() { } install_pytorch_and_domains() { - pip install torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu + pip install --force-reinstall torch==2.10.0 torchvision==0.25.0 torchaudio==2.10.0 --index-url https://download.pytorch.org/whl/test/cpu } build_executorch_runner_buck2() {