From 5682ec0262191b3552ee5a257cb142dee777adec Mon Sep 17 00:00:00 2001 From: Ian Dass <145489691+idass1990@users.noreply.github.com> Date: Wed, 28 Oct 2026 17:40:32 -0400 Subject: [PATCH 1/2] ci: pass rocm_msi_package_version to windows_build_and_test Required for the Windows MSI build job to produce a valid installer. ROCm/TheRock#9547 Co-Authored-By: Claude --- .github/workflows/therock-multi-arch-ci.yml | 739 ++++++++++---------- 1 file changed, 370 insertions(+), 369 deletions(-) diff --git a/.github/workflows/therock-multi-arch-ci.yml b/.github/workflows/therock-multi-arch-ci.yml index c413045c0f42..7a7638ad9188 100644 --- a/.github/workflows/therock-multi-arch-ci.yml +++ b/.github/workflows/therock-multi-arch-ci.yml @@ -1,369 +1,370 @@ -# Copyright Advanced Micro Devices, Inc. -# SPDX-License-Identifier: MIT - -# Multi-Arch CI for rocm-libraries -# -# This workflow replicates TheRock's multi-arch CI pipeline by calling -# TheRock's reusable workflows directly. It provides sharded, multi-stage -# builds with per-architecture testing. -# -# - Uses TheRock's multi-arch sharded build pipeline (foundation -> compiler-runtime -> math-libs) -# - Supports prebuilt stages to skip certain build stages -# - Parallelizes across GPU architectures - -name: TheRock Multi-Arch CI - -# TheRock ref: pinned to ROCm/TheRock commit 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a. -# NOTE: update all `@` refs and `ref:` inputs together when switching. - -on: - push: - branches: - - develop - - release/therock-* - pull_request: - types: - - opened - - synchronize - - reopened - - labeled - - unlabeled - workflow_dispatch: - inputs: - linux_amdgpu_families: - type: string - description: "Comma-separated Linux GPU families to build and test, ex: gfx94X,gfx120X. Use 'none' to skip Linux or 'all' for every family." - default: "" - windows_amdgpu_families: - type: string - description: "Comma-separated Windows GPU families to build and test, ex: gfx110X,gfx120X. Use 'none' to skip Windows or 'all' for every family." - default: "" - pr_labels: - type: string - description: "Comma-separated PR labels (e.g. ci:skip-pytorch,test:rocprim,test_filter:quick). On pull_request events the labels come from the event payload instead." - default: "" - prebuilt_stages: - type: string - default: "" - description: "Comma-separated build stages to skip (or 'all' for all stages); artifacts are copied from baseline_run_id instead" - baseline_run_id: - type: string - default: "" - description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set" - baseline_repository: - type: string - default: "" - description: "Repository to query for baseline_run_id. Defaults to github.repository for workflow_dispatch." - build_python_packages: - type: boolean - default: false - description: "Build ROCm Python packages" - build_pytorch: - type: boolean - default: false - description: "Build PyTorch wheels" - build_jax: - type: boolean - default: false - description: "Build JAX wheels" - build_native_linux: - type: boolean - default: false - description: "Build native Linux packages and run install tests" -permissions: - contents: read - actions: read - -concurrency: - # A PR number if a pull request and otherwise the commit hash. This cancels - # queued and in-progress runs for the same PR (presubmit) or commit - # (postsubmit). The workflow name is prepended to avoid conflicts between - # different workflows. - group: ${{ github.workflow }}-${{ github.event.number || github.sha }} - cancel-in-progress: true - -jobs: - ci-env: - name: Load CI Environment - runs-on: ubuntu-24.04 - outputs: - # Use the manually supplied or bot-maintained baseline. An empty value - # causes artifact reuse to be disabled and triggers a full stage build. - baseline-run-id: ${{ inputs.baseline_run_id || steps.ci-env.outputs.baseline-run-id }} - linux-runner: ${{ steps.ci-env.outputs.linux-runner }} - therock-ref: ${{ steps.ci-env.outputs.therock-ref }} - steps: - - name: Checkout ci-env action - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: .github/actions/ci-env - sparse-checkout-cone-mode: true - - - name: Load CI environment - id: ci-env - uses: ./.github/actions/ci-env - - configure: - name: Configure Changed Projects - runs-on: ubuntu-24.04 - outputs: - changed_projects: ${{ steps.configure.outputs.changed_projects }} - # TheRock's determine_rocm_test_dependencies.py natively resolves - # shared/* monorepo subtrees (shared/stinkytofu, shared/tensile, - # shared/origami, shared/mxdatagenerator, shared/rocroller) into the - # right consumer set, so changed_projects is passed straight through - # as test_projects without a rocm-libraries-side translation step. - # See ROCm/rocm-libraries#11784 for the retired stopgap this replaces. - test_projects: ${{ steps.configure.outputs.changed_projects }} - run_all_tests: ${{ steps.configure.outputs.run_all_tests }} - test_type: ${{ steps.configure.outputs.test_type }} - steps: - - name: Checkout repository config - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: | - .github/repos-config.json - sparse-checkout-cone-mode: false - - - name: Checkout TheRock for configure script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: ROCm/TheRock - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - path: _therock - sparse-checkout: build_tools/github_actions - sparse-checkout-cone-mode: true - - - name: Configure CI - id: configure - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - python3 _therock/build_tools/github_actions/configure_external_repo_ci.py \ - --event-name "${{ github.event_name }}" \ - --github-repo "${{ github.repository }}" \ - --base-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}" \ - --head-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" \ - --config-path ".github/repos-config.json" - - setup: - needs: [ci-env, configure] - uses: ROCm/TheRock/.github/workflows/setup_multi_arch.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - with: - build_variant: "release" - # Limit GPU families for rocm-libraries CI. - # gfx125X (CDNA5/gfx1250) is included build-only on every PR/push: no test - # hardware exists for it yet (see amdgpu_family_matrix.py in TheRock, family - # key "gfx125x": test-runs-on is empty everywhere), but legacy therock-ci.yml - # built it on every PR/push before Multi-Arch CI became the default, and this - # restores that parity so gfx1250 build breaks are caught same-PR instead of - # only nightly. - # - # An empty input means "not specified" here and falls back to these - # defaults, including on workflow_dispatch. To skip a platform entirely, - # pass 'none', which setup_multi_arch.yml resolves to an empty build - # config. - linux_amdgpu_families: ${{ inputs.linux_amdgpu_families || 'gfx94X,gfx950,gfx125X' }} - windows_amdgpu_families: ${{ inputs.windows_amdgpu_families || 'gfx110X' }} - pr_labels: ${{ inputs.pr_labels || '' }} - # Copy all stages except math-libs and ml-libs from TheRock baseline - # rocm-libraries only affects math-libs and ml-libs source sets - # RPP owns cv-libs, so rebuild that stage when projects/rpp changes. - # Note: compiler-runtime excluded due to hardcoded CMake paths (fftw3, etc.) - # Copy prebuilt stages only when the resolved reuse policy provides a - # baseline run ID. Otherwise, leave this empty for a full stage build. - prebuilt_stages: ${{ needs.ci-env.outputs.baseline-run-id != '' && (inputs.prebuilt_stages || (contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/rpp,') && 'runtime-tests,comm-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg' || 'runtime-tests,comm-libs,cv-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg')) || '' }} - # Use the baseline selected by the artifact reuse policy above. - baseline_run_id: ${{ needs.ci-env.outputs.baseline-run-id }} - baseline_repository: ${{ inputs.baseline_repository || (inputs.baseline_run_id != '' && github.repository) || '' }} - build_python_packages: ${{ inputs.build_python_packages || false }} - build_pytorch: ${{ inputs.build_pytorch || false }} - build_jax: ${{ inputs.build_jax || false }} - # Preserve manual workflow_dispatch control and enable native package - # builds for pull requests carrying the opt-in label. - build_native_linux: ${{ inputs.build_native_linux || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:native-linux-packages')) }} - # A missing baseline disables artifact reuse and causes TheRock to - # perform a full stage build. - stage_reuse_mode: >- - ${{ - needs.ci-env.outputs.baseline-run-id != '' && - 'reuse-stage' || - 'off' - }} - repository: ROCm/TheRock - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - # Pass external repo info for stage-impact analysis. - # extra_cmake_options is appended to the cmake configure line of every - # build stage, scoped to this repository's CI runs. TheRock keeps - # HIPKERNELPROVIDER_ENABLE_ROCKE OFF by default; enabling it here is what - # gives rocKE build and test signal while it is still in development. - # Keep the value constant: the flag state file participates in every - # subproject's configure fingerprint, and stage reuse does not key on - # flags (TheRock#3399), so a per-PR value would churn fingerprints and - # let baselines built with the opposite value look reusable. - external_repo: >- - { - "repository": "${{ github.repository }}", - "ref": "${{ github.sha }}", - "base_sha": "${{ github.event.pull_request.base.sha || github.event.before }}", - "head_sha": "${{ github.sha }}", - "pr_number": ${{ github.event.pull_request.number || 'null' }}, - "event_name": "${{ github.event_name }}", - "skip_ci_config": ".github/skip-ci-config.toml", - "extra_cmake_options": "-DTHEROCK_FLAG_HIPKERNELPROVIDER_ENABLE_ROCKE=ON" - } - - linux_build_and_test: - name: Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} - needs: [configure, setup] - if: >- - ${{ - needs.setup.outputs.linux_build_config != '' && - needs.setup.outputs.enable_build_jobs == 'true' - }} - uses: ROCm/TheRock/.github/workflows/multi_arch_ci_linux.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - secrets: inherit - with: - build_config: ${{ needs.setup.outputs.linux_build_config }} - test_labels: ${{ needs.setup.outputs.linux_test_labels }} - rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} - rocm_deb_package_version: ${{ needs.setup.outputs.rocm_deb_package_version }} - rocm_rpm_package_version: ${{ needs.setup.outputs.rocm_rpm_package_version }} - test_type: ${{ needs.configure.outputs.test_type }} - external_repo_config: ${{ needs.setup.outputs.external_repo_config }} - # Empty string when run_all_tests=true triggers full test run in downstream workflow - changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} - repository: ROCm/TheRock - # Concrete SHA resolved once by setup; do not re-resolve main here. - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - permissions: - contents: read - id-token: write - - windows_build_and_test: - name: Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} - needs: [configure, setup] - if: >- - ${{ - needs.setup.outputs.windows_build_config != '' && - needs.setup.outputs.enable_build_jobs == 'true' - }} - uses: ROCm/TheRock/.github/workflows/multi_arch_ci_windows.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - secrets: inherit - with: - build_config: ${{ needs.setup.outputs.windows_build_config }} - test_labels: ${{ needs.setup.outputs.windows_test_labels }} - rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} - test_type: ${{ needs.configure.outputs.test_type }} - external_repo_config: ${{ needs.setup.outputs.external_repo_config }} - # Empty string when run_all_tests=true triggers full test run in downstream workflow - changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} - repository: ROCm/TheRock - # Concrete SHA resolved once by setup; do not re-resolve main here. - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - permissions: - contents: read - id-token: write - - rocjitsu_race_check: - name: rocjitsu race check (${{ matrix.amdgpu_families }}) - # A caller cannot depend on an individual job inside a reusable workflow, - # so start after the Linux workflow has finished publishing its artifacts. - # This sidecar remains advisory and is not part of the required summary. - needs: [ci-env, configure, linux_build_and_test] - strategy: - fail-fast: false - matrix: - include: - - amdgpu_families: gfx94X-dcgpu - amdgpu_targets: gfx942 - - amdgpu_families: gfx950-dcgpu - amdgpu_targets: gfx950 - if: >- - ${{ - !cancelled() && - github.event_name == 'pull_request' && - ( - contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt,') || - contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt/tensilelite,') || - contains(github.event.pull_request.labels.*.name, 'test:hipblaslt') - ) && - needs.linux_build_and_test.result != 'skipped' - }} - uses: ./.github/workflows/therock-rocjitsu-race-check-linux.yml - with: - therock_ref: ${{ needs.ci-env.outputs.therock-ref }} - build_runs_on: ${{ needs.ci-env.outputs.linux-runner }} - amdgpu_families: ${{ matrix.amdgpu_families }} - amdgpu_targets: ${{ matrix.amdgpu_targets }} - # TODO(newling): Add gfx1151 after validating a target-specific workload. - - notify_teams_on_failure: - name: Notify Teams Channel on Failure - # Build and test jobs run inside TheRock's reusable workflows, so - # notify_teams.py reports each failed Linux::/Windows:: job of this run - # from here, routing to the MIOpen / hipDNN channels by PR title tag - # ([miopen], [hipdnn], [miopenprovider]) or component name. - # Webhook secrets are unavailable to fork PRs. - needs: [configure, linux_build_and_test, windows_build_and_test] - # A notification problem must never fail the PR. - continue-on-error: true - if: >- - ${{ - always() && - !github.event.pull_request.head.repo.fork && - ( - needs.linux_build_and_test.result == 'failure' || - needs.windows_build_and_test.result == 'failure' - ) - }} - runs-on: ubuntu-24.04 - steps: - - name: Checkout notify script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: .github/scripts/notify_teams.py - sparse-checkout-cone-mode: false - - - name: Notify Teams for failed build and test jobs - env: - GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ github.event.pull_request.number }} - PR_TITLE: ${{ github.event.pull_request.title }} - MIOPEN_WEBHOOK_URL: ${{ secrets.MIOPEN_CI_WEBHOOK_URL }} - HIPDNN_WEBHOOK_URL: ${{ secrets.HIPDNN_CI_WEBHOOK_URL }} - CHANGED_PROJECTS: ${{ needs.configure.outputs.changed_projects }} - run: | - python3 .github/scripts/notify_teams.py \ - --failed-jobs-from-run \ - --webhook-urls "{\"miopen\":\"${MIOPEN_WEBHOOK_URL}\",\"hipdnn\":\"${HIPDNN_WEBHOOK_URL}\"}" \ - --pr-number "${PR_NUMBER}" \ - --pr-title "${PR_TITLE}" \ - --component-name "${CHANGED_PROJECTS}" - - multi_arch_ci_summary: - name: Multi-Arch CI Summary - if: always() - needs: - - ci-env - - configure - - setup - - linux_build_and_test - - windows_build_and_test - runs-on: ubuntu-24.04 - steps: - - name: Checkout TheRock repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: "ROCm/TheRock" - # Concrete SHA resolved once by setup; do not re-resolve main here. - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - sparse-checkout: build_tools/github_actions - sparse-checkout-cone-mode: true - - - name: Evaluate workflow results - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - python build_tools/github_actions/workflow_summary.py \ - --needs-json '${{ toJSON(needs) }}' +# Copyright Advanced Micro Devices, Inc. +# SPDX-License-Identifier: MIT + +# Multi-Arch CI for rocm-libraries +# +# This workflow replicates TheRock's multi-arch CI pipeline by calling +# TheRock's reusable workflows directly. It provides sharded, multi-stage +# builds with per-architecture testing. +# +# - Uses TheRock's multi-arch sharded build pipeline (foundation -> compiler-runtime -> math-libs) +# - Supports prebuilt stages to skip certain build stages +# - Parallelizes across GPU architectures + +name: TheRock Multi-Arch CI + +# TheRock ref: pinned to ROCm/TheRock commit 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a. +# NOTE: update all `@` refs and `ref:` inputs together when switching. + +on: + push: + branches: + - develop + - release/therock-* + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + workflow_dispatch: + inputs: + linux_amdgpu_families: + type: string + description: "Comma-separated Linux GPU families to build and test, ex: gfx94X,gfx120X. Use 'none' to skip Linux or 'all' for every family." + default: "" + windows_amdgpu_families: + type: string + description: "Comma-separated Windows GPU families to build and test, ex: gfx110X,gfx120X. Use 'none' to skip Windows or 'all' for every family." + default: "" + pr_labels: + type: string + description: "Comma-separated PR labels (e.g. ci:skip-pytorch,test:rocprim,test_filter:quick). On pull_request events the labels come from the event payload instead." + default: "" + prebuilt_stages: + type: string + default: "" + description: "Comma-separated build stages to skip (or 'all' for all stages); artifacts are copied from baseline_run_id instead" + baseline_run_id: + type: string + default: "" + description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set" + baseline_repository: + type: string + default: "" + description: "Repository to query for baseline_run_id. Defaults to github.repository for workflow_dispatch." + build_python_packages: + type: boolean + default: false + description: "Build ROCm Python packages" + build_pytorch: + type: boolean + default: false + description: "Build PyTorch wheels" + build_jax: + type: boolean + default: false + description: "Build JAX wheels" + build_native_linux: + type: boolean + default: false + description: "Build native Linux packages and run install tests" +permissions: + contents: read + actions: read + +concurrency: + # A PR number if a pull request and otherwise the commit hash. This cancels + # queued and in-progress runs for the same PR (presubmit) or commit + # (postsubmit). The workflow name is prepended to avoid conflicts between + # different workflows. + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + +jobs: + ci-env: + name: Load CI Environment + runs-on: ubuntu-24.04 + outputs: + # Use the manually supplied or bot-maintained baseline. An empty value + # causes artifact reuse to be disabled and triggers a full stage build. + baseline-run-id: ${{ inputs.baseline_run_id || steps.ci-env.outputs.baseline-run-id }} + linux-runner: ${{ steps.ci-env.outputs.linux-runner }} + therock-ref: ${{ steps.ci-env.outputs.therock-ref }} + steps: + - name: Checkout ci-env action + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: .github/actions/ci-env + sparse-checkout-cone-mode: true + + - name: Load CI environment + id: ci-env + uses: ./.github/actions/ci-env + + configure: + name: Configure Changed Projects + runs-on: ubuntu-24.04 + outputs: + changed_projects: ${{ steps.configure.outputs.changed_projects }} + # TheRock's determine_rocm_test_dependencies.py natively resolves + # shared/* monorepo subtrees (shared/stinkytofu, shared/tensile, + # shared/origami, shared/mxdatagenerator, shared/rocroller) into the + # right consumer set, so changed_projects is passed straight through + # as test_projects without a rocm-libraries-side translation step. + # See ROCm/rocm-libraries#11784 for the retired stopgap this replaces. + test_projects: ${{ steps.configure.outputs.changed_projects }} + run_all_tests: ${{ steps.configure.outputs.run_all_tests }} + test_type: ${{ steps.configure.outputs.test_type }} + steps: + - name: Checkout repository config + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: | + .github/repos-config.json + sparse-checkout-cone-mode: false + + - name: Checkout TheRock for configure script + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: ROCm/TheRock + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + path: _therock + sparse-checkout: build_tools/github_actions + sparse-checkout-cone-mode: true + + - name: Configure CI + id: configure + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + python3 _therock/build_tools/github_actions/configure_external_repo_ci.py \ + --event-name "${{ github.event_name }}" \ + --github-repo "${{ github.repository }}" \ + --base-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}" \ + --head-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" \ + --config-path ".github/repos-config.json" + + setup: + needs: [ci-env, configure] + uses: ROCm/TheRock/.github/workflows/setup_multi_arch.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + with: + build_variant: "release" + # Limit GPU families for rocm-libraries CI. + # gfx125X (CDNA5/gfx1250) is included build-only on every PR/push: no test + # hardware exists for it yet (see amdgpu_family_matrix.py in TheRock, family + # key "gfx125x": test-runs-on is empty everywhere), but legacy therock-ci.yml + # built it on every PR/push before Multi-Arch CI became the default, and this + # restores that parity so gfx1250 build breaks are caught same-PR instead of + # only nightly. + # + # An empty input means "not specified" here and falls back to these + # defaults, including on workflow_dispatch. To skip a platform entirely, + # pass 'none', which setup_multi_arch.yml resolves to an empty build + # config. + linux_amdgpu_families: ${{ inputs.linux_amdgpu_families || 'gfx94X,gfx950,gfx125X' }} + windows_amdgpu_families: ${{ inputs.windows_amdgpu_families || 'gfx110X' }} + pr_labels: ${{ inputs.pr_labels || '' }} + # Copy all stages except math-libs and ml-libs from TheRock baseline + # rocm-libraries only affects math-libs and ml-libs source sets + # RPP owns cv-libs, so rebuild that stage when projects/rpp changes. + # Note: compiler-runtime excluded due to hardcoded CMake paths (fftw3, etc.) + # Copy prebuilt stages only when the resolved reuse policy provides a + # baseline run ID. Otherwise, leave this empty for a full stage build. + prebuilt_stages: ${{ needs.ci-env.outputs.baseline-run-id != '' && (inputs.prebuilt_stages || (contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/rpp,') && 'runtime-tests,comm-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg' || 'runtime-tests,comm-libs,cv-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg')) || '' }} + # Use the baseline selected by the artifact reuse policy above. + baseline_run_id: ${{ needs.ci-env.outputs.baseline-run-id }} + baseline_repository: ${{ inputs.baseline_repository || (inputs.baseline_run_id != '' && github.repository) || '' }} + build_python_packages: ${{ inputs.build_python_packages || false }} + build_pytorch: ${{ inputs.build_pytorch || false }} + build_jax: ${{ inputs.build_jax || false }} + # Preserve manual workflow_dispatch control and enable native package + # builds for pull requests carrying the opt-in label. + build_native_linux: ${{ inputs.build_native_linux || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:native-linux-packages')) }} + # A missing baseline disables artifact reuse and causes TheRock to + # perform a full stage build. + stage_reuse_mode: >- + ${{ + needs.ci-env.outputs.baseline-run-id != '' && + 'reuse-stage' || + 'off' + }} + repository: ROCm/TheRock + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + # Pass external repo info for stage-impact analysis. + # extra_cmake_options is appended to the cmake configure line of every + # build stage, scoped to this repository's CI runs. TheRock keeps + # HIPKERNELPROVIDER_ENABLE_ROCKE OFF by default; enabling it here is what + # gives rocKE build and test signal while it is still in development. + # Keep the value constant: the flag state file participates in every + # subproject's configure fingerprint, and stage reuse does not key on + # flags (TheRock#3399), so a per-PR value would churn fingerprints and + # let baselines built with the opposite value look reusable. + external_repo: >- + { + "repository": "${{ github.repository }}", + "ref": "${{ github.sha }}", + "base_sha": "${{ github.event.pull_request.base.sha || github.event.before }}", + "head_sha": "${{ github.sha }}", + "pr_number": ${{ github.event.pull_request.number || 'null' }}, + "event_name": "${{ github.event_name }}", + "skip_ci_config": ".github/skip-ci-config.toml", + "extra_cmake_options": "-DTHEROCK_FLAG_HIPKERNELPROVIDER_ENABLE_ROCKE=ON" + } + + linux_build_and_test: + name: Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} + needs: [configure, setup] + if: >- + ${{ + needs.setup.outputs.linux_build_config != '' && + needs.setup.outputs.enable_build_jobs == 'true' + }} + uses: ROCm/TheRock/.github/workflows/multi_arch_ci_linux.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + secrets: inherit + with: + build_config: ${{ needs.setup.outputs.linux_build_config }} + test_labels: ${{ needs.setup.outputs.linux_test_labels }} + rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} + rocm_deb_package_version: ${{ needs.setup.outputs.rocm_deb_package_version }} + rocm_rpm_package_version: ${{ needs.setup.outputs.rocm_rpm_package_version }} + test_type: ${{ needs.configure.outputs.test_type }} + external_repo_config: ${{ needs.setup.outputs.external_repo_config }} + # Empty string when run_all_tests=true triggers full test run in downstream workflow + changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} + repository: ROCm/TheRock + # Concrete SHA resolved once by setup; do not re-resolve main here. + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + permissions: + contents: read + id-token: write + + windows_build_and_test: + name: Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} + needs: [configure, setup] + if: >- + ${{ + needs.setup.outputs.windows_build_config != '' && + needs.setup.outputs.enable_build_jobs == 'true' + }} + uses: ROCm/TheRock/.github/workflows/multi_arch_ci_windows.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + secrets: inherit + with: + build_config: ${{ needs.setup.outputs.windows_build_config }} + test_labels: ${{ needs.setup.outputs.windows_test_labels }} + rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} + rocm_msi_package_version: ${{ needs.setup.outputs.rocm_msi_package_version }} + test_type: ${{ needs.configure.outputs.test_type }} + external_repo_config: ${{ needs.setup.outputs.external_repo_config }} + # Empty string when run_all_tests=true triggers full test run in downstream workflow + changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} + repository: ROCm/TheRock + # Concrete SHA resolved once by setup; do not re-resolve main here. + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + permissions: + contents: read + id-token: write + + rocjitsu_race_check: + name: rocjitsu race check (${{ matrix.amdgpu_families }}) + # A caller cannot depend on an individual job inside a reusable workflow, + # so start after the Linux workflow has finished publishing its artifacts. + # This sidecar remains advisory and is not part of the required summary. + needs: [ci-env, configure, linux_build_and_test] + strategy: + fail-fast: false + matrix: + include: + - amdgpu_families: gfx94X-dcgpu + amdgpu_targets: gfx942 + - amdgpu_families: gfx950-dcgpu + amdgpu_targets: gfx950 + if: >- + ${{ + !cancelled() && + github.event_name == 'pull_request' && + ( + contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt,') || + contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt/tensilelite,') || + contains(github.event.pull_request.labels.*.name, 'test:hipblaslt') + ) && + needs.linux_build_and_test.result != 'skipped' + }} + uses: ./.github/workflows/therock-rocjitsu-race-check-linux.yml + with: + therock_ref: ${{ needs.ci-env.outputs.therock-ref }} + build_runs_on: ${{ needs.ci-env.outputs.linux-runner }} + amdgpu_families: ${{ matrix.amdgpu_families }} + amdgpu_targets: ${{ matrix.amdgpu_targets }} + # TODO(newling): Add gfx1151 after validating a target-specific workload. + + notify_teams_on_failure: + name: Notify Teams Channel on Failure + # Build and test jobs run inside TheRock's reusable workflows, so + # notify_teams.py reports each failed Linux::/Windows:: job of this run + # from here, routing to the MIOpen / hipDNN channels by PR title tag + # ([miopen], [hipdnn], [miopenprovider]) or component name. + # Webhook secrets are unavailable to fork PRs. + needs: [configure, linux_build_and_test, windows_build_and_test] + # A notification problem must never fail the PR. + continue-on-error: true + if: >- + ${{ + always() && + !github.event.pull_request.head.repo.fork && + ( + needs.linux_build_and_test.result == 'failure' || + needs.windows_build_and_test.result == 'failure' + ) + }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout notify script + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: .github/scripts/notify_teams.py + sparse-checkout-cone-mode: false + + - name: Notify Teams for failed build and test jobs + env: + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + PR_TITLE: ${{ github.event.pull_request.title }} + MIOPEN_WEBHOOK_URL: ${{ secrets.MIOPEN_CI_WEBHOOK_URL }} + HIPDNN_WEBHOOK_URL: ${{ secrets.HIPDNN_CI_WEBHOOK_URL }} + CHANGED_PROJECTS: ${{ needs.configure.outputs.changed_projects }} + run: | + python3 .github/scripts/notify_teams.py \ + --failed-jobs-from-run \ + --webhook-urls "{\"miopen\":\"${MIOPEN_WEBHOOK_URL}\",\"hipdnn\":\"${HIPDNN_WEBHOOK_URL}\"}" \ + --pr-number "${PR_NUMBER}" \ + --pr-title "${PR_TITLE}" \ + --component-name "${CHANGED_PROJECTS}" + + multi_arch_ci_summary: + name: Multi-Arch CI Summary + if: always() + needs: + - ci-env + - configure + - setup + - linux_build_and_test + - windows_build_and_test + runs-on: ubuntu-24.04 + steps: + - name: Checkout TheRock repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: "ROCm/TheRock" + # Concrete SHA resolved once by setup; do not re-resolve main here. + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + sparse-checkout: build_tools/github_actions + sparse-checkout-cone-mode: true + + - name: Evaluate workflow results + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + python build_tools/github_actions/workflow_summary.py \ + --needs-json '${{ toJSON(needs) }}' From b8317b169b803661eb92441342d41e897eec3e3d Mon Sep 17 00:00:00 2001 From: Ian Dass <145489691+idass1990@users.noreply.github.com> Date: Wed, 28 Oct 2026 17:43:34 -0400 Subject: [PATCH 2/2] ci: pass rocm_msi_package_version to windows_build_and_test Required for the Windows MSI build job to produce a valid installer. ROCm/TheRock#9547 Co-Authored-By: Claude --- .github/workflows/therock-multi-arch-ci.yml | 740 ++++++++++---------- 1 file changed, 370 insertions(+), 370 deletions(-) diff --git a/.github/workflows/therock-multi-arch-ci.yml b/.github/workflows/therock-multi-arch-ci.yml index 7a7638ad9188..fcf74a9e2850 100644 --- a/.github/workflows/therock-multi-arch-ci.yml +++ b/.github/workflows/therock-multi-arch-ci.yml @@ -1,370 +1,370 @@ -# Copyright Advanced Micro Devices, Inc. -# SPDX-License-Identifier: MIT - -# Multi-Arch CI for rocm-libraries -# -# This workflow replicates TheRock's multi-arch CI pipeline by calling -# TheRock's reusable workflows directly. It provides sharded, multi-stage -# builds with per-architecture testing. -# -# - Uses TheRock's multi-arch sharded build pipeline (foundation -> compiler-runtime -> math-libs) -# - Supports prebuilt stages to skip certain build stages -# - Parallelizes across GPU architectures - -name: TheRock Multi-Arch CI - -# TheRock ref: pinned to ROCm/TheRock commit 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a. -# NOTE: update all `@` refs and `ref:` inputs together when switching. - -on: - push: - branches: - - develop - - release/therock-* - pull_request: - types: - - opened - - synchronize - - reopened - - labeled - - unlabeled - workflow_dispatch: - inputs: - linux_amdgpu_families: - type: string - description: "Comma-separated Linux GPU families to build and test, ex: gfx94X,gfx120X. Use 'none' to skip Linux or 'all' for every family." - default: "" - windows_amdgpu_families: - type: string - description: "Comma-separated Windows GPU families to build and test, ex: gfx110X,gfx120X. Use 'none' to skip Windows or 'all' for every family." - default: "" - pr_labels: - type: string - description: "Comma-separated PR labels (e.g. ci:skip-pytorch,test:rocprim,test_filter:quick). On pull_request events the labels come from the event payload instead." - default: "" - prebuilt_stages: - type: string - default: "" - description: "Comma-separated build stages to skip (or 'all' for all stages); artifacts are copied from baseline_run_id instead" - baseline_run_id: - type: string - default: "" - description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set" - baseline_repository: - type: string - default: "" - description: "Repository to query for baseline_run_id. Defaults to github.repository for workflow_dispatch." - build_python_packages: - type: boolean - default: false - description: "Build ROCm Python packages" - build_pytorch: - type: boolean - default: false - description: "Build PyTorch wheels" - build_jax: - type: boolean - default: false - description: "Build JAX wheels" - build_native_linux: - type: boolean - default: false - description: "Build native Linux packages and run install tests" -permissions: - contents: read - actions: read - -concurrency: - # A PR number if a pull request and otherwise the commit hash. This cancels - # queued and in-progress runs for the same PR (presubmit) or commit - # (postsubmit). The workflow name is prepended to avoid conflicts between - # different workflows. - group: ${{ github.workflow }}-${{ github.event.number || github.sha }} - cancel-in-progress: true - -jobs: - ci-env: - name: Load CI Environment - runs-on: ubuntu-24.04 - outputs: - # Use the manually supplied or bot-maintained baseline. An empty value - # causes artifact reuse to be disabled and triggers a full stage build. - baseline-run-id: ${{ inputs.baseline_run_id || steps.ci-env.outputs.baseline-run-id }} - linux-runner: ${{ steps.ci-env.outputs.linux-runner }} - therock-ref: ${{ steps.ci-env.outputs.therock-ref }} - steps: - - name: Checkout ci-env action - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: .github/actions/ci-env - sparse-checkout-cone-mode: true - - - name: Load CI environment - id: ci-env - uses: ./.github/actions/ci-env - - configure: - name: Configure Changed Projects - runs-on: ubuntu-24.04 - outputs: - changed_projects: ${{ steps.configure.outputs.changed_projects }} - # TheRock's determine_rocm_test_dependencies.py natively resolves - # shared/* monorepo subtrees (shared/stinkytofu, shared/tensile, - # shared/origami, shared/mxdatagenerator, shared/rocroller) into the - # right consumer set, so changed_projects is passed straight through - # as test_projects without a rocm-libraries-side translation step. - # See ROCm/rocm-libraries#11784 for the retired stopgap this replaces. - test_projects: ${{ steps.configure.outputs.changed_projects }} - run_all_tests: ${{ steps.configure.outputs.run_all_tests }} - test_type: ${{ steps.configure.outputs.test_type }} - steps: - - name: Checkout repository config - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: | - .github/repos-config.json - sparse-checkout-cone-mode: false - - - name: Checkout TheRock for configure script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: ROCm/TheRock - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - path: _therock - sparse-checkout: build_tools/github_actions - sparse-checkout-cone-mode: true - - - name: Configure CI - id: configure - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - python3 _therock/build_tools/github_actions/configure_external_repo_ci.py \ - --event-name "${{ github.event_name }}" \ - --github-repo "${{ github.repository }}" \ - --base-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}" \ - --head-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" \ - --config-path ".github/repos-config.json" - - setup: - needs: [ci-env, configure] - uses: ROCm/TheRock/.github/workflows/setup_multi_arch.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - with: - build_variant: "release" - # Limit GPU families for rocm-libraries CI. - # gfx125X (CDNA5/gfx1250) is included build-only on every PR/push: no test - # hardware exists for it yet (see amdgpu_family_matrix.py in TheRock, family - # key "gfx125x": test-runs-on is empty everywhere), but legacy therock-ci.yml - # built it on every PR/push before Multi-Arch CI became the default, and this - # restores that parity so gfx1250 build breaks are caught same-PR instead of - # only nightly. - # - # An empty input means "not specified" here and falls back to these - # defaults, including on workflow_dispatch. To skip a platform entirely, - # pass 'none', which setup_multi_arch.yml resolves to an empty build - # config. - linux_amdgpu_families: ${{ inputs.linux_amdgpu_families || 'gfx94X,gfx950,gfx125X' }} - windows_amdgpu_families: ${{ inputs.windows_amdgpu_families || 'gfx110X' }} - pr_labels: ${{ inputs.pr_labels || '' }} - # Copy all stages except math-libs and ml-libs from TheRock baseline - # rocm-libraries only affects math-libs and ml-libs source sets - # RPP owns cv-libs, so rebuild that stage when projects/rpp changes. - # Note: compiler-runtime excluded due to hardcoded CMake paths (fftw3, etc.) - # Copy prebuilt stages only when the resolved reuse policy provides a - # baseline run ID. Otherwise, leave this empty for a full stage build. - prebuilt_stages: ${{ needs.ci-env.outputs.baseline-run-id != '' && (inputs.prebuilt_stages || (contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/rpp,') && 'runtime-tests,comm-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg' || 'runtime-tests,comm-libs,cv-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg')) || '' }} - # Use the baseline selected by the artifact reuse policy above. - baseline_run_id: ${{ needs.ci-env.outputs.baseline-run-id }} - baseline_repository: ${{ inputs.baseline_repository || (inputs.baseline_run_id != '' && github.repository) || '' }} - build_python_packages: ${{ inputs.build_python_packages || false }} - build_pytorch: ${{ inputs.build_pytorch || false }} - build_jax: ${{ inputs.build_jax || false }} - # Preserve manual workflow_dispatch control and enable native package - # builds for pull requests carrying the opt-in label. - build_native_linux: ${{ inputs.build_native_linux || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:native-linux-packages')) }} - # A missing baseline disables artifact reuse and causes TheRock to - # perform a full stage build. - stage_reuse_mode: >- - ${{ - needs.ci-env.outputs.baseline-run-id != '' && - 'reuse-stage' || - 'off' - }} - repository: ROCm/TheRock - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - # Pass external repo info for stage-impact analysis. - # extra_cmake_options is appended to the cmake configure line of every - # build stage, scoped to this repository's CI runs. TheRock keeps - # HIPKERNELPROVIDER_ENABLE_ROCKE OFF by default; enabling it here is what - # gives rocKE build and test signal while it is still in development. - # Keep the value constant: the flag state file participates in every - # subproject's configure fingerprint, and stage reuse does not key on - # flags (TheRock#3399), so a per-PR value would churn fingerprints and - # let baselines built with the opposite value look reusable. - external_repo: >- - { - "repository": "${{ github.repository }}", - "ref": "${{ github.sha }}", - "base_sha": "${{ github.event.pull_request.base.sha || github.event.before }}", - "head_sha": "${{ github.sha }}", - "pr_number": ${{ github.event.pull_request.number || 'null' }}, - "event_name": "${{ github.event_name }}", - "skip_ci_config": ".github/skip-ci-config.toml", - "extra_cmake_options": "-DTHEROCK_FLAG_HIPKERNELPROVIDER_ENABLE_ROCKE=ON" - } - - linux_build_and_test: - name: Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} - needs: [configure, setup] - if: >- - ${{ - needs.setup.outputs.linux_build_config != '' && - needs.setup.outputs.enable_build_jobs == 'true' - }} - uses: ROCm/TheRock/.github/workflows/multi_arch_ci_linux.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - secrets: inherit - with: - build_config: ${{ needs.setup.outputs.linux_build_config }} - test_labels: ${{ needs.setup.outputs.linux_test_labels }} - rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} - rocm_deb_package_version: ${{ needs.setup.outputs.rocm_deb_package_version }} - rocm_rpm_package_version: ${{ needs.setup.outputs.rocm_rpm_package_version }} - test_type: ${{ needs.configure.outputs.test_type }} - external_repo_config: ${{ needs.setup.outputs.external_repo_config }} - # Empty string when run_all_tests=true triggers full test run in downstream workflow - changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} - repository: ROCm/TheRock - # Concrete SHA resolved once by setup; do not re-resolve main here. - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - permissions: - contents: read - id-token: write - - windows_build_and_test: - name: Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} - needs: [configure, setup] - if: >- - ${{ - needs.setup.outputs.windows_build_config != '' && - needs.setup.outputs.enable_build_jobs == 'true' - }} - uses: ROCm/TheRock/.github/workflows/multi_arch_ci_windows.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - secrets: inherit - with: - build_config: ${{ needs.setup.outputs.windows_build_config }} - test_labels: ${{ needs.setup.outputs.windows_test_labels }} - rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} - rocm_msi_package_version: ${{ needs.setup.outputs.rocm_msi_package_version }} - test_type: ${{ needs.configure.outputs.test_type }} - external_repo_config: ${{ needs.setup.outputs.external_repo_config }} - # Empty string when run_all_tests=true triggers full test run in downstream workflow - changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} - repository: ROCm/TheRock - # Concrete SHA resolved once by setup; do not re-resolve main here. - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - permissions: - contents: read - id-token: write - - rocjitsu_race_check: - name: rocjitsu race check (${{ matrix.amdgpu_families }}) - # A caller cannot depend on an individual job inside a reusable workflow, - # so start after the Linux workflow has finished publishing its artifacts. - # This sidecar remains advisory and is not part of the required summary. - needs: [ci-env, configure, linux_build_and_test] - strategy: - fail-fast: false - matrix: - include: - - amdgpu_families: gfx94X-dcgpu - amdgpu_targets: gfx942 - - amdgpu_families: gfx950-dcgpu - amdgpu_targets: gfx950 - if: >- - ${{ - !cancelled() && - github.event_name == 'pull_request' && - ( - contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt,') || - contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt/tensilelite,') || - contains(github.event.pull_request.labels.*.name, 'test:hipblaslt') - ) && - needs.linux_build_and_test.result != 'skipped' - }} - uses: ./.github/workflows/therock-rocjitsu-race-check-linux.yml - with: - therock_ref: ${{ needs.ci-env.outputs.therock-ref }} - build_runs_on: ${{ needs.ci-env.outputs.linux-runner }} - amdgpu_families: ${{ matrix.amdgpu_families }} - amdgpu_targets: ${{ matrix.amdgpu_targets }} - # TODO(newling): Add gfx1151 after validating a target-specific workload. - - notify_teams_on_failure: - name: Notify Teams Channel on Failure - # Build and test jobs run inside TheRock's reusable workflows, so - # notify_teams.py reports each failed Linux::/Windows:: job of this run - # from here, routing to the MIOpen / hipDNN channels by PR title tag - # ([miopen], [hipdnn], [miopenprovider]) or component name. - # Webhook secrets are unavailable to fork PRs. - needs: [configure, linux_build_and_test, windows_build_and_test] - # A notification problem must never fail the PR. - continue-on-error: true - if: >- - ${{ - always() && - !github.event.pull_request.head.repo.fork && - ( - needs.linux_build_and_test.result == 'failure' || - needs.windows_build_and_test.result == 'failure' - ) - }} - runs-on: ubuntu-24.04 - steps: - - name: Checkout notify script - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: .github/scripts/notify_teams.py - sparse-checkout-cone-mode: false - - - name: Notify Teams for failed build and test jobs - env: - GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ github.event.pull_request.number }} - PR_TITLE: ${{ github.event.pull_request.title }} - MIOPEN_WEBHOOK_URL: ${{ secrets.MIOPEN_CI_WEBHOOK_URL }} - HIPDNN_WEBHOOK_URL: ${{ secrets.HIPDNN_CI_WEBHOOK_URL }} - CHANGED_PROJECTS: ${{ needs.configure.outputs.changed_projects }} - run: | - python3 .github/scripts/notify_teams.py \ - --failed-jobs-from-run \ - --webhook-urls "{\"miopen\":\"${MIOPEN_WEBHOOK_URL}\",\"hipdnn\":\"${HIPDNN_WEBHOOK_URL}\"}" \ - --pr-number "${PR_NUMBER}" \ - --pr-title "${PR_TITLE}" \ - --component-name "${CHANGED_PROJECTS}" - - multi_arch_ci_summary: - name: Multi-Arch CI Summary - if: always() - needs: - - ci-env - - configure - - setup - - linux_build_and_test - - windows_build_and_test - runs-on: ubuntu-24.04 - steps: - - name: Checkout TheRock repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: "ROCm/TheRock" - # Concrete SHA resolved once by setup; do not re-resolve main here. - ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 - sparse-checkout: build_tools/github_actions - sparse-checkout-cone-mode: true - - - name: Evaluate workflow results - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - python build_tools/github_actions/workflow_summary.py \ - --needs-json '${{ toJSON(needs) }}' +# Copyright Advanced Micro Devices, Inc. +# SPDX-License-Identifier: MIT + +# Multi-Arch CI for rocm-libraries +# +# This workflow replicates TheRock's multi-arch CI pipeline by calling +# TheRock's reusable workflows directly. It provides sharded, multi-stage +# builds with per-architecture testing. +# +# - Uses TheRock's multi-arch sharded build pipeline (foundation -> compiler-runtime -> math-libs) +# - Supports prebuilt stages to skip certain build stages +# - Parallelizes across GPU architectures + +name: TheRock Multi-Arch CI + +# TheRock ref: pinned to ROCm/TheRock commit 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a. +# NOTE: update all `@` refs and `ref:` inputs together when switching. + +on: + push: + branches: + - develop + - release/therock-* + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + workflow_dispatch: + inputs: + linux_amdgpu_families: + type: string + description: "Comma-separated Linux GPU families to build and test, ex: gfx94X,gfx120X. Use 'none' to skip Linux or 'all' for every family." + default: "" + windows_amdgpu_families: + type: string + description: "Comma-separated Windows GPU families to build and test, ex: gfx110X,gfx120X. Use 'none' to skip Windows or 'all' for every family." + default: "" + pr_labels: + type: string + description: "Comma-separated PR labels (e.g. ci:skip-pytorch,test:rocprim,test_filter:quick). On pull_request events the labels come from the event payload instead." + default: "" + prebuilt_stages: + type: string + default: "" + description: "Comma-separated build stages to skip (or 'all' for all stages); artifacts are copied from baseline_run_id instead" + baseline_run_id: + type: string + default: "" + description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set" + baseline_repository: + type: string + default: "" + description: "Repository to query for baseline_run_id. Defaults to github.repository for workflow_dispatch." + build_python_packages: + type: boolean + default: false + description: "Build ROCm Python packages" + build_pytorch: + type: boolean + default: false + description: "Build PyTorch wheels" + build_jax: + type: boolean + default: false + description: "Build JAX wheels" + build_native_linux: + type: boolean + default: false + description: "Build native Linux packages and run install tests" +permissions: + contents: read + actions: read + +concurrency: + # A PR number if a pull request and otherwise the commit hash. This cancels + # queued and in-progress runs for the same PR (presubmit) or commit + # (postsubmit). The workflow name is prepended to avoid conflicts between + # different workflows. + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + +jobs: + ci-env: + name: Load CI Environment + runs-on: ubuntu-24.04 + outputs: + # Use the manually supplied or bot-maintained baseline. An empty value + # causes artifact reuse to be disabled and triggers a full stage build. + baseline-run-id: ${{ inputs.baseline_run_id || steps.ci-env.outputs.baseline-run-id }} + linux-runner: ${{ steps.ci-env.outputs.linux-runner }} + therock-ref: ${{ steps.ci-env.outputs.therock-ref }} + steps: + - name: Checkout ci-env action + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: .github/actions/ci-env + sparse-checkout-cone-mode: true + + - name: Load CI environment + id: ci-env + uses: ./.github/actions/ci-env + + configure: + name: Configure Changed Projects + runs-on: ubuntu-24.04 + outputs: + changed_projects: ${{ steps.configure.outputs.changed_projects }} + # TheRock's determine_rocm_test_dependencies.py natively resolves + # shared/* monorepo subtrees (shared/stinkytofu, shared/tensile, + # shared/origami, shared/mxdatagenerator, shared/rocroller) into the + # right consumer set, so changed_projects is passed straight through + # as test_projects without a rocm-libraries-side translation step. + # See ROCm/rocm-libraries#11784 for the retired stopgap this replaces. + test_projects: ${{ steps.configure.outputs.changed_projects }} + run_all_tests: ${{ steps.configure.outputs.run_all_tests }} + test_type: ${{ steps.configure.outputs.test_type }} + steps: + - name: Checkout repository config + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: | + .github/repos-config.json + sparse-checkout-cone-mode: false + + - name: Checkout TheRock for configure script + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: ROCm/TheRock + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + path: _therock + sparse-checkout: build_tools/github_actions + sparse-checkout-cone-mode: true + + - name: Configure CI + id: configure + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + python3 _therock/build_tools/github_actions/configure_external_repo_ci.py \ + --event-name "${{ github.event_name }}" \ + --github-repo "${{ github.repository }}" \ + --base-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}" \ + --head-sha "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" \ + --config-path ".github/repos-config.json" + + setup: + needs: [ci-env, configure] + uses: ROCm/TheRock/.github/workflows/setup_multi_arch.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + with: + build_variant: "release" + # Limit GPU families for rocm-libraries CI. + # gfx125X (CDNA5/gfx1250) is included build-only on every PR/push: no test + # hardware exists for it yet (see amdgpu_family_matrix.py in TheRock, family + # key "gfx125x": test-runs-on is empty everywhere), but legacy therock-ci.yml + # built it on every PR/push before Multi-Arch CI became the default, and this + # restores that parity so gfx1250 build breaks are caught same-PR instead of + # only nightly. + # + # An empty input means "not specified" here and falls back to these + # defaults, including on workflow_dispatch. To skip a platform entirely, + # pass 'none', which setup_multi_arch.yml resolves to an empty build + # config. + linux_amdgpu_families: ${{ inputs.linux_amdgpu_families || 'gfx94X,gfx950,gfx125X' }} + windows_amdgpu_families: ${{ inputs.windows_amdgpu_families || 'gfx110X' }} + pr_labels: ${{ inputs.pr_labels || '' }} + # Copy all stages except math-libs and ml-libs from TheRock baseline + # rocm-libraries only affects math-libs and ml-libs source sets + # RPP owns cv-libs, so rebuild that stage when projects/rpp changes. + # Note: compiler-runtime excluded due to hardcoded CMake paths (fftw3, etc.) + # Copy prebuilt stages only when the resolved reuse policy provides a + # baseline run ID. Otherwise, leave this empty for a full stage build. + prebuilt_stages: ${{ needs.ci-env.outputs.baseline-run-id != '' && (inputs.prebuilt_stages || (contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/rpp,') && 'runtime-tests,comm-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg' || 'runtime-tests,comm-libs,cv-libs,storage-libs,debug-tools,dctools-core,profiler-apps,media-libs,wsl-rocdxg')) || '' }} + # Use the baseline selected by the artifact reuse policy above. + baseline_run_id: ${{ needs.ci-env.outputs.baseline-run-id }} + baseline_repository: ${{ inputs.baseline_repository || (inputs.baseline_run_id != '' && github.repository) || '' }} + build_python_packages: ${{ inputs.build_python_packages || false }} + build_pytorch: ${{ inputs.build_pytorch || false }} + build_jax: ${{ inputs.build_jax || false }} + # Preserve manual workflow_dispatch control and enable native package + # builds for pull requests carrying the opt-in label. + build_native_linux: ${{ inputs.build_native_linux || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:native-linux-packages')) }} + # A missing baseline disables artifact reuse and causes TheRock to + # perform a full stage build. + stage_reuse_mode: >- + ${{ + needs.ci-env.outputs.baseline-run-id != '' && + 'reuse-stage' || + 'off' + }} + repository: ROCm/TheRock + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + # Pass external repo info for stage-impact analysis. + # extra_cmake_options is appended to the cmake configure line of every + # build stage, scoped to this repository's CI runs. TheRock keeps + # HIPKERNELPROVIDER_ENABLE_ROCKE OFF by default; enabling it here is what + # gives rocKE build and test signal while it is still in development. + # Keep the value constant: the flag state file participates in every + # subproject's configure fingerprint, and stage reuse does not key on + # flags (TheRock#3399), so a per-PR value would churn fingerprints and + # let baselines built with the opposite value look reusable. + external_repo: >- + { + "repository": "${{ github.repository }}", + "ref": "${{ github.sha }}", + "base_sha": "${{ github.event.pull_request.base.sha || github.event.before }}", + "head_sha": "${{ github.sha }}", + "pr_number": ${{ github.event.pull_request.number || 'null' }}, + "event_name": "${{ github.event_name }}", + "skip_ci_config": ".github/skip-ci-config.toml", + "extra_cmake_options": "-DTHEROCK_FLAG_HIPKERNELPROVIDER_ENABLE_ROCKE=ON" + } + + linux_build_and_test: + name: Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} + needs: [configure, setup] + if: >- + ${{ + needs.setup.outputs.linux_build_config != '' && + needs.setup.outputs.enable_build_jobs == 'true' + }} + uses: ROCm/TheRock/.github/workflows/multi_arch_ci_linux.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + secrets: inherit + with: + build_config: ${{ needs.setup.outputs.linux_build_config }} + test_labels: ${{ needs.setup.outputs.linux_test_labels }} + rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} + rocm_deb_package_version: ${{ needs.setup.outputs.rocm_deb_package_version }} + rocm_rpm_package_version: ${{ needs.setup.outputs.rocm_rpm_package_version }} + test_type: ${{ needs.configure.outputs.test_type }} + external_repo_config: ${{ needs.setup.outputs.external_repo_config }} + # Empty string when run_all_tests=true triggers full test run in downstream workflow + changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} + repository: ROCm/TheRock + # Concrete SHA resolved once by setup; do not re-resolve main here. + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + permissions: + contents: read + id-token: write + + windows_build_and_test: + name: Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} + needs: [configure, setup] + if: >- + ${{ + needs.setup.outputs.windows_build_config != '' && + needs.setup.outputs.enable_build_jobs == 'true' + }} + uses: ROCm/TheRock/.github/workflows/multi_arch_ci_windows.yml@7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + secrets: inherit + with: + build_config: ${{ needs.setup.outputs.windows_build_config }} + test_labels: ${{ needs.setup.outputs.windows_test_labels }} + rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }} + rocm_msi_package_version: ${{ needs.setup.outputs.rocm_msi_package_version }} + test_type: ${{ needs.configure.outputs.test_type }} + external_repo_config: ${{ needs.setup.outputs.external_repo_config }} + # Empty string when run_all_tests=true triggers full test run in downstream workflow + changed_projects: ${{ needs.configure.outputs.run_all_tests == 'true' && '' || needs.configure.outputs.test_projects }} + repository: ROCm/TheRock + # Concrete SHA resolved once by setup; do not re-resolve main here. + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + permissions: + contents: read + id-token: write + + rocjitsu_race_check: + name: rocjitsu race check (${{ matrix.amdgpu_families }}) + # A caller cannot depend on an individual job inside a reusable workflow, + # so start after the Linux workflow has finished publishing its artifacts. + # This sidecar remains advisory and is not part of the required summary. + needs: [ci-env, configure, linux_build_and_test] + strategy: + fail-fast: false + matrix: + include: + - amdgpu_families: gfx94X-dcgpu + amdgpu_targets: gfx942 + - amdgpu_families: gfx950-dcgpu + amdgpu_targets: gfx950 + if: >- + ${{ + !cancelled() && + github.event_name == 'pull_request' && + ( + contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt,') || + contains(format(',{0},', needs.configure.outputs.changed_projects), ',projects/hipblaslt/tensilelite,') || + contains(github.event.pull_request.labels.*.name, 'test:hipblaslt') + ) && + needs.linux_build_and_test.result != 'skipped' + }} + uses: ./.github/workflows/therock-rocjitsu-race-check-linux.yml + with: + therock_ref: ${{ needs.ci-env.outputs.therock-ref }} + build_runs_on: ${{ needs.ci-env.outputs.linux-runner }} + amdgpu_families: ${{ matrix.amdgpu_families }} + amdgpu_targets: ${{ matrix.amdgpu_targets }} + # TODO(newling): Add gfx1151 after validating a target-specific workload. + + notify_teams_on_failure: + name: Notify Teams Channel on Failure + # Build and test jobs run inside TheRock's reusable workflows, so + # notify_teams.py reports each failed Linux::/Windows:: job of this run + # from here, routing to the MIOpen / hipDNN channels by PR title tag + # ([miopen], [hipdnn], [miopenprovider]) or component name. + # Webhook secrets are unavailable to fork PRs. + needs: [configure, linux_build_and_test, windows_build_and_test] + # A notification problem must never fail the PR. + continue-on-error: true + if: >- + ${{ + always() && + !github.event.pull_request.head.repo.fork && + ( + needs.linux_build_and_test.result == 'failure' || + needs.windows_build_and_test.result == 'failure' + ) + }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout notify script + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout: .github/scripts/notify_teams.py + sparse-checkout-cone-mode: false + + - name: Notify Teams for failed build and test jobs + env: + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + PR_TITLE: ${{ github.event.pull_request.title }} + MIOPEN_WEBHOOK_URL: ${{ secrets.MIOPEN_CI_WEBHOOK_URL }} + HIPDNN_WEBHOOK_URL: ${{ secrets.HIPDNN_CI_WEBHOOK_URL }} + CHANGED_PROJECTS: ${{ needs.configure.outputs.changed_projects }} + run: | + python3 .github/scripts/notify_teams.py \ + --failed-jobs-from-run \ + --webhook-urls "{\"miopen\":\"${MIOPEN_WEBHOOK_URL}\",\"hipdnn\":\"${HIPDNN_WEBHOOK_URL}\"}" \ + --pr-number "${PR_NUMBER}" \ + --pr-title "${PR_TITLE}" \ + --component-name "${CHANGED_PROJECTS}" + + multi_arch_ci_summary: + name: Multi-Arch CI Summary + if: always() + needs: + - ci-env + - configure + - setup + - linux_build_and_test + - windows_build_and_test + runs-on: ubuntu-24.04 + steps: + - name: Checkout TheRock repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: "ROCm/TheRock" + # Concrete SHA resolved once by setup; do not re-resolve main here. + ref: 7bab0a89ed8bb5a9ad3b0421a3586ffe9ff1439a # 2026-10-26 + sparse-checkout: build_tools/github_actions + sparse-checkout-cone-mode: true + + - name: Evaluate workflow results + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + python build_tools/github_actions/workflow_summary.py \ + --needs-json '${{ toJSON(needs) }}'