Skip to content

Commit f61cabb

Browse files
geomin12claude
andauthored
[ci] convert ci_asan.yml to multi-arch (#4415)
Converting `ci_asan.yml` to multi-arch Test ran successfully (failure is known) here: https://github.com/ROCm/TheRock/actions/runs/24157932330/job/70501692876 - the `aqlprofile` failure works with rebase, but that isn't relevant to this PR Correct cmake flags here: https://github.com/ROCm/TheRock/actions/runs/24157932330/job/70501765754#step:12:1 Correct runner being selected here: https://github.com/ROCm/TheRock/actions/runs/24157932330/job/70501692876#step:3:58 After this lands, we can add host asan to postsubmit The intent of `contains(inputs.build_variant_cmake_preset, 'san')` is to enable heavy runners for asan, tsan and ubsan! --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6afe787 commit f61cabb

5 files changed

Lines changed: 113 additions & 4 deletions

File tree

.github/workflows/ci_asan.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Copyright Advanced Micro Devices, Inc.
22
# SPDX-License-Identifier: MIT
33

4+
# Keeping this workflow for legacy reasons, but will be removed after legacy TheRock CI is retired
5+
46
name: CI ASAN
57

68
on:
7-
schedule:
8-
# Runs at 02:00 AM UTC, which is 7:00 PM PST (UTC-8)
9-
- cron: '0 02 * * *'
109
workflow_dispatch:
1110
inputs:
1211
linux_amdgpu_families:

.github/workflows/multi_arch_build_portable_linux.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
timeout_minutes: 180 # 3 hours
7070
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
7171
rocm_package_version: ${{ inputs.rocm_package_version }}
72+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
7273
release_type: ${{ inputs.release_type }}
7374
permissions:
7475
contents: read
@@ -88,6 +89,7 @@ jobs:
8889
timeout_minutes: 480 # 8 hours (compiler is big)
8990
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
9091
rocm_package_version: ${{ inputs.rocm_package_version }}
92+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
9193
release_type: ${{ inputs.release_type }}
9294
permissions:
9395
contents: read
@@ -112,6 +114,7 @@ jobs:
112114
amdgpu_family: ${{ matrix.family_info.amdgpu_family }}
113115
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
114116
rocm_package_version: ${{ inputs.rocm_package_version }}
117+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
115118
release_type: ${{ inputs.release_type }}
116119
permissions:
117120
contents: read
@@ -136,6 +139,7 @@ jobs:
136139
amdgpu_family: ${{ matrix.family_info.amdgpu_family }}
137140
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
138141
rocm_package_version: ${{ inputs.rocm_package_version }}
142+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
139143
release_type: ${{ inputs.release_type }}
140144
permissions:
141145
contents: read
@@ -155,6 +159,7 @@ jobs:
155159
timeout_minutes: 180 # 3 hours
156160
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
157161
rocm_package_version: ${{ inputs.rocm_package_version }}
162+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
158163
release_type: ${{ inputs.release_type }}
159164
permissions:
160165
contents: read
@@ -174,6 +179,7 @@ jobs:
174179
timeout_minutes: 120 # 2 hours
175180
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
176181
rocm_package_version: ${{ inputs.rocm_package_version }}
182+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
177183
release_type: ${{ inputs.release_type }}
178184
permissions:
179185
contents: read
@@ -193,6 +199,7 @@ jobs:
193199
timeout_minutes: 180 # 3 hours
194200
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
195201
rocm_package_version: ${{ inputs.rocm_package_version }}
202+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
196203
release_type: ${{ inputs.release_type }}
197204
permissions:
198205
contents: read
@@ -212,6 +219,7 @@ jobs:
212219
timeout_minutes: 90 # 1.5 hours - iree is not _yet_ building with a common llvm, it includes its own.
213220
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
214221
rocm_package_version: ${{ inputs.rocm_package_version }}
222+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
215223
release_type: ${{ inputs.release_type }}
216224
permissions:
217225
contents: read
@@ -231,6 +239,7 @@ jobs:
231239
timeout_minutes: 60 # 1 hour
232240
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
233241
rocm_package_version: ${{ inputs.rocm_package_version }}
242+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
234243
release_type: ${{ inputs.release_type }}
235244
permissions:
236245
contents: read
@@ -250,6 +259,7 @@ jobs:
250259
timeout_minutes: 180 # 3 hours
251260
dist_amdgpu_families: ${{ inputs.dist_amdgpu_families }}
252261
rocm_package_version: ${{ inputs.rocm_package_version }}
262+
build_variant_cmake_preset: ${{ inputs.build_variant_cmake_preset }}
253263
release_type: ${{ inputs.release_type }}
254264
permissions:
255265
contents: read

.github/workflows/multi_arch_build_portable_linux_artifacts.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ on:
4444
type: string
4545
required: true
4646
description: "ROCm package version string"
47+
build_variant_cmake_preset:
48+
type: string
49+
required: false
50+
default: ""
51+
description: "CMake preset name for this build variant (optional)"
4752
release_type:
4853
description: 'Release type: "" for CI, or "dev", "nightly", "prerelease". Controls artifact bucket and IAM role.'
4954
type: string
@@ -52,7 +57,7 @@ on:
5257
jobs:
5358
build_stage:
5459
name: ${{ inputs.stage_display_name }}
55-
runs-on: azure-linux-scale-rocm
60+
runs-on: ${{ contains(inputs.build_variant_cmake_preset, 'san') && 'azure-linux-scale-rocm-heavy-ramdisk' || 'azure-linux-scale-rocm' }}
5661
timeout-minutes: ${{ inputs.timeout_minutes }}
5762
permissions:
5863
id-token: write
@@ -127,6 +132,7 @@ jobs:
127132
-DTHEROCK_PACKAGE_VERSION=${{ inputs.rocm_package_version }} \
128133
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
129134
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
135+
${{ inputs.build_variant_cmake_preset && format('--preset={0}', inputs.build_variant_cmake_preset) }} \
130136
${{ steps.stage_config.outputs.cmake_args }}
131137
132138
- name: Build stage
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright Advanced Micro Devices, Inc.
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Multi-Arch CI ASAN
5+
6+
on:
7+
schedule:
8+
# Runs at 02:00 AM UTC, which is 7:00 PM PST (UTC-8)
9+
- cron: '0 02 * * *'
10+
workflow_dispatch:
11+
inputs:
12+
linux_amdgpu_families:
13+
type: string
14+
description: "Insert comma-separated list of Linux GPU families to build and test. ex: gfx94X, gfx120X"
15+
default: ""
16+
linux_test_labels:
17+
type: string
18+
description: "If enabled, reduce test set on Linux to the list of labels prefixed with 'test:'. ex: test:rocprim, test:hipcub"
19+
default: ""
20+
prebuilt_stages:
21+
type: string
22+
default: ""
23+
description: "Comma-separated build stages to skip (or 'all' for all stages); artifacts are copied from baseline_run_id instead"
24+
baseline_run_id:
25+
type: string
26+
default: ""
27+
description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set"
28+
29+
permissions:
30+
contents: read
31+
32+
concurrency:
33+
# A PR number if a pull request and otherwise the commit hash. This cancels
34+
# queued and in-progress runs for the same PR (presubmit) or commit
35+
# (postsubmit). The workflow name is prepended to avoid conflicts between
36+
# different workflows.
37+
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
38+
cancel-in-progress: true
39+
40+
jobs:
41+
setup:
42+
uses: ./.github/workflows/setup_multi_arch.yml
43+
with:
44+
build_variant: "asan"
45+
46+
linux_build_and_test:
47+
name: Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }}
48+
needs: setup
49+
if: >-
50+
${{
51+
needs.setup.outputs.linux_build_config != '' &&
52+
needs.setup.outputs.enable_build_jobs == 'true'
53+
}}
54+
uses: ./.github/workflows/multi_arch_ci_linux.yml
55+
secrets: inherit
56+
with:
57+
build_config: ${{ needs.setup.outputs.linux_build_config }}
58+
test_labels: ${{ needs.setup.outputs.linux_test_labels }}
59+
rocm_package_version: ${{ needs.setup.outputs.rocm_package_version }}
60+
test_type: ${{ needs.setup.outputs.test_type }}
61+
permissions:
62+
contents: read
63+
id-token: write
64+
65+
ci_summary:
66+
name: CI Summary
67+
if: always()
68+
needs:
69+
- setup
70+
- linux_build_and_test
71+
runs-on: ubuntu-24.04
72+
steps:
73+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
74+
- name: Evaluate workflow results
75+
env:
76+
GITHUB_TOKEN: ${{ github.token }}
77+
run: |
78+
python build_tools/github_actions/workflow_summary.py \
79+
--workflow-name="${{ github.workflow }}" \
80+
--run-id="${{ github.run_id }}" \
81+
--run-attempt="${{ github.run_attempt }}"

build_tools/github_actions/configure_multi_arch_ci.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,19 @@ def _expand_build_config_for_platform(
829829
f"runner available, disabling tests"
830830
)
831831

832+
# TODO(#3433): Remove sandbox logic once ASAN tests are passing
833+
# For ASAN builds, use sandbox runner to avoid impacting production
834+
if build_variant == "asan":
835+
if "test-runs-on-sandbox" in platform_info:
836+
test_runs_on = platform_info["test-runs-on-sandbox"]
837+
print(f" {family_name}: using ASAN sandbox runner: {test_runs_on}")
838+
else:
839+
test_runs_on = ""
840+
print(
841+
f" {family_name}: no ASAN sandbox runner available, "
842+
f"disabling tests"
843+
)
844+
832845
per_family_info.append(
833846
{
834847
"amdgpu_family": platform_info["family"],

0 commit comments

Comments
 (0)