-
Notifications
You must be signed in to change notification settings - Fork 815
383 lines (358 loc) · 13 KB
/
sycl-linux-run-tests.yml
File metadata and controls
383 lines (358 loc) · 13 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
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
name: SYCL E2E
on:
workflow_call:
inputs:
name:
type: string
required: True
runner:
type: string
required: True
image:
type: string
required: False
image_options:
type: string
required: True
target_devices:
type: string
required: False
extra_cmake_args:
type: string
required: False
tests_selector:
description: |
Three possible options: "e2e", "cts", and "benchmarks".
type: string
default: "e2e"
extra_lit_opts:
description: |
Extra options to be added to LIT_OPTS.
type: string
default: ''
repo_ref:
type: string
required: False
description: |
Commit SHA or branch to checkout the intel/llvm repo.
tests_ref:
type: string
required: False
description: Commit SHA or branch to checkout e2e/cts tests.
toolchain_artifact:
type: string
default: ''
required: False
toolchain_artifact_filename:
type: string
default: ''
required: False
toolchain_decompress_command:
type: string
default: ''
required: False
binaries_artifact:
description: |
When set in modes other than `run-only` results in artifact upload.
For `run-only` mode, if specified, means downloading pre-built
binaries from the artifact. If set to special value `in-container`
then the binaries are expected to be stored in the container image
instead of coming from an artifact.
type: string
default: ''
required: False
testing_mode:
description: |
Testing mode to run E2E/CTS tests in, can be either `full`, `build-only`
or `run-only`.
type: string
default: 'full'
retention-days:
description: 'E2E/SYCL-CTS binaries artifact retention period.'
type: string
default: 1
install_igc_driver:
type: string
required: False
install_dev_igc_driver:
type: string
required: False
env:
type: string
default: '{}'
required: False
skip_run:
type: string
default: 'false'
required: False
benchmark_upload_results:
description: |
Set to true to upload results to git repository storing benchmarking
results.
type: string
default: 'false'
required: False
benchmark_save_name:
description: |
Save name to use for benchmark results: Save names are stored in
metadata of result file, and are used to identify benchmark results in
the same series (e.g. same configuration, same device, etc.).
Note: Currently, benchmark result filenames are in the format of
<benchmark_save_name>_<Device>_<Backend>_YYYYMMDD_HHMMSS.json
type: string
default: ''
required: False
benchmark_preset:
description: |
Name of benchmark preset to run.
See /devops/scripts/benchmarks/presets.py for all presets available.
type: string
default: 'Minimal'
required: False
# dry-run is passed only to compare.py (to not fail on regression), not to main.py (where such flag would omit all benchmark runs)
benchmark_dry_run:
description: |
Whether or not to fail the workflow upon a regression.
type: string
default: 'false'
required: False
benchmark_exit_on_failure:
description: |
Whether or not to fail the workflow upon a failure.
type: string
default: 'false'
required: False
in_workflow_call_mode:
description: |
Unlike `github.event_type` that captures the original trigger, we use
this to determine how this particular workflow has been called. This
isn't supposed to be specified by a caller and only relies on the
default value.
default: 'true'
required: False
type: string
workflow_dispatch:
inputs:
runner:
type: choice
options:
- '["Linux", "gen12"]'
- '["amdgpu"]'
- '["Linux", "arc"]'
- '["Linux", "pvc"]'
- '["cts-cpu"]'
- '["Linux", "build"]'
- '["cuda"]'
- '["PVC_PERF"]'
- '["L0v2_arl"]'
image:
type: choice
options:
- 'ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest'
- 'ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_2'
- 'ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_3'
- 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'
image_options:
description: |
Use option with "--device=/dev/kfd" for AMDGPU, without it for the rest.
type: choice
options:
- '-u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN'
- '-u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN'
- '-u 1001 --gpus all --cap-add SYS_ADMIN'
target_devices:
type: choice
options:
- 'level_zero:gpu'
- 'opencl:cpu'
- 'opencl:gpu'
- 'hip:gpu'
- 'cuda:gpu'
- 'level_zero_v2:arch-intel_gpu_mtl_u'
tests_selector:
type: choice
options:
- e2e
- cts
- benchmarks
toolchain_release_tag:
description: |
Tag of a "Nightly" release at https://github.com/intel/llvm/releases.
default: ''
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, e.g. {"CTS_TESTS_TO_BUILD":"test_category1 test_category2..."}.
Format: '{"VAR1":"VAL1","VAR2":"VAL2",...}'
default: '{}'
extra_lit_opts:
description: |
Extra options to be added to LIT_OPTS.
default: ''
testing_mode:
type: choice
options:
- "full"
- "build-only"
- "run-only"
benchmark_exit_on_failure:
type: choice
options:
- "true"
- "false"
permissions:
contents: read
packages: read
jobs:
run:
if: github.event_name == 'workflow_dispatch' || inputs.skip_run == 'false'
name: ${{ inputs.name }}
runs-on: ${{ fromJSON(inputs.runner) }}
permissions:
contents: write
packages: read
container:
image: ${{ inputs.image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'}}
options: ${{ inputs.image_options }}
env: ${{ fromJSON(inputs.env) }}
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: |
devops
sycl/cts_exclude_filter
- name: Register cleanup after job is finished
uses: ./devops/actions/cleanup
- name: Reset Intel GPU
uses: ./devops/actions/reset_gpu
- name: Install drivers
if: inputs.binaries_artifact != 'in-container' && (inputs.install_igc_driver == 'true' || inputs.install_dev_igc_driver == 'true')
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
if [ "${{ inputs.install_dev_igc_driver }}" = "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 devops/dependencies.json ${{ inputs.install_dev_igc_driver == 'true' && '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.toolchain_artifact != '' && github.event_name != 'workflow_run'
uses: actions/download-artifact@v6
with:
name: ${{ inputs.toolchain_artifact }}
- name: Download SYCL toolchain [workflow_run]
# NOTE: This is for `sycl-linux-precommit-aws.yml`.
if: inputs.toolchain_artifact != '' && github.event_name == 'workflow_run'
uses: actions/github-script@v8
with:
script: |
const name = '${{ inputs.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.toolchain_artifact != '' && github.event_name == 'workflow_run'
run: |
pwd
ls
unzip ${{ inputs.toolchain_artifact }}.zip
rm ${{ inputs.toolchain_artifact }}.zip
- name: Extract/Setup SYCL toolchain
if: inputs.toolchain_artifact != ''
run: |
mkdir toolchain
tar -I '${{ inputs.toolchain_decompress_command }}' -xf ${{ inputs.toolchain_artifact_filename }} -C toolchain
rm -f ${{ inputs.toolchain_artifact_filename }}
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
- name: Download SYCL toolchain using release tag
if: inputs.toolchain_release_tag != ''
env:
TAG: ${{ inputs.toolchain_release_tag }}
shell: bash
run: |
mkdir toolchain
wget "https://github.com/intel/llvm/releases/download/$TAG/sycl_linux.tar.gz"
tar xf sycl_linux.tar.gz -C toolchain
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
- name: Print IGC version
run: |
if [ -f /usr/local/lib/igc/IGCTAG.txt ]; then
cat /usr/local/lib/igc/IGCTAG.txt
fi
- name: Run E2E Tests
if: inputs.tests_selector == 'e2e'
uses: ./devops/actions/run-tests/e2e
timeout-minutes: 60
with:
ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }}
binaries_artifact: ${{ inputs.in_workflow_call_mode && inputs.binaries_artifact
|| inputs.testing_mode == 'run-only' && 'in-container'
|| '' }}
testing_mode: ${{ inputs.testing_mode }}
extra_cmake_args: ${{ inputs.extra_cmake_args }}
target_devices: ${{ inputs.target_devices }}
extra_lit_opts: ${{ inputs.extra_lit_opts }}
retention-days: ${{ inputs.retention-days }}
- name: Run SYCL CTS Tests
if: inputs.tests_selector == 'cts'
uses: ./devops/actions/run-tests/cts
# Normally this job takes less than 10m. But sometimes it hangs up and
# reaches the 360m limit. Set a lower limit to free up the runner earlier.
timeout-minutes: 35
with:
ref: ${{ inputs.tests_ref || 'main' }}
extra_cmake_args: ${{ inputs.extra_cmake_args }}
testing_mode: ${{ inputs.testing_mode }}
binaries_artifact: ${{ inputs.in_workflow_call_mode && inputs.binaries_artifact
|| inputs.testing_mode == 'run-only' && 'in-container'
|| '' }}
target_devices: ${{ inputs.target_devices }}
retention-days: ${{ inputs.retention-days }}
- name: Run benchmarks
if: inputs.tests_selector == 'benchmarks'
uses: ./devops/actions/run-tests/benchmark
with:
target_devices: ${{ inputs.target_devices }}
upload_results: ${{ inputs.benchmark_upload_results }}
save_name: ${{ inputs.benchmark_save_name }}
preset: ${{ inputs.benchmark_preset }}
dry_run: ${{ inputs.benchmark_dry_run }}
exit_on_failure: ${{ inputs.benchmark_exit_on_failure }}
build_ref: ${{ inputs.repo_ref }}
runner: ${{ inputs.runner }}