-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
341 lines (308 loc) · 11.5 KB
/
.gitlab-ci.yml
File metadata and controls
341 lines (308 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# this include allows us to reference defaults in anl/ci-resource/defaults
include:
- project: 'anl/ci-resources/defaults'
ref: main
file:
- '/runners.yml'
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "trigger" # triggered from GitHub via /run-aurora-ci
variables:
PROJ: "chipStar_test"
QUEUE: "debug"
TIME: "1:00:00"
WRK_DIR: "/lus/flare/projects/${PROJ}/chipStar/pipeline_${CI_PIPELINE_ID}"
ANL_AURORA_SCHEDULER_PARAMETERS: "-q ${QUEUE} -l select=1,walltime=${TIME},filesystems=home -A ${PROJ}"
GENESIS_CI_PROJECT_DIR: "/home/bertoni/projects/p01.chipStar/GENESIS-Share-CI/"
stages:
- .pre
- build_chipstar
- builds_chipstar_install_script_llvm19
- runs_tests_chipstar_install_script_llvm19
- builds_chipstar_install_script_llvm22
- runs_tests_chipstar_install_script_llvm22
- builds_chipstar_aurora_script_llvm19
- runs_chipstar_aurora_script_llvm19
- builds_chipstar_aurora_script_llvm22
- runs_chipstar_aurora_script_llvm22
- builds_hoMusic
- runs_hoMusic
- performance_hoMusic
- builds_zeroRK
- runs_zeroRK
- perforamce_zeroRK
- cleanup
setup:
stage: .pre
extends: .aurora-shell-runner
resource_group: aurora_pipeline
script:
# Remove pipeline directories older than 7 days
- find /lus/flare/projects/${PROJ}/chipStar -maxdepth 1 -name "pipeline_*" -mtime +7 -exec rm -rf {} \;
- mkdir -p ${WRK_DIR}
- cd ${WRK_DIR}
# setup chipStar
- git clone https://github.com/CHIP-SPV/chipStar.git
- cd chipStar
- |
if [ -n "${GITHUB_PR_NUMBER}" ]; then
git fetch origin pull/${GITHUB_PR_NUMBER}/head
git checkout FETCH_HEAD
else
git checkout ${GITHUB_SHA}
fi
- git submodule update --init --recursive
- module list
# testing with hand script
aurora_build_test:
stage: build_chipstar
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cd ${WRK_DIR}/chipStar
# first test with already installed clang. will update to patch and build
- module use /soft/modulefiles
- module load cmake chipStar/.llvm19/20251107-19/release
- rm -rf build
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DCHIP_BUILD_SAMPLES=ON -DCMAKE_INSTALL_PREFIX=${WRK_DIR}/install_aurora ..
- gitcommit=$(git rev-parse HEAD)
- make -j48
- make install
- cd ..
- rm -rf build
# testing with install script
chipStar_script_install:
stage: builds_chipstar_install_script_llvm19
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/chipStar_llvm19
- cd ${WRK_DIR}/chipStar_llvm19
- module use /soft/modulefiles
- module load cmake chipStar/.llvm19/20251107-19/release
- ./install_chipstar.py --all --install-dir ${WRK_DIR}/install/ --staging-dir $PWD/stage
allow_failure: true
chipStar_script_test:
stage: runs_tests_chipstar_install_script_llvm19
resource_group: aurora_pipeline
extends: .aurora-batch-runner
script:
- cd ${WRK_DIR}/chipStar_llvm19/build
- module use /soft/modulefiles
- module load cmake chipStar/.llvm19/20251107-19/release
- rm -rf $HOME/.cache/chipStar
- CHIP_BE=level0 make build_tests -j
- CHIP_MODULE_CACHE_DIR="" ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
allow_failure: true
chipStar_script_install_llvm22:
stage: builds_chipstar_install_script_llvm22
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/chipStar_llvm22
- cd ${WRK_DIR}/chipStar_llvm22
- module use /soft/modulefiles
- module load cmake chipStar/.llvm22/20260311-22/release
- ./install_chipstar.py --all --install-dir ${WRK_DIR}/install/ --staging-dir $PWD/stage
allow_failure: true
chipStar_script_test_llvm22:
stage: runs_tests_chipstar_install_script_llvm22
resource_group: aurora_pipeline
extends: .aurora-batch-runner
script:
- cd ${WRK_DIR}/chipStar_llvm22/build
- module use /soft/modulefiles
- module load cmake chipStar/.llvm22/20260311-22/release
- rm -rf $HOME/.cache/chipStar
- CHIP_BE=level0 make build_tests -j
- CHIP_MODULE_CACHE_DIR="" ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
allow_failure: true
# testing with install script
chipStar_aurora_script_test:
stage: builds_chipstar_aurora_script_llvm19
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- mkdir ${WRK_DIR}/script_llvm19
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/script_llvm19
- NO_FRESH_CHIPSTAR_PULL=true temp=${WRK_DIR}/script_llvm19 MODULE_INSTALL_DIR=${WRK_DIR}/modulefiles CHIPSTAR_INSTALL_DIR=${WRK_DIR}/latest_llvm19/ /lus/flare/projects/Aurora_deployment/bertoni/projects/p02.chipStar/chip-star-patch.sh release chipStar/.llvm19/20251107-19/release
- cd ${WRK_DIR}/modulefiles/chipStar
- echo 'module_version("llvm19", "default")' > .modulerc.lua
allow_failure: true
chipStar_aurora_script_test_run:
stage: runs_chipstar_aurora_script_llvm19
resource_group: aurora_pipeline
extends: .aurora-batch-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cd ${WRK_DIR}/script_llvm19/chipStar/build
- rm -rf $HOME/.cache/chipStar
- CHIP_BE=level0 make build_tests -j
- module load cmake
- CHIP_MODULE_CACHE_DIR="" ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
allow_failure: true
chipStar_aurora_script_test_llvm22:
stage: builds_chipstar_aurora_script_llvm22
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- mkdir ${WRK_DIR}/script_llvm_22
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/script_llvm_22
- NO_FRESH_CHIPSTAR_PULL=true llvm_version=22 temp=${WRK_DIR}/script_llvm_22/ MODULE_INSTALL_DIR=${WRK_DIR}/modulefiles CHIPSTAR_INSTALL_DIR=${WRK_DIR}/latest_llvm22/ LLVM_INSTALL_DIR=${WRK_DIR}/llvm22 /lus/flare/projects/Aurora_deployment/bertoni/projects/p02.chipStar/chip-star-patch.sh release
allow_failure: true
chipStar_aurora_script_test_llvm22_run:
stage: runs_chipstar_aurora_script_llvm22
resource_group: aurora_pipeline
extends: .aurora-batch-runner
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cd ${WRK_DIR}/script_llvm_22/chipStar/build
- module load cmake
- rm -rf $HOME/.cache/chipStar
- CHIP_BE=level0 make build_tests -j
- CHIP_MODULE_CACHE_DIR="" ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
allow_failure: true
# hoMusic application build and run
hoMusic_build:
stage: builds_hoMusic
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- ${GENESIS_CI_PROJECT_DIR}/hoMusic_ci.sh build chipStar/llvm19
allow_failure: true
hoMusic_run:
stage: runs_hoMusic
resource_group: aurora_pipeline
extends: .aurora-batch-runner
script:
- rm -f ${GENESIS_CI_PROJECT_DIR}/output
- ${GENESIS_CI_PROJECT_DIR}/hoMusic_ci.sh run chipStar/llvm19 |& tee -a ${GENESIS_CI_PROJECT_DIR}/output
allow_failure: true
performance_hoMusic:
stage: performance_hoMusic
extends: .aurora-shell-runner
script:
- cd ${GENESIS_CI_PROJECT_DIR}
- |
TIME_STR=$(grep "real" output | awk '{print $2}')
echo "Extracted time: $TIME_STR"
# Convert to total seconds using awk (handles 1m50.315s -> 110.315)
ACTUAL_TIME=$(echo $TIME_STR | awk -F'[ms]' '{print ($1 * 60) + $2}')
# Define baseline (1m50.315s = 110.315s) and 6% threshold
BASELINE=110.315
THRESHOLD=$(echo "$BASELINE * 0.06" | bc -l)
LOWER_BOUND=$(echo "$BASELINE - $THRESHOLD" | bc -l)
UPPER_BOUND=$(echo "$BASELINE + $THRESHOLD" | bc -l)
echo "Actual: $ACTUAL_TIME s | Target: $BASELINE s (+/- $THRESHOLD s)"
# Compare using bc (returns 1 for true, 0 for false)
IS_WITHIN_LIMITS=$(echo "$ACTUAL_TIME >= $LOWER_BOUND && $ACTUAL_TIME <= $UPPER_BOUND" | bc -l)
if [ "$IS_WITHIN_LIMITS" -eq 1 ]; then
echo "Performance check passed: $ACTUAL_TIME is within 5% of $BASELINE"
exit 0
else
echo "Performance check failed: $ACTUAL_TIME is outside the range [$LOWER_BOUND, $UPPER_BOUND]"
exit 1
fi
allow_failure: true
# ZeroRK application build and run
zeroRK_build:
stage: builds_zeroRK
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- cd ${WRK_DIR}
- git clone git@github.com:CHIP-SPV/zero-rk.git -b hip-chipStar
- cd zero-rk
- module use /soft/modulefiles
- module use ${WRK_DIR}/modulefiles
- module load chipStar/llvm19 cmake
- mkdir -p build_aurora
- cd build_aurora
- sh ../scripts/build_aurora.sh --no-module-loads
allow_failure: true
zeroRK_run:
stage: runs_zeroRK
resource_group: aurora_pipeline
extends: .aurora-batch-runner
script:
- cd ${WRK_DIR}/zero-rk
- cd running_test_aurora
- mkdir -p logs
- chmod a+x ./submit_job.sh
- module use /soft/modulefiles
- module use ${WRK_DIR}/modulefiles
- module load chipStar/llvm19
- rm -f output
- ./submit_job.sh |& tee -a output
allow_failure: true
zeroRK_performance:
stage: perforamce_zeroRK
resource_group: aurora_pipeline
extends: .aurora-shell-runner
script:
- cd ${WRK_DIR}/zero-rk/running_test_aurora
- |
ACTUAL_TIME=$(grep "Job time in seconds" output | awk '{print $5}')
echo "Extracted time: $ACTUAL_TIME"
# Define baseline and 6% threshold
BASELINE=85
THRESHOLD=$(echo "$BASELINE * 0.06" | bc -l)
LOWER_BOUND=$(echo "$BASELINE - $THRESHOLD" | bc -l)
UPPER_BOUND=$(echo "$BASELINE + $THRESHOLD" | bc -l)
echo "Actual: $ACTUAL_TIME s | Target: $BASELINE s (+/- $THRESHOLD s)"
# Compare using bc (returns 1 for true, 0 for false)
IS_WITHIN_LIMITS=$(echo "$ACTUAL_TIME >= $LOWER_BOUND && $ACTUAL_TIME <= $UPPER_BOUND" | bc -l)
if [ "$IS_WITHIN_LIMITS" -eq 1 ]; then
echo "Performance check passed: $ACTUAL_TIME is within 5% of $BASELINE"
exit 0
else
echo "Performance check failed: $ACTUAL_TIME is outside the range [$LOWER_BOUND, $UPPER_BOUND]"
exit 1
fi
allow_failure: true
cleanup:
stage: cleanup
extends: .aurora-shell-runner
resource_group: aurora_pipeline
when: on_success
script:
- rm -rf ${WRK_DIR}
.report_github_status:
stage: cleanup
extends: .aurora-shell-runner
script:
- |
if [ -z "${GITHUB_SHA}" ]; then
echo "No GITHUB_SHA set, skipping GitHub status report"
exit 0
fi
curl -X POST \
--fail \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/CHIP-SPV/chipStar/statuses/${GITHUB_SHA} \
-d "{\"state\":\"${GITHUB_STATUS}\",\"context\":\"aurora-ci\",\"target_url\":\"${CI_PIPELINE_URL}\"}"
report_success:
extends: .report_github_status
when: on_success
variables:
GITHUB_STATUS: "success"
report_failure:
extends: .report_github_status
when: on_failure
variables:
GITHUB_STATUS: "failure"