From e7e09c777c51055d44a7d1e36e0644e51bee9e8b Mon Sep 17 00:00:00 2001 From: ethanwee1 Date: Tue, 21 Jul 2026 13:31:54 +0000 Subject: [PATCH 1/4] build(pytorch): enable gfx1250 wheels for release/2.12 PyTorch release/2.12 now includes gfx1250 support via ROCm/pytorch#3421, so stop filtering gfx125X-dcgpu out of the release matrix alongside release/2.11. --- .../configure_pytorch_release_matrix.py | 33 ++++++++++--------- .../configure_pytorch_release_matrix_test.py | 20 +++++++++++ 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/build_tools/github_actions/configure_pytorch_release_matrix.py b/build_tools/github_actions/configure_pytorch_release_matrix.py index e33311252d7..fde54292948 100644 --- a/build_tools/github_actions/configure_pytorch_release_matrix.py +++ b/build_tools/github_actions/configure_pytorch_release_matrix.py @@ -26,27 +26,30 @@ "windows": ["3.12"], } -# Refs for the "prerelease" release type. The "nightly" release type extends -# this set with additional refs (see RELEASE_PYTORCH_REFS). -RELEASE_STABLE_PYTORCH_REFS = { +# TODO: separate out "nightly" pytorch refs from "prerelease" pytorch refs? +# That would let us: +# 1. choose to not build the "nightly" pytorch branch for prerelease builds, +# saving some CI resources and possibly simplifying package promotion +# scripts. +# 2. filter out some AMDGPU families from prereleases if we only want them +# built for nightly but not published to stable. +RELEASE_PYTORCH_REFS = { "linux": [ + "release/2.9", "release/2.10", "release/2.11", "release/2.12", + "nightly", ], "windows": [ + "release/2.9", "release/2.10", "release/2.11", "release/2.12", + "nightly", ], } -# Refs for the "nightly" release type: stable refs + "nightly" branch. -RELEASE_PYTORCH_REFS = { - platform: [*refs, "nightly"] - for platform, refs in RELEASE_STABLE_PYTORCH_REFS.items() -} - CI_PYTORCH_REFS = { "linux": ["release/2.10", "release/2.11", "release/2.12"], "windows": ["release/2.10"], @@ -56,14 +59,14 @@ # new GPU families before the default PyTorch refs support them. UNSUPPORTED_AMDGPU_FAMILIES = { "linux": { + # gfx125x not supported for PyTorch 2.9. + "release/2.9": {"gfx125X-dcgpu"}, # gfx125x not supported for PyTorch 2.10. "release/2.10": {"gfx125X-dcgpu"}, # gfx125x supported for PyTorch 2.11 via https://github.com/ROCm/pytorch/pull/3346. "release/2.11": {}, - # gfx125x not yet upstreamed to pytorch/pytorch. Upstream expected - # 2026-06-26, but the ROCm 7.14 release is cut before that date. - # See https://github.com/ROCm/TheRock/issues/5833. - "release/2.12": {"gfx125X-dcgpu"}, + # gfx125x supported for PyTorch 2.12 via https://github.com/ROCm/pytorch/pull/3421. + "release/2.12": {}, # gfx125x not yet upstreamed to pytorch/pytorch. # See https://github.com/ROCm/TheRock/issues/5833. "nightly": {"gfx125X-dcgpu"}, @@ -94,8 +97,6 @@ def _default_python_versions(*, release_type: str, platform: str) -> list[str]: def _default_pytorch_git_refs(*, release_type: str, platform: str) -> list[str]: if release_type == "ci": return list(CI_PYTORCH_REFS[platform]) - if release_type == "prerelease": - return list(RELEASE_STABLE_PYTORCH_REFS[platform]) return list(RELEASE_PYTORCH_REFS[platform]) @@ -142,7 +143,7 @@ def generate_pytorch_matrix_for_release_type( # [ # { # "python_version": "3.10", - # "pytorch_git_ref": "release/2.12", + # "pytorch_git_ref": "release/2.9", # "amdgpu_families": "gfx94X-dcgpu" # }, # ... diff --git a/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py b/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py index f8bb7b5ebdf..5a74ee19cb7 100644 --- a/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py +++ b/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py @@ -105,6 +105,26 @@ def test_filters_exact_unsupported_family(self): matrix_families = ";".join(row["amdgpu_families"] for row in matrix) self.assertNotIn("gfx125X", matrix_families) + def test_release_2_12_includes_gfx125x(self): + matrix = m.generate_pytorch_matrix_for_release_type( + release_type="dev", + python_versions=["3.12"], + pytorch_git_refs=["release/2.12"], + amdgpu_families="gfx94X-dcgpu;gfx125X-dcgpu", + platform="linux", + ) + + self.assertEqual( + matrix, + [ + { + "python_version": "3.12", + "pytorch_git_ref": "release/2.12", + "amdgpu_families": "gfx94X-dcgpu;gfx125X-dcgpu", + } + ], + ) + def test_unknown_explicit_ref_keeps_families(self): matrix = m.generate_pytorch_matrix_for_release_type( release_type="dev", From 24941850e708d1190f1216d9af0ac377d7bdfae7 Mon Sep 17 00:00:00 2001 From: ethanwee1 Date: Tue, 21 Jul 2026 13:38:30 +0000 Subject: [PATCH 2/4] build(pytorch): enable gfx1250 for release/2.12 and nightly Stop filtering gfx125X-dcgpu out of the PyTorch release matrix for release/2.12 and nightly now that ROCm/pytorch#3421 and upstream pytorch#188597 landed gfx1250 support. Also restore configure_pytorch_release_matrix.py from main to drop accidental release/2.9 refactor from the first commit. --- .../configure_pytorch_release_matrix.py | 32 ++++++++----------- .../configure_pytorch_release_matrix_test.py | 20 ++++++++++++ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/build_tools/github_actions/configure_pytorch_release_matrix.py b/build_tools/github_actions/configure_pytorch_release_matrix.py index fde54292948..819e9cd888e 100644 --- a/build_tools/github_actions/configure_pytorch_release_matrix.py +++ b/build_tools/github_actions/configure_pytorch_release_matrix.py @@ -26,30 +26,27 @@ "windows": ["3.12"], } -# TODO: separate out "nightly" pytorch refs from "prerelease" pytorch refs? -# That would let us: -# 1. choose to not build the "nightly" pytorch branch for prerelease builds, -# saving some CI resources and possibly simplifying package promotion -# scripts. -# 2. filter out some AMDGPU families from prereleases if we only want them -# built for nightly but not published to stable. -RELEASE_PYTORCH_REFS = { +# Refs for the "prerelease" release type. The "nightly" release type extends +# this set with additional refs (see RELEASE_PYTORCH_REFS). +RELEASE_STABLE_PYTORCH_REFS = { "linux": [ - "release/2.9", "release/2.10", "release/2.11", "release/2.12", - "nightly", ], "windows": [ - "release/2.9", "release/2.10", "release/2.11", "release/2.12", - "nightly", ], } +# Refs for the "nightly" release type: stable refs + "nightly" branch. +RELEASE_PYTORCH_REFS = { + platform: [*refs, "nightly"] + for platform, refs in RELEASE_STABLE_PYTORCH_REFS.items() +} + CI_PYTORCH_REFS = { "linux": ["release/2.10", "release/2.11", "release/2.12"], "windows": ["release/2.10"], @@ -59,17 +56,14 @@ # new GPU families before the default PyTorch refs support them. UNSUPPORTED_AMDGPU_FAMILIES = { "linux": { - # gfx125x not supported for PyTorch 2.9. - "release/2.9": {"gfx125X-dcgpu"}, # gfx125x not supported for PyTorch 2.10. "release/2.10": {"gfx125X-dcgpu"}, # gfx125x supported for PyTorch 2.11 via https://github.com/ROCm/pytorch/pull/3346. "release/2.11": {}, # gfx125x supported for PyTorch 2.12 via https://github.com/ROCm/pytorch/pull/3421. "release/2.12": {}, - # gfx125x not yet upstreamed to pytorch/pytorch. - # See https://github.com/ROCm/TheRock/issues/5833. - "nightly": {"gfx125X-dcgpu"}, + # gfx125x supported on upstream pytorch/pytorch nightly via pytorch#188597. + "nightly": {}, }, "windows": {}, } @@ -97,6 +91,8 @@ def _default_python_versions(*, release_type: str, platform: str) -> list[str]: def _default_pytorch_git_refs(*, release_type: str, platform: str) -> list[str]: if release_type == "ci": return list(CI_PYTORCH_REFS[platform]) + if release_type == "prerelease": + return list(RELEASE_STABLE_PYTORCH_REFS[platform]) return list(RELEASE_PYTORCH_REFS[platform]) @@ -143,7 +139,7 @@ def generate_pytorch_matrix_for_release_type( # [ # { # "python_version": "3.10", - # "pytorch_git_ref": "release/2.9", + # "pytorch_git_ref": "release/2.12", # "amdgpu_families": "gfx94X-dcgpu" # }, # ... diff --git a/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py b/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py index 5a74ee19cb7..261d46cd44b 100644 --- a/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py +++ b/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py @@ -125,6 +125,26 @@ def test_release_2_12_includes_gfx125x(self): ], ) + def test_nightly_includes_gfx125x(self): + matrix = m.generate_pytorch_matrix_for_release_type( + release_type="nightly", + python_versions=["3.12"], + pytorch_git_refs=["nightly"], + amdgpu_families="gfx94X-dcgpu;gfx125X-dcgpu", + platform="linux", + ) + + self.assertEqual( + matrix, + [ + { + "python_version": "3.12", + "pytorch_git_ref": "nightly", + "amdgpu_families": "gfx94X-dcgpu;gfx125X-dcgpu", + } + ], + ) + def test_unknown_explicit_ref_keeps_families(self): matrix = m.generate_pytorch_matrix_for_release_type( release_type="dev", From 0e999edf96fa421c15ba34b17bdca6f5aa52962d Mon Sep 17 00:00:00 2001 From: ethanwee1 Date: Tue, 21 Jul 2026 18:53:23 +0000 Subject: [PATCH 3/4] ci(pytorch): allow optional PyTorch git origin on dev wheel builds Add pytorch_gitrepo_origin workflow input so gfx1250 release/2.12 test builds can checkout a fork branch with the ck_gemm CMake guard before it lands on ROCm/pytorch release/2.12. --- ...rch_build_portable_linux_pytorch_wheels.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 \ From eaaf5ff06e6f8685158f27bdb2ffa5df4ad797d1 Mon Sep 17 00:00:00 2001 From: ethanwee1 Date: Wed, 22 Jul 2026 18:45:55 +0000 Subject: [PATCH 4/4] review: limit PR to configure_pytorch_release_matrix.py change Per review feedback, scope this PR down to only the gfx1250 matrix enablement in configure_pytorch_release_matrix.py: - Revert the pytorch_gitrepo_origin input added to multi_arch_build_portable_linux_pytorch_wheels.yml (moving to a separate PR that keeps the Linux and Windows workflows in sync). - Drop the added configure_pytorch_release_matrix_test.py cases; the existing tests already exercise the unsupported-family filtering. --- ...ch_build_portable_linux_pytorch_wheels.yml | 18 +-------- .../configure_pytorch_release_matrix_test.py | 40 ------------------- 2 files changed, 1 insertion(+), 57 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 587785dcf43..c9f2b9941b4 100644 --- a/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml +++ b/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels.yml @@ -46,12 +46,6 @@ 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 @@ -110,12 +104,6 @@ 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 @@ -241,12 +229,8 @@ 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 "${pytorch_origin}" \ + --gitrepo-origin https://github.com/ROCm/pytorch.git \ --repo-hashtag ${{ inputs.pytorch_git_ref }} \ --no-commit-hipify ./external-builds/pytorch/pytorch_audio_repo.py checkout \ diff --git a/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py b/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py index 261d46cd44b..f8bb7b5ebdf 100644 --- a/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py +++ b/build_tools/github_actions/tests/configure_pytorch_release_matrix_test.py @@ -105,46 +105,6 @@ def test_filters_exact_unsupported_family(self): matrix_families = ";".join(row["amdgpu_families"] for row in matrix) self.assertNotIn("gfx125X", matrix_families) - def test_release_2_12_includes_gfx125x(self): - matrix = m.generate_pytorch_matrix_for_release_type( - release_type="dev", - python_versions=["3.12"], - pytorch_git_refs=["release/2.12"], - amdgpu_families="gfx94X-dcgpu;gfx125X-dcgpu", - platform="linux", - ) - - self.assertEqual( - matrix, - [ - { - "python_version": "3.12", - "pytorch_git_ref": "release/2.12", - "amdgpu_families": "gfx94X-dcgpu;gfx125X-dcgpu", - } - ], - ) - - def test_nightly_includes_gfx125x(self): - matrix = m.generate_pytorch_matrix_for_release_type( - release_type="nightly", - python_versions=["3.12"], - pytorch_git_refs=["nightly"], - amdgpu_families="gfx94X-dcgpu;gfx125X-dcgpu", - platform="linux", - ) - - self.assertEqual( - matrix, - [ - { - "python_version": "3.12", - "pytorch_git_ref": "nightly", - "amdgpu_families": "gfx94X-dcgpu;gfx125X-dcgpu", - } - ], - ) - def test_unknown_explicit_ref_keeps_families(self): matrix = m.generate_pytorch_matrix_for_release_type( release_type="dev",