Skip to content

Commit 410fcd8

Browse files
zichguan-amdclaude
andauthored
ci: add ROCm version and CK inputs to the TheRock workflow dispatch (#567)
## Motivation Build ROCm Examples (`ci_therock.yml`) and Nightly CI (`ci_nightly.yml`) can only be dispatched against the latest TheRock nightly, and they never build the Composable Kernel examples: the tarball and wheel setups leave `ENABLE_CK` unset and the preinstalled one sets it to `OFF`. The only workflow that builds CK, Build Libraries, is pinned to the ROCm 10.1 image. So a CK change cannot be checked in CI against a specific ROCm, e.g. a release candidate. #565 (CK sync with 10.2.0rc0) is an example: its Build Libraries run compiles the 10.2 examples against 10.1's CK and fails for that reason alone. ## Technical Details - **`build-rocm-examples-reusable.yml`** - New `enable_ck` input (boolean, default `false`). A new "Set CK build flag" step writes `ENABLE_CK=ON|OFF` for every install method, replacing the hard-coded `ENABLE_CK=OFF` of the preinstalled setup. - `rocm_version` already pins a nightly (Quartz uses it). An rc version such as `10.2.0rc0`, without an explicit `wheels_url`/`tarballs_url`, now installs from the release candidate index (`https://rc.repo.amd.com/rocm/core/tarball/`, `https://rc.repo.amd.com/rocm/core/whl-next/`) instead of the nightly one. - **`ci_therock.yml`, `ci_nightly.yml`**: new `rocm_version` (string, empty = latest nightly) and `enable_ck` (boolean) dispatch inputs, passed to the reusable workflow. With a `rocm_version`, `configure_ci.py` gets `--exclude-preinstalled`, as in `quartz_test.yml`, because the `stable_release` image cannot install another ROCm. Push, pull_request, schedule and Quartz runs pass neither input and are unchanged. **Note:** TheRock's Python wheels currently do not include Composable Kernel. The 10.2.0rc0 `rocm-sdk-devel` wheel has no `ck`/`ck_tile` headers and no `composable_kernel` CMake package, and the `rocm` meta-package has no other component that provides it. With `install_method=whl-multi-arch`, `enable_ck=true` turns the flag on, but `Libraries/ComposableKernel` skips itself ("Composable Kernel could not be found"). To build CK, use `install_method=tarball-multi-arch`; the tarballs ship CK. Example, for a CK branch that contains this change: ``` gh workflow run ci_therock.yml --ref <branch> \ -f rocm_version=10.2.0rc0 -f enable_ck=true \ -f install_method=tarball-multi-arch -f distro=ubuntu-24.04 -f gpu_config=gfx1100 ``` ## Test Plan - Dispatch of Build ROCm Examples on this branch with `rocm_version=10.2.0rc0`, `enable_ck=true`, gfx1100, Ubuntu 24.04, both install methods: [run 41123640840](https://github.com/ROCm/rocm-examples/actions/runs/41123640840). - pre-commit (including the GitHub Actions workflow lint) and zizmor on the three workflows. ## Test Result - **whl-multi-arch:** passed. It installed `rocm==10.2.0rc0` from `https://rc.repo.amd.com/rocm/core/whl-next/`, set `ROCM_EXAMPLES_ENABLE_CK=ON`, and ctest passed 371/371. As expected without CK in the wheels (see the note above), `Libraries/ComposableKernel` reported "Composable Kernel could not be found" and built nothing. - **tarball-multi-arch:** queued at the time of writing (waiting for a gfx1100 runner). On this branch the CK examples are still `amd-staging`'s, which do not compile against 10.2.0rc0's CK (#552, #565), so this job is expected to fail in the CK build; what it shows is that the rc tarball installs and the CK examples are configured. - **Checks:** pre-commit passes. zizmor reports the same findings before and after the change (36, none new). ## Added/Updated documentation? <!-- Make sure each new example has a README and the root-level README contains all new examples. --> <!-- New Libraries examples should have a library-level README explaining the dependencies, build process, and supported platforms. --> - [ ] Yes - [x] No, does not apply to this PR. ## Included Visual Studio files? - [ ] Yes - [x] No, does not apply to this PR. ## Submission Checklist - [ ] New examples contain proper CMake and Make files. - [x] I have updated relevant CI workflows and the new examples are being built and tested in CI. - [ ] Check and guard against unsupported ASICs if relevant dependent libraries have limited support. - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 88fa5b0 commit 410fcd8

3 files changed

Lines changed: 58 additions & 10 deletions

File tree

‎.github/workflows/build-rocm-examples-reusable.yml‎

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,25 @@ on:
2020
required: true
2121
type: string
2222
rocm_version:
23-
description: "Exact ROCm nightly version to install (e.g. 10.1.0a20260821). Empty = latest on the index."
23+
description: "Exact ROCm version to install: a nightly (e.g. 10.1.0a20260821) or a release candidate (e.g. 10.2.0rc0). Empty = latest nightly on the index."
2424
required: false
2525
type: string
2626
default: ""
2727
wheels_url:
28-
description: "Wheel index URL (from Quartz summary.linux.urls.wheels). Empty = default nightly index."
28+
description: "Wheel index URL (from Quartz summary.linux.urls.wheels). Empty = default nightly index, or the release candidate index for an rc rocm_version."
2929
required: false
3030
type: string
3131
default: ""
3232
tarballs_url:
33-
description: "Tarball base URL (from Quartz summary.linux.urls.tarballs). Empty = default nightly base."
33+
description: "Tarball base URL (from Quartz summary.linux.urls.tarballs). Empty = default nightly base, or the release candidate base for an rc rocm_version."
3434
required: false
3535
type: string
3636
default: ""
37+
enable_ck:
38+
description: "Build and test the Composable Kernel examples (ROCM_EXAMPLES_ENABLE_CK)."
39+
required: false
40+
type: boolean
41+
default: false
3742
env:
3843
DEBIAN_FRONTEND: noninteractive
3944

@@ -82,10 +87,14 @@ jobs:
8287
PKG="${PKG}==${ROCM_VERSION}"
8388
fi
8489
# Prefer the index Quartz published for this build; fall back to the
85-
# current default nightly index for non-Quartz callers.
90+
# release candidate index for an rc version (e.g. 10.2.0rc0) and to the
91+
# current default nightly index otherwise.
8692
INDEX_URL="$WHEELS_URL"
8793
if [ -z "$INDEX_URL" ]; then
88-
INDEX_URL="https://nightly.repo.amd.com/rocm/whl-next/"
94+
case "$ROCM_VERSION" in
95+
*rc*) INDEX_URL="https://rc.repo.amd.com/rocm/core/whl-next/" ;;
96+
*) INDEX_URL="https://nightly.repo.amd.com/rocm/whl-next/" ;;
97+
esac
8998
fi
9099
pip install --no-cache-dir \
91100
--index-url "$INDEX_URL" \
@@ -114,10 +123,14 @@ jobs:
114123
TARBALLS_URL: ${{ inputs.tarballs_url }}
115124
run: |
116125
# Prefer the tarball base Quartz published for this build; fall back to
117-
# the current default nightly base for non-Quartz callers.
126+
# the release candidate base for an rc version (e.g. 10.2.0rc0) and to
127+
# the current default nightly base otherwise.
118128
TARBALL_BASE="$TARBALLS_URL"
119129
if [ -z "$TARBALL_BASE" ]; then
120-
TARBALL_BASE="https://nightly.repo.amd.com/rocm/core/tarball/"
130+
case "$ROCM_VERSION" in
131+
*rc*) TARBALL_BASE="https://rc.repo.amd.com/rocm/core/tarball/" ;;
132+
*) TARBALL_BASE="https://nightly.repo.amd.com/rocm/core/tarball/" ;;
133+
esac
121134
fi
122135
TARBALL_BASE="${TARBALL_BASE%/}/"
123136
# Pin to the exact nightly when a caller (e.g. the Quartz workflow) requests one;
@@ -167,9 +180,16 @@ jobs:
167180
echo "HIP_PATH=${ROCM_PATH}" >> $GITHUB_ENV
168181
echo "HIP_PLATFORM=amd" >> $GITHUB_ENV
169182
echo "ENABLE_OPENMP=ON" >> $GITHUB_ENV
170-
echo "ENABLE_CK=OFF" >> $GITHUB_ENV
171183
echo "HIPCC_COMPILE_FLAGS_APPEND=--offload-arch=${{ matrix.gpu_config.gpu_target }}" >> $GITHUB_ENV
172184
185+
- name: Set CK build flag
186+
id: ck-flag
187+
env:
188+
CK_FLAG: ${{ inputs.enable_ck && 'ON' || 'OFF' }}
189+
run: |
190+
echo "ENABLE_CK=${CK_FLAG}" >> $GITHUB_ENV
191+
echo "ROCM_EXAMPLES_ENABLE_CK=${CK_FLAG}"
192+
173193
- name: Environment status check
174194
id: environment-status
175195
if: always()

‎.github/workflows/ci_nightly.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ on:
4040
- sles-15.7
4141
- almalinux-8
4242
- stable_release
43+
rocm_version:
44+
description: "ROCm version to install: a nightly (e.g. 10.3.0a20261030) or a release candidate (e.g. 10.2.0rc0). Empty = latest nightly. Skips the stable_release image."
45+
required: false
46+
default: ""
47+
type: string
48+
enable_ck:
49+
description: "Build and test the Composable Kernel examples"
50+
required: false
51+
default: false
52+
type: boolean
4353
permissions:
4454
contents: read
4555
packages: read
@@ -72,7 +82,9 @@ jobs:
7282
GPU_CONFIG: ${{ github.event.inputs.gpu_config }}
7383
INSTALL_METHOD: ${{ github.event.inputs.install_method }}
7484
DISTRO: ${{ github.event.inputs.distro }}
75-
run: python3 .github/build_tools/configure_ci.py
85+
ROCM_VERSION: ${{ github.event.inputs.rocm_version }}
86+
# The stable_release image ships its own ROCm, so it cannot install a requested version.
87+
run: python3 .github/build_tools/configure_ci.py ${ROCM_VERSION:+--exclude-preinstalled}
7688

7789
build:
7890
needs: [setup]
@@ -86,3 +98,5 @@ jobs:
8698
distro_map: ${{ needs.setup.outputs.distro_map }}
8799
gpu_configs: ${{ needs.setup.outputs.gpu_configs }}
88100
install_methods: ${{ needs.setup.outputs.install_methods }}
101+
rocm_version: ${{ github.event.inputs.rocm_version }}
102+
enable_ck: ${{ github.event.inputs.enable_ck == 'true' }}

‎.github/workflows/ci_therock.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ on:
6464
- ubuntu-26.04
6565
- sles-15.7
6666
- almalinux-8
67+
rocm_version:
68+
description: "ROCm version to install: a nightly (e.g. 10.3.0a20261030) or a release candidate (e.g. 10.2.0rc0). Empty = latest nightly. Skips the stable_release image."
69+
required: false
70+
default: ""
71+
type: string
72+
enable_ck:
73+
description: "Build and test the Composable Kernel examples"
74+
required: false
75+
default: false
76+
type: boolean
6777
permissions:
6878
contents: read
6979
packages: read
@@ -96,7 +106,9 @@ jobs:
96106
GPU_CONFIG: ${{ github.event.inputs.gpu_config || 'all' }}
97107
INSTALL_METHOD: ${{ github.event.inputs.install_method || 'all' }}
98108
DISTRO: ${{ github.event.inputs.distro || 'ubuntu-24.04' }}
99-
run: python3 .github/build_tools/configure_ci.py
109+
ROCM_VERSION: ${{ github.event.inputs.rocm_version }}
110+
# The stable_release image ships its own ROCm, so it cannot install a requested version.
111+
run: python3 .github/build_tools/configure_ci.py ${ROCM_VERSION:+--exclude-preinstalled}
100112

101113
build:
102114
needs: [setup]
@@ -110,3 +122,5 @@ jobs:
110122
distro_map: ${{ needs.setup.outputs.distro_map }}
111123
gpu_configs: ${{ needs.setup.outputs.gpu_configs }}
112124
install_methods: ${{ needs.setup.outputs.install_methods }}
125+
rocm_version: ${{ github.event.inputs.rocm_version }}
126+
enable_ck: ${{ github.event.inputs.enable_ck == 'true' }}

0 commit comments

Comments
 (0)