-
Notifications
You must be signed in to change notification settings - Fork 769
390 lines (373 loc) · 13.5 KB
/
sycl-linux-benchmark.yml
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
name: SYCL Benchmarking
on:
workflow_call:
inputs:
runner:
type: string
required: True
image:
type: string
required: True
image_options:
type: string
required: True
target_devices:
type: string
required: True
ref:
type: string
required: True
merge_ref:
description: |
Commit-ish to merge post-checkout if non-empty. Must be reachable from
the default_branch input paramter.
type: string
default: 'FETCH_HEAD'
required: False
sycl_toolchain_artifact:
type: string
default: ''
required: False
sycl_toolchain_archive:
type: string
default: ''
required: False
sycl_toolchain_decompress_command:
type: string
default: ''
required: False
reset_gpu:
type: string
required: False
install_drivers:
type: string
required: False
use_dev_igc:
type: string
required: False
env:
type: string
default: '{}'
required: False
workflow_dispatch:
inputs:
runner:
type: choice
options:
- '["Linux", "gen12"]'
- '["amdgpu"]'
- '["Linux", "arc"]'
image:
description: |
Use option ending with ":build" for AMDGPU, ":latest" for the rest.
type: choice
options:
- 'ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:latest'
- 'ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build'
image_options:
description: |
Use option with "--device=/dev/kfd" for AMDGPU, without it for the rest.
type: choice
options:
- '-u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN'
- '-u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN'
target_devices:
type: choice
options:
- 'opencl:cpu'
- 'opencl:gpu'
- 'opencl:fpga'
- 'ext_oneapi_level_zero:gpu'
- 'ext_oneapi_hip:gpu'
env:
description: |
Suggested variables: for E2E tests - LIT_FILTER, LIT_FILTER_OUT.
LIT_OPTS won't work as we redefine it as part of this workflow.
For SYCL CTS - CTS_TESTS_TO_BUILD to specify which categories to
build.
Format: '{"VAR1":"VAL1","VAR2":"VAL2",...}'
default: '{}'
install_drivers:
type: choice
options:
- false
- true
use_dev_igc:
type: choice
options:
- false
- true
sycl_toolchain_artifact:
type: string
default: ''
required: False
sycl_toolchain_archive:
type: string
default: ''
required: False
sycl_toolchain_decompress_command:
type: string
default: ''
required: False
permissions:
contents: read
jobs:
check_build:
name: Build (if no sycl artifact provided)
uses: ./.github/workflows/sycl-linux-build.yml
with:
build_ref: ${{ github.sha }}
merge_ref: ''
build_cache_root: "/__w/"
build_artifact_suffix: "default_benchmark"
build_cache_suffix: "default_benchmark"
build_image: ${{ inputs.image }}
skip_build: ${{ inputs.sycl_toolchain_archive != '' }}
skip_reason: "SYCL toolchain artifact already provided, no build necessary"
# run_archive:
# if: inputs.sycl_toolchain_archive != ''
# runs-on: ${{ fromJSON(inputs.runner) }}
# container:
# image: ${{ inputs.image }}
# options: ${{ inputs.image_options }}
# env: ${{ fromJSON(inputs.env) }}
# steps:
# - name: Reset GPU
# if: inputs.reset_gpu == 'true'
# run: |
# sudo mount -t debugfs none /sys/kernel/debug
# sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged'
# - uses: actions/checkout@v4
# with:
# ref: ${{ inputs.ref }}
# sparse-checkout: |
# devops
# - name: Register cleanup after job is finished
# uses: ./devops/actions/cleanup
# - name: Install drivers
# if: inputs.install_drivers == 'true'
# env:
# GITHUB_TOKEN: ${{ github.token }}
# run: |
# if [ "${{ inputs.use_dev_igc }}" = "true" ]; then
# # If libllvm14 is already installed (dev igc docker), still return true.
# sudo apt-get install -yqq libllvm14 || true;
# fi
# sudo -E bash devops/scripts/install_drivers.sh llvm/devops/dependencies.json ${{ inputs.use_dev_igc == 'true' && 'llvm/devops/dependencies-igc-dev.json --use-dev-igc' || '' }} --all
# - name: Source OneAPI TBB vars.sh
# shell: bash
# run: |
# # https://github.com/actions/runner/issues/1964 prevents us from using
# # the ENTRYPOINT in the image.
# env | sort > env_before
# if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
# source /runtimes/oneapi-tbb/env/vars.sh;
# elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
# source /opt/runtimes/oneapi-tbb/env/vars.sh;
# else
# echo "no TBB vars in /opt/runtimes or /runtimes";
# fi
# env | sort > env_after
# comm -13 env_before env_after >> $GITHUB_ENV
# rm env_before env_after
#
# - name: Download SYCL toolchain
# if: inputs.sycl_toolchain_artifact != '' && github.event_name != 'workflow_run'
# uses: actions/download-artifact@v4
# with:
# name: ${{ inputs.sycl_toolchain_artifact }}
# - name: Download SYCL toolchain [workflow_run]
# if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
# uses: actions/github-script@v7
# with:
# script: |
# const name = '${{ inputs.sycl_toolchain_artifact }}'
# let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
# owner: context.repo.owner,
# repo: context.repo.repo,
# run_id: context.payload.workflow_run.id,
# });
# let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
# return artifact.name == name
# })[0];
# let download = await github.rest.actions.downloadArtifact({
# owner: context.repo.owner,
# repo: context.repo.repo,
# artifact_id: matchArtifact.id,
# archive_format: 'zip',
# });
# let fs = require('fs');
# fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/` + name + '.zip', Buffer.from(download.data));
# - name: Unzip artifact [workflow_run]
# if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
# run: |
# unzip ${{ inputs.sycl_toolchain_artifact }}.zip
# rm ${{ inputs.sycl_toolchain_artifact }}.zip
# - name: Extract/Setup SYCL toolchain
# if: inputs.sycl_toolchain_artifact != ''
# run: |
# mkdir toolchain
# tar -I '${{ inputs.sycl_toolchain_decompress_command }}' -xf ${{ inputs.sycl_toolchain_archive }} -C toolchain
# rm -f ${{ inputs.sycl_toolchain_archive }}
# echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
# echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
# - run: which clang++ sycl-ls
# - run: sycl-ls --verbose
# - run: SYCL_UR_TRACE=1 sycl-ls
# - run: |
# if [ -f /usr/local/lib/igc/IGCTAG.txt ]; then
# cat /usr/local/lib/igc/IGCTAG.txt
# fi
#
# - name: Run compute-benchmarks
# id: run_benchmarks
# if: success()
# run: |
# whereis clang++
# whereis sycl-ls
# clang++ --version
# ls
# export CMPLR_ROOT=$PWD/toolchain
# ./devops/scripts/benchmarking/benchmark.sh
# # - name: Upload sycl-bench microbenchmark results
# # if: inputs.tests_selector == 'benchmark' && steps.run_benchmarks.outcome == 'success'
# # uses: actions/upload-artifact@v4
# # with:
# # name: sycl_benchmark_res_${{ steps.run_benchmarks.outputs.TIMESTAMP }}
# # path: ${{ steps.run_benchmarks.outputs.BENCHMARK_RESULTS }}
# # retention-days: 7
run_benchmarks:
needs: [ check_build ]
runs-on: ${{ fromJSON(inputs.runner) }}
container:
image: ${{ inputs.image }}
options: ${{ inputs.image_options }}
env: ${{ fromJSON(inputs.env) }}
steps:
- name: Reset GPU
if: inputs.reset_gpu == 'true'
run: |
sudo mount -t debugfs none /sys/kernel/debug
sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged'
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
sparse-checkout: |
devops
- name: Register cleanup after job is finished
uses: ./devops/actions/cleanup
- name: Install drivers
if: inputs.install_drivers == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
if [ "${{ inputs.use_dev_igc }}" = "true" ]; then
# If libllvm14 is already installed (dev igc docker), still return true.
sudo apt-get install -yqq libllvm14 || true;
fi
sudo -E bash devops/scripts/install_drivers.sh llvm/devops/dependencies.json ${{ inputs.use_dev_igc == 'true' && 'llvm/devops/dependencies-igc-dev.json --use-dev-igc' || '' }} --all
- name: Source OneAPI TBB vars.sh
shell: bash
run: |
# https://github.com/actions/runner/issues/1964 prevents us from using
# the ENTRYPOINT in the image.
env | sort > env_before
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
source /runtimes/oneapi-tbb/env/vars.sh;
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
source /opt/runtimes/oneapi-tbb/env/vars.sh;
else
echo "no TBB vars in /opt/runtimes or /runtimes";
fi
env | sort > env_after
comm -13 env_before env_after >> $GITHUB_ENV
rm env_before env_after
- name: Download SYCL toolchain
if: github.event_name != 'workflow_run'
uses: actions/download-artifact@v4
with:
name: ${{ inputs.sycl_toolchain_artifact || 'sycl_linux_benchmark_ver' }}
- name: Download SYCL toolchain [workflow_run]
if: && github.event_name == 'workflow_run'
uses: actions/github-script@v7
with:
script: |
const name = '${{ inputs.sycl_toolchain_artifact || 'sycl_linux_benchmark_ver' }}'
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == name
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/` + name + '.zip', Buffer.from(download.data));
- name: Unzip artifact [workflow_run]
if: github.event_name == 'workflow_run'
run: |
unzip ${{ inputs.sycl_toolchain_artifact || 'sycl_linux_benchmark_ver' }}.zip
rm ${{ inputs.sycl_toolchain_artifact || 'sycl_linux_benchmark_ver' }}.zip
- name: Extract/Setup SYCL toolchain
run: |
mkdir toolchain
tar -I '${{ inputs.sycl_toolchain_decompress_command || needs.check_build.outputs.artifact_decompress_command }}' \
-xf ${{ inputs.sycl_toolchain_archive || needs.check_build.outputs.artifact_archive_name }} -C toolchain
rm -f ${{ inputs.sycl_toolchain_archive || needs.check_build.outputs.artifact_archive_name }}
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
- run: ls
- run: which clang++ sycl-ls
- run: sycl-ls --verbose
- run: SYCL_UR_TRACE=1 sycl-ls
- run: |
if [ -f /usr/local/lib/igc/IGCTAG.txt ]; then
cat /usr/local/lib/igc/IGCTAG.txt
fi
# - name: Install deps
# if: success()
# run: |
# sudo apt install -y ssh
- name: Run compute-benchmarks
id: run_benchmarks
if: success()
run: |
whereis clang++
whereis sycl-ls
clang++ --version
ls
export CMPLR_ROOT=$PWD/toolchain
./devops/scripts/benchmarking/benchmark.sh
exit $?
- name: Push compute-benchmarks
if: success()
env:
SSH_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "###"
echo "$(ssh-agent -s)"
echo "###"
eval "$(ssh-agent -s)"
ssh-add -k ~/.ssh/id_rsa
cd llvm-ci-perf-results
git config --global user.name "iclsrc"
git config --global user.email "[email protected]"
git add .
git commit -m "Update results"
git push
# - name: Upload sycl-bench microbenchmark results
# if: inputs.tests_selector == 'benchmark' && steps.run_benchmarks.outcome == 'success'
# uses: actions/upload-artifact@v4
# with:
# name: sycl_benchmark_res_${{ steps.run_benchmarks.outputs.TIMESTAMP }}
# path: ${{ steps.run_benchmarks.outputs.BENCHMARK_RESULTS }}
# retention-days: 7