From 66fdba8e3dd3fdc5f760625c7c1930dc72a3ef46 Mon Sep 17 00:00:00 2001 From: ethanwee1 Date: Wed, 22 Jul 2026 18:48:11 +0000 Subject: [PATCH] ci(pytorch): add optional PyTorch git origin override to wheel builds Add an optional `pytorch_gitrepo_origin` input to the multi-arch PyTorch wheel build workflows (Linux and Windows, kept in sync). When set, the stable checkout uses it as the `--gitrepo-origin` (for example, a fork URL for pre-merge testing); it defaults to https://github.com/ROCm/pytorch.git so existing behavior is unchanged. --- ...rch_build_portable_linux_pytorch_wheels.yml | 18 +++++++++++++++++- ...multi_arch_build_windows_pytorch_wheels.yml | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml b/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml index c9f2b9941b4..587785dcf43 100644 --- a/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml +++ b/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml @@ -46,6 +46,12 @@ on: description: PyTorch ref to checkout. Typically "nightly" or "release/X.Y". type: string required: true + pytorch_gitrepo_origin: + description: >- + Optional PyTorch git origin override (for example, a fork URL for + pre-merge testing). Defaults to ROCm/pytorch for stable refs. + type: string + default: "" rocm_version: description: ROCm package version to install and build against (e.g. 7.10.0.dev0) type: string @@ -104,6 +110,12 @@ on: description: PyTorch ref to checkout (for example, "release/2.12"). type: string default: "release/2.12" + pytorch_gitrepo_origin: + description: >- + Optional PyTorch git origin override (for example, a fork URL for + pre-merge testing). Defaults to ROCm/pytorch for stable refs. + type: string + default: "" rocm_version: description: ROCm package version to install and build against (e.g. 7.10.0.dev0) type: string @@ -229,8 +241,12 @@ jobs: - name: Checkout PyTorch source repos (stable) if: ${{ inputs.pytorch_git_ref != 'nightly' }} run: | + pytorch_origin="${{ inputs.pytorch_gitrepo_origin }}" + if [ -z "${pytorch_origin}" ]; then + pytorch_origin="https://github.com/ROCm/pytorch.git" + fi ./external-builds/pytorch/pytorch_torch_repo.py checkout \ - --gitrepo-origin https://github.com/ROCm/pytorch.git \ + --gitrepo-origin "${pytorch_origin}" \ --repo-hashtag ${{ inputs.pytorch_git_ref }} \ --no-commit-hipify ./external-builds/pytorch/pytorch_audio_repo.py checkout \ diff --git a/.github/workflows/multi_arch_build_windows_pytorch_wheels.yml b/.github/workflows/multi_arch_build_windows_pytorch_wheels.yml index bbf1a3819b2..14e771062b5 100644 --- a/.github/workflows/multi_arch_build_windows_pytorch_wheels.yml +++ b/.github/workflows/multi_arch_build_windows_pytorch_wheels.yml @@ -46,6 +46,12 @@ on: description: PyTorch ref to checkout. Typically "nightly" or "release/X.Y". type: string required: true + pytorch_gitrepo_origin: + description: >- + Optional PyTorch git origin override (for example, a fork URL for + pre-merge testing). Defaults to ROCm/pytorch for stable refs. + type: string + default: "" rocm_version: description: ROCm package version to install and build against (e.g. 7.10.0.dev0) type: string @@ -98,6 +104,12 @@ on: description: PyTorch ref to checkout (for example, "release/2.12"). type: string default: "release/2.12" + pytorch_gitrepo_origin: + description: >- + Optional PyTorch git origin override (for example, a fork URL for + pre-merge testing). Defaults to ROCm/pytorch for stable refs. + type: string + default: "" rocm_version: description: ROCm package version to install and build against (e.g. 7.10.0.dev0) type: string @@ -240,9 +252,13 @@ jobs: if: ${{ inputs.pytorch_git_ref != 'nightly' }} run: | git config --global core.longpaths true + pytorch_origin="${{ inputs.pytorch_gitrepo_origin }}" + if [ -z "${pytorch_origin}" ]; then + pytorch_origin="https://github.com/ROCm/pytorch.git" + fi python ./external-builds/pytorch/pytorch_torch_repo.py checkout \ --checkout-dir ${{ env.CHECKOUT_ROOT }}/pytorch \ - --gitrepo-origin https://github.com/ROCm/pytorch.git \ + --gitrepo-origin "${pytorch_origin}" \ --repo-hashtag ${{ inputs.pytorch_git_ref }} \ --no-commit-hipify python ./external-builds/pytorch/pytorch_audio_repo.py checkout \