← Back to Pull requests

[ci] Add `ci:skip-rocm` as a way to skip straight to PyTorch and JAX CI jobs #9059

Merged
ScottTodd merged 15 files (959 lines) on Nov 03, 2026 18:37 UTC
View on GitHub
ScottTodd ScottTodd commented on Oct 15, 2026 22:15 UTC
Author

Motivation

Progress on https://github.com/ROCm/TheRock/issues/7346

This lets us _explicitly_ choose when a CI run can skip ROCm artifact and package builds altogether and run PyTorch and JAX framework jobs against published packages instead of built-from-source packages. This is most useful for routine changes to the external-builds/pytorch directory such as https://github.com/ROCm/TheRock/commit/7a606919f69dc431d0cec51b63c6a5293aaccf77 where building against any recent enough ROCm python packages is sufficient and we want faster time to signal.

The next step will be to automatically detect when a given commit only affects pytorch or jax files and _implicitly_ use this new functionality.

Technical Details

There's quite a bit of plumbing here. They key bits are:

Add ci:skip-rocm label and connect it to job decisions and workflow conditions

      return JobDecisions(
          build_rocm=BuildRocmDecision(action=JobAction.SKIP),
          test_rocm=TestRocmDecision(action=JobAction.SKIP),
          build_rocm_python=JobGroupDecision(action=JobAction.PREBUILT),
          ...
    

      build_multi_arch_stages:
        name: Build Multi-Arch Stages
        if: fromJSON(inputs.build_config).build_rocm == true
    

CI jobs now carry framework_rocm_version instead of rocm_package_version.
When _building ROCm_, this is the computed package version for the current commit.
* When _skipping ROCm builds_, this is resolved from rocm_package_index_url (set to https://nightly.repo.amd.com/rocm/whl-next/ )

Test Plan

  • workflow_dispatch with PR_LABELS: ci:skip-rocm,ci:build-pytorch,ci:build-jax

  • CI on this PR without labels should run normally: https://github.com/ROCm/TheRock/actions/runs/41092805926?pr=9059

  • CI on this PR with the ci:skip-rocm label should build pytorch and jax without building rocm: https://github.com/ROCm/TheRock/actions/runs/41110224591?pr=9059
  • Test Result

    Workflow dispatch:

    https://github.com/ROCm/TheRock/actions/runs/38795725816 (using stable.repo.amd.com)
    https://github.com/ROCm/TheRock/actions/runs/38815497486 (using nightly.repo.amd.com)

    <img width="1031" height="798" alt="image" src="https://github.com/user-attachments/assets/cc9d1805-56d5-44d9-b590-3ddf7db9b333" />

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
  • Diff: 959 lines (+833 / -126) across 15 files Reviewer: geomin12 Review duration: 27142m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.64) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.64 · 959 lines diff across 15 files
    0.64
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 5 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Real PR Conversation Timeline
    23 items
    therock-pr-bot[bot] therock-pr-bot[bot] commented on Oct 15, 2026 22:16 UTC
    Bot

    <!-- therock-pr-bot-policy-check -->

    ✅ All Policy Checks Passed

    | Check | Status | Details |
    |---|:---:|---|
    | 📝 PR Description | ✅ Pass | — |
    | ⛔ Forbidden Files | ✅ Pass | — |
    | 🧪 Unit Test | ✅ Pass | — |
    | 🚫 Draft PR | 🔜 To Be Enabled | — |
    | 🚩 Feature Flag | 🔜 To Be Enabled | — |
    | 📊 Code Coverage | 🔜 To Be Enabled | — |

    🎉 All policy checks passed!

    📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

    🙋 Wish to Override Policy?

    therock-pr-bot[bot] therock-pr-bot[bot] commented on Oct 15, 2026 22:16 UTC
    Bot

    <!-- therock-pr-bot-fix-policies -->
    🎉 All checks passed! This PR is ready for review.

    ScottTodd ScottTodd commented on Oct 15, 2026 23:42 UTC
    Author

    fyi @ethanwee1 @gulsumgudukbay this (and PRs that build on it) should enable much faster CI times for changes to just pytorch or jax. You may want to review the changes that touch those components too.

    ScottTodd ScottTodd commented on code on Oct 15, 2026 23:45 UTC
    Code Review
    build_tools/github_actions/configure_ci_labels.py:1
    @@ -170,14 +169,15 @@ class Label:
         # build_variant: labels
         Label("build_variant:asan", COLOR_BUILD_VARIANT, "If enabled, the pull request will run ASAN builds"),
         # ci:packaging labels (opt-in to specific packaging/build jobs)
    +    Label("ci:build-python-packages", COLOR_CI_PACKAGING, "Opt-in to building Python packages"),
         Label("ci:build-pytorch", COLOR_CI_PACKAGING, "Opt-in to building PyTorch packages"),
         Label("ci:build-jax", COLOR_CI_PACKAGING, "Opt-in to building JAX packages"),
         Label("ci:build-native-linux", COLOR_CI_PACKAGING, "Opt-in to building native Linux packages"),
    -    Label("ci:build-python-packages", COLOR_CI_PACKAGING, "Opt-in to building Python packages"),
    +    Label("ci:skip-rocm", COLOR_CI_PACKAGING, "Skip ROCm builds and tests; use published ROCm packages for frameworks"),

    @geomin12 if you're okay with this label name we can create it and test for real on this PR. So far I've been testing with workflow_dispatch.

    (I'm also considering if we should also have an explicit ci:build-rocm to override the automatic selection...)

    ScottTodd ScottTodd commented on Oct 15, 2026 23:52 UTC
    Author

    The next step will be to automatically detect when a given commit only affects pytorch or jax files and _implicitly_ use this new functionality.

    Should have this stacked on top ~tomorrow.

    ScottTodd ScottTodd commented on Oct 16, 2026 18:57 UTC
    Author

    Next PR in the stack, implementing automatic job selection based on files modified, is up now too: https://github.com/ROCm/TheRock/pull/9325

    geomin12 geomin12 commented on code on Oct 16, 2026 21:52 UTC
    Code Review
    .github/workflows/multi_arch_ci_linux.yml:1
    @@ -346,9 +418,11 @@ jobs:
           # The reusable workflow expands this to gfx targets via
           # cmake/therock_amdgpu_targets.cmake.
           amdgpu_families: ${{ matrix.amdgpu_families }}
    -      kpack_split: ${{ needs.build_python_packages.outputs.kpack_split }}
    -      rocm_package_find_links_url: ${{ needs.build_python_packages.outputs.package_find_links_url }}
    -      rocm_version: ${{ inputs.rocm_package_version }}
    +      # Multi-arch CI and nightly whl-next packages both use the split layout.
    +      kpack_split: ${{ 'true' }}

    oh i don't think ${{ }} is needed

    geomin12 geomin12 commented on code on Oct 16, 2026 21:54 UTC
    Code Review
    .github/workflows/setup_multi_arch.yml:1
    @@ -166,7 +166,7 @@ permissions:
     
     jobs:
       setup:
    -    runs-on: ubuntu-24.04
    +    runs-on: ubuntu-26.04

    should we keep this upgrade to another PR? just in case it causes other issues and we can revert

    geomin12 geomin12 commented on code on Oct 16, 2026 21:57 UTC
    Code Review
    build_tools/github_actions/configure_multi_arch_ci.py:1
    @@ -272,6 +283,25 @@ def validate(self) -> None:
                 if build_label in self.pr_labels and skip_label in self.pr_labels:
                     raise ValueError(f"{build_label} conflicts with {skip_label}")
     
    +        if "ci:skip-rocm" in self.pr_labels:
    +            conflicts = {
    +                "ci:build-python-packages",
    +                "ci:build-native-linux",
    +            }.intersection(self.pr_labels)
    +            if conflicts:
    +                raise ValueError(f"ci:skip-rocm conflicts with {sorted(conflicts)}")

    might be helpful to have an explanation as to why? some ppl may know, but i feel it's slightly assumed and better to explain the scenario than have questions

    geomin12 geomin12 commented on code on Oct 16, 2026 22:01 UTC
    Code Review
    build_tools/packaging/python/get_latest_python_package_version.py:1

    i wonder if we can keep this generic for all package retrievals? (might have a use case later for tarballs, other packages). just food for thought

    checked through build_tools/github_actions to see if this fit anywhere better, but this is fine w me

    geomin12 geomin12 approved these changes on Oct 16, 2026 22:02 UTC
    Approved Reviewer

    some nits and thoughts, but otherwise lgtm! this is a great feature

    ScottTodd ScottTodd commented on code on Oct 16, 2026 22:08 UTC
    Code Review
    .github/workflows/multi_arch_ci_linux.yml:1
    @@ -346,9 +418,11 @@ jobs:
           # The reusable workflow expands this to gfx targets via
           # cmake/therock_amdgpu_targets.cmake.
           amdgpu_families: ${{ matrix.amdgpu_families }}
    -      kpack_split: ${{ needs.build_python_packages.outputs.kpack_split }}
    -      rocm_package_find_links_url: ${{ needs.build_python_packages.outputs.package_find_links_url }}
    -      rocm_version: ${{ inputs.rocm_package_version }}
    +      # Multi-arch CI and nightly whl-next packages both use the split layout.
    +      kpack_split: ${{ 'true' }}

    Dropping kpack_split from these workflows entirely in https://github.com/ROCm/TheRock/pull/8949

    ScottTodd ScottTodd commented on code on Oct 16, 2026 22:09 UTC
    Code Review
    .github/workflows/setup_multi_arch.yml:1
    @@ -166,7 +166,7 @@ permissions:
     
     jobs:
       setup:
    -    runs-on: ubuntu-24.04
    +    runs-on: ubuntu-26.04

    Sure. Needed it for some newer python packages that the github-hosted runners include only in the 26.04 image and didn't want a pip install step ;)

    ScottTodd ScottTodd commented on code on Oct 16, 2026 22:11 UTC
    Code Review
    build_tools/packaging/python/get_latest_python_package_version.py:1

    Hmmmm maybe. We already have https://github.com/ROCm/TheRock/blob/main/build_tools/install_rocm_from_artifacts.py with some "get latest from the index" code though. I could put "python" in the file name here at least, or move to https://github.com/ROCm/TheRock/tree/main/build_tools/packaging/python

    ScottTodd ScottTodd commented on code on Oct 16, 2026 23:06 UTC
    Code Review
    .github/workflows/setup_multi_arch.yml:1
    @@ -166,7 +166,7 @@ permissions:
     
     jobs:
       setup:
    -    runs-on: ubuntu-24.04
    +    runs-on: ubuntu-26.04

    Oh right, it was pip itself >= 25.1 for pip index version --json.

    ScottTodd ScottTodd commented on code on Oct 16, 2026 23:14 UTC
    Code Review
    .github/workflows/setup_multi_arch.yml:1
    @@ -166,7 +166,7 @@ permissions:
     
     jobs:
       setup:
    -    runs-on: ubuntu-24.04
    +    runs-on: ubuntu-26.04
    ScottTodd ScottTodd commented on Oct 26, 2026 15:29 UTC
    Author

    I'll pick this back up around Wednesday this week. Still traveling/busy the start of this week.

    ScottTodd ScottTodd commented on code on Oct 30, 2026 17:23 UTC
    Code Review
    build_tools/github_actions/configure_ci_labels.py:1
    @@ -170,14 +169,15 @@ class Label:
         # build_variant: labels
         Label("build_variant:asan", COLOR_BUILD_VARIANT, "If enabled, the pull request will run ASAN builds"),
         # ci:packaging labels (opt-in to specific packaging/build jobs)
    +    Label("ci:build-python-packages", COLOR_CI_PACKAGING, "Opt-in to building Python packages"),
         Label("ci:build-pytorch", COLOR_CI_PACKAGING, "Opt-in to building PyTorch packages"),
         Label("ci:build-jax", COLOR_CI_PACKAGING, "Opt-in to building JAX packages"),
         Label("ci:build-native-linux", COLOR_CI_PACKAGING, "Opt-in to building native Linux packages"),
    -    Label("ci:build-python-packages", COLOR_CI_PACKAGING, "Opt-in to building Python packages"),
    +    Label("ci:skip-rocm", COLOR_CI_PACKAGING, "Skip ROCm builds and tests; use published ROCm packages for frameworks"),
    ScottTodd ScottTodd commented on code on Oct 30, 2026 17:26 UTC
    Code Review
    .github/workflows/multi_arch_ci_linux.yml:1
    @@ -346,9 +418,11 @@ jobs:
           # The reusable workflow expands this to gfx targets via
           # cmake/therock_amdgpu_targets.cmake.
           amdgpu_families: ${{ matrix.amdgpu_families }}
    -      kpack_split: ${{ needs.build_python_packages.outputs.kpack_split }}
    -      rocm_package_find_links_url: ${{ needs.build_python_packages.outputs.package_find_links_url }}
    -      rocm_version: ${{ inputs.rocm_package_version }}
    +      # Multi-arch CI and nightly whl-next packages both use the split layout.
    +      kpack_split: ${{ 'true' }}

    The input type is string and 'true' is treated as a boolean by actionlint, so this seems to be needed...

    https://github.com/ROCm/TheRock/blob/d8c990f6b39a3a84d8576827fe984365812c62cd/.github/workflows/multi_arch_build_portable_linux_pytorch_wheels_ci.yml#L65-L68

    Anyways, it'll be removed entirely once that other PR progresses

    ScottTodd ScottTodd commented on code on Oct 30, 2026 17:26 UTC
    Code Review
    build_tools/packaging/python/get_latest_python_package_version.py:1

    Moved to build_tools/packaging/python/get_latest_python_package_version.py

    ScottTodd ScottTodd commented on Oct 30, 2026 18:59 UTC
    Author

    Addressed comments and tested again. @marbre / @jayhawk-commits would either of you like to review too?

    ScottTodd ScottTodd commented on Nov 03, 2026 18:03 UTC
    Author

    Planning on merging soon if there is no other review feedback.

    Reviewers
    Assignees
    ScottTodd ScottTodd
    Labels
    risk: low confidence: 90.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 63.5% (MEDIUM) · Higher = larger blast radius
    63.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.8% · Lower = rushed or shallow review
    90.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.9% · Safe to merge
    5.9%
    Repository