-
Notifications
You must be signed in to change notification settings - Fork 3
246 lines (229 loc) · 9.33 KB
/
Copy pathci.yml
File metadata and controls
246 lines (229 loc) · 9.33 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
# Copyright © 2019-2025
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Modified from Vortex CI by Aaron Kantsevoy (akantsevoy3@gatech.edu)
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout Repositoty
uses: actions/checkout@v4
with:
submodules: recursive
clean: false
- name: Run Sbatch file
run: chmod +x ./ci/run-crnch-cuda.sh && sbatch --wait --export=ALL ./ci/run-crnch-cuda.sh
tests:
runs-on: self-hosted
needs: build
strategy:
fail-fast: false
matrix:
name: [backprop, dotproduct, pathfinder, psum, bfs, btree, conv3, nn, saxpy, sgemm, stencil, transpose, vecadd, bh-cuda, blackscholes, cc-cuda, cfd, gauss, hotspot, huffman, jaccard-cuda, jacobi-cuda, lud, marchingCubes-cuda, nw, psort, score-cuda, sfilter, spmv, srad_v2, streamcluster, wedford-cuda, sgemm_tcu, sgemm_dxa, sgemm_tcu_dxa]
scheduler: [2, 0]
localmem: [1]
exclude:
# TCU/DXA benchmarks only run on SCHE_2 (require parallel threads)
- name: sgemm_tcu
scheduler: 0
- name: sgemm_dxa
scheduler: 0
- name: sgemm_tcu_dxa
scheduler: 0
include:
# SCHE_2 + LOCALMEM=0 for shared memory benchmarks
- name: bh-cuda
scheduler: 2
localmem: 0
- name: cc-cuda
scheduler: 2
localmem: 0
- name: hotspot
scheduler: 2
localmem: 0
- name: jaccard-cuda
scheduler: 2
localmem: 0
- name: jacobi-cuda
scheduler: 2
localmem: 0
- name: marchingCubes-cuda
scheduler: 2
localmem: 0
- name: score-cuda
scheduler: 2
localmem: 0
- name: wedford-cuda
scheduler: 2
localmem: 0
- name: sgemm_dxa
scheduler: 2
localmem: 0
- name: sgemm_tcu_dxa
scheduler: 2
localmem: 0
# Previous temporary config (new benchmarks only):
# name: [bh-cuda, blackscholes, cc-cuda, cfd, gauss, hotspot, huffman, jaccard-cuda, jacobi-cuda, lud, marchingCubes-cuda, nw, psort, score-cuda, sfilter, spmv, srad_v2, streamcluster, wedford-cuda]
# scheduler: [2]
# localmem: [1]
steps:
# - name: Checkout code
# uses: actions/checkout@v4
- name: Run tests (SBATCH)
run: |
export TEST_NAME="${{ matrix.name }}"
export VORTEX_SCHEDULE_FLAG="${{ matrix.scheduler }}"
export VORTEX_LOCALMEM_FLAG="${{ matrix.localmem }}"
chmod +x ./ci/run-crnch-cuda-test.sh && sbatch --wait --export=ALL ./ci/run-crnch-cuda-test.sh
echo "Showing last 100 lines of log:"
LOG_FILE=/tools/ci-reports/CuPBoP_logs/${TEST_NAME}.out
tail -n 100 $LOG_FILE
if grep -q "Kernel compilation completed!" "$LOG_FILE" && \
grep -q "Host compilation completed!" "$LOG_FILE" && \
grep -q "Execution completed!" "$LOG_FILE"; then
echo "Execution successful!"
else
echo "Execution failure."
exit 1
fi
- name: Verify Correctness
if: always()
run: |
export TEST_NAME="${{ matrix.name }}"
export SCHEDULE="${{ matrix.scheduler }}"
export LMEM="${{ matrix.localmem }}"
echo "PWD: $(pwd)"
ls -la ./examples/${TEST_NAME}/ci_output.txt || echo "ci_output.txt NOT FOUND"
ls -la ./examples/${TEST_NAME}/golden_output.txt || echo "golden_output.txt NOT FOUND"
EXAMPLE_DIR="./examples/${TEST_NAME}"
CI_OUTPUT="${EXAMPLE_DIR}/ci_output.txt"
STATUS_FILE="${EXAMPLE_DIR}/ci_status_SCHE_${SCHEDULE}_LMEM_${LMEM}.txt"
RESULT="FAIL"
case $TEST_NAME in
saxpy|sgemm|sgemm_tcu|sgemm_dxa|sgemm_tcu_dxa|psum|conv3|dotproduct|vecadd|stencil|transpose|atomic_test|bh-cuda|blackscholes|cc-cuda|cfd|huffman|jaccard-cuda|lud|marchingCubes-cuda|psort|score-cuda|sfilter|spmv|wedford-cuda)
if [ -f "$CI_OUTPUT" ] && grep -q "PASSED" "$CI_OUTPUT" && ! grep -q "^FAIL" "$CI_OUTPUT"; then
echo "Correctness: PASS"
RESULT="PASS"
else
echo "Correctness: FAIL (PASSED not found or FAIL detected)"
[ -f "$CI_OUTPUT" ] && tail -20 "$CI_OUTPUT"
fi
;;
backprop|nn|pathfinder|gauss|srad_v2|jacobi-cuda)
GOLDEN="${EXAMPLE_DIR}/golden_output.txt"
if [ -f "$GOLDEN" ] && [ -f "$CI_OUTPUT" ]; then
if python3 ./ci/compare_golden.py "$GOLDEN" "$CI_OUTPUT" --tolerance=1e-4; then
RESULT="PASS"
fi
else
echo "Correctness: FAIL (golden or CI output missing)"
fi
;;
nw)
GOLDEN="${EXAMPLE_DIR}/golden_result_nw.txt"
RESULT_FILE="${EXAMPLE_DIR}/result_vortex.txt"
if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then
diff -q "$GOLDEN" "$RESULT_FILE" && echo "Correctness: PASS" && RESULT="PASS" || { echo "Correctness: FAIL"; diff "$GOLDEN" "$RESULT_FILE" || true; }
else
echo "Correctness: FAIL (golden or result file missing)"
fi
;;
hotspot)
GOLDEN="${EXAMPLE_DIR}/golden_output_hotspot.txt"
RESULT_FILE="${EXAMPLE_DIR}/output.out"
if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then
if python3 ./ci/compare_golden.py "$GOLDEN" "$RESULT_FILE" --tolerance=1e-4; then
RESULT="PASS"
fi
else
echo "Correctness: FAIL (golden or output file missing)"
fi
;;
bfs)
GOLDEN="${EXAMPLE_DIR}/golden_result_bfs.txt"
RESULT_FILE="${EXAMPLE_DIR}/result_vortex.txt"
if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then
if diff -q "$GOLDEN" "$RESULT_FILE" > /dev/null 2>&1; then
echo "Correctness: PASS"
RESULT="PASS"
else
echo "Correctness: FAIL"
diff "$GOLDEN" "$RESULT_FILE" || true
fi
else
echo "Correctness: FAIL (golden or result file missing)"
fi
;;
streamcluster)
GOLDEN="${EXAMPLE_DIR}/golden_result_streamcluster.txt"
RESULT_FILE="${EXAMPLE_DIR}/output.txt"
if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then
if python3 ./ci/compare_golden.py "$GOLDEN" "$RESULT_FILE" --tolerance=1e-4; then
RESULT="PASS"
fi
else
echo "Correctness: FAIL (golden or result file missing)"
fi
;;
btree)
GOLDEN="${EXAMPLE_DIR}/golden_result_btree.txt"
RESULT_FILE="${EXAMPLE_DIR}/output.txt"
if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then
if diff -q "$GOLDEN" "$RESULT_FILE" > /dev/null 2>&1; then
echo "Correctness: PASS"
RESULT="PASS"
else
echo "Correctness: FAIL"
diff "$GOLDEN" "$RESULT_FILE" || true
fi
else
echo "Correctness: FAIL (golden or result file missing)"
fi
;;
*)
echo "No correctness check defined for $TEST_NAME"
RESULT="SKIP"
;;
esac
echo "$RESULT" > "$STATUS_FILE"
if [ "$RESULT" = "FAIL" ]; then
exit 1
fi
- name: Report Performance
if: always()
run: |
export TEST_NAME="${{ matrix.name }}"
export SCHEDULE="${{ matrix.scheduler }}"
export LMEM="${{ matrix.localmem }}"
if [ "$LMEM" = "0" ]; then
PERF_FILE=$(ls ./examples/${TEST_NAME}/Perf_counter_*SCHE_${SCHEDULE}_LOCAL_MEM_0*.txt 2>/dev/null | head -1)
LABEL="${TEST_NAME} (SCHE_${SCHEDULE}, LMEM=0)"
else
PERF_FILE=$(ls ./examples/${TEST_NAME}/Perf_counter_*SCHE_${SCHEDULE}*.txt 2>/dev/null | head -1)
LABEL="${TEST_NAME} (SCHE_${SCHEDULE})"
fi
if [ -n "$PERF_FILE" ]; then
python3 ./ci/perf_summary.py "$PERF_FILE" "$LABEL" "$SCHEDULE" >> $GITHUB_STEP_SUMMARY
fi
complete:
runs-on: self-hosted
needs: tests
if: always()
steps:
- name: Check Completion
run: echo "All matrix jobs passed"
- name: Performance Summary
run: |
python3 ./ci/perf_summary_all.py ./examples >> $GITHUB_STEP_SUMMARY