Skip to content

Commit 3ed6d31

Browse files
authored
[CI][sycl-rel] Update sycl-rel CI (#18986)
This patch updates workflows and devops files on the sycl-rel-6_2 branch. In general it's a copy-paste from sycl branch, but sycl-rel-nightly.yml was additionally updated (see the "remove redundant parts" commit). We don't need these workarounds to launch the scheduled run of sycl-rel nightly from sycl branch anymore, so I'm deleting different *_ref stuff from this workflow.
1 parent d5c4a9f commit 3ed6d31

20 files changed

+567
-246
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: SYCL hardening check
2+
3+
permissions: read-all
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
sycl_linux_artifact:
9+
type: string
10+
sycl_linux_archive:
11+
type: string
12+
sycl_linux_decompress_command:
13+
type: string
14+
15+
sycl_windows_artifact:
16+
type: string
17+
sycl_windows_archive:
18+
type: string
19+
20+
jobs:
21+
hardening_check:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Install hardening-check
26+
run: |
27+
sudo apt update
28+
sudo apt install -y devscripts
29+
30+
- name: Download SYCL toolchain
31+
uses: actions/download-artifact@v4
32+
with:
33+
name: ${{ inputs.sycl_linux_artifact }}
34+
35+
- name: Extract SYCL toolchain
36+
run: |
37+
mkdir toolchain
38+
tar -I '${{ inputs.sycl_linux_decompress_command }}' -xf ${{ inputs.sycl_linux_archive }} -C toolchain
39+
40+
- name: Perform checks
41+
run: |
42+
for file in ./toolchain/bin/*; do
43+
hardening-check "$file" | tee -a "./hardening-check.txt"
44+
done
45+
46+
for file in $(find ./toolchain/lib/ -type f -name "*.so*"); do
47+
hardening-check "$file" | tee -a "./hardening-check.txt"
48+
done
49+
50+
- uses: actions/upload-artifact@v4
51+
with:
52+
name: hardening-check
53+
path: hardening-check.txt
54+
55+
winchecksec:
56+
runs-on: windows-latest
57+
58+
steps:
59+
- name: Install winchecksec
60+
run: |
61+
curl -LO https://github.com/trailofbits/winchecksec/releases/download/v3.1.0/windows.x64.Release.zip
62+
mkdir winchecksec
63+
unzip "windows.x64.Release.zip" -d winchecksec
64+
65+
- name: Download SYCL toolchain
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: ${{ inputs.sycl_windows_artifact }}
69+
70+
- name: Extract SYCL toolchain
71+
shell: bash
72+
run: |
73+
mkdir toolchain
74+
tar -xf ${{ inputs.sycl_windows_archive }} -C toolchain
75+
76+
- name: Download and check Windows artifacts
77+
shell: bash
78+
run: |
79+
for file in $(find ./toolchain/bin/ -type f -name "*.exe"); do
80+
./winchecksec/build/Release/winchecksec.exe "$file" | tee -a "./winchecksec.txt"
81+
done
82+
83+
for file in $(find ./toolchain/bin/ -type f -name "*.dll"); do
84+
./winchecksec/build/Release/winchecksec.exe "$file" | tee -a "./winchecksec.txt"
85+
done
86+
87+
- uses: actions/upload-artifact@v4
88+
with:
89+
name: winchecksec
90+
path: winchecksec.txt

.github/workflows/sycl-linux-build.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ on:
3232
build_artifact_suffix:
3333
type: string
3434
required: true
35+
build_target:
36+
type: string
37+
required: false
38+
default: sycl-toolchain
3539
artifact_archive_name:
3640
type: string
3741
default: llvm_sycl.tar.zst
@@ -46,7 +50,10 @@ on:
4650
default: 3
4751
e2e_binaries_artifact:
4852
type: string
49-
required: False
53+
required: false
54+
pack_release:
55+
type: string
56+
required: false
5057

5158
outputs:
5259
build_conclusion:
@@ -100,6 +107,10 @@ on:
100107
options:
101108
- 3
102109

110+
pack_release:
111+
type: string
112+
required: false
113+
103114
permissions: read-all
104115

105116
jobs:
@@ -170,7 +181,8 @@ jobs:
170181
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
171182
- name: Compile
172183
id: build
173-
run: cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain
184+
# Emulate default value for manual dispatch as we've run out of available arguments.
185+
run: cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }}
174186
- name: check-llvm
175187
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
176188
run: |
@@ -215,11 +227,26 @@ jobs:
215227
# TODO consider moving this to Dockerfile.
216228
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
217229
LIT_OPTS="--allow-empty-runs" LIT_FILTER="e2e_test_requirements" cmake --build $GITHUB_WORKSPACE/build --target check-sycl
218-
- name: Install
230+
- name: Install sycl-toolchain
219231
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
220-
# TODO replace utility installation with a single CMake target
221232
run: |
222233
cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain
234+
235+
- name: Pack toolchain release
236+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }}
237+
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
238+
- name: Upload toolchain release
239+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }}
240+
uses: actions/upload-artifact@v4
241+
with:
242+
name: sycl_linux_release
243+
path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
244+
retention-days: ${{ inputs.retention-days }}
245+
246+
- name: Install utilities
247+
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
248+
# TODO replace utility installation with a single CMake target
249+
run: |
223250
cmake --build $GITHUB_WORKSPACE/build --target utils/FileCheck/install
224251
cmake --build $GITHUB_WORKSPACE/build --target utils/count/install
225252
cmake --build $GITHUB_WORKSPACE/build --target utils/not/install
@@ -278,7 +305,7 @@ jobs:
278305
testing_mode: build-only
279306
target_devices: all
280307
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
281-
cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
308+
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
282309
extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd"
283310

284311
- name: Remove E2E tests before spirv-backend run
@@ -293,5 +320,20 @@ jobs:
293320
testing_mode: build-only
294321
target_devices: all
295322
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_spirv_backend
296-
cxx_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
323+
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
297324
extra_lit_opts: --param spirv-backend=True
325+
326+
- name: Remove E2E tests before preview-mode run
327+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
328+
run: rm -rf build-e2e
329+
330+
- name: Build E2E tests in Preview Mode
331+
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
332+
uses: ./devops/actions/run-tests/e2e
333+
with:
334+
ref: ${{ inputs.ref || github.sha }}
335+
testing_mode: build-only
336+
target_devices: all
337+
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_preview
338+
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
339+
extra_lit_opts: --param test-preview-mode=True

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
required: False
2626
tests_selector:
2727
description: |
28-
Three possible options: "e2e", "cts", and "compute-benchmarks".
28+
Three possible options: "e2e", "cts", and "benchmarks".
2929
type: string
3030
default: "e2e"
3131

@@ -82,9 +82,6 @@ on:
8282
type: string
8383
default: 1
8484

85-
reset_intel_gpu:
86-
type: string
87-
required: False
8885
install_igc_driver:
8986
type: string
9087
required: False
@@ -114,6 +111,33 @@ on:
114111
default: ''
115112
required: False
116113

114+
benchmark_upload_results:
115+
description: |
116+
Set to true to upload results to git repository storing benchmarking
117+
results.
118+
type: string
119+
default: 'false'
120+
required: False
121+
benchmark_save_name:
122+
description: |
123+
Save name to use for benchmark results: Save names are stored in
124+
metadata of result file, and are used to identify benchmark results in
125+
the same series (e.g. same configuration, same device, etc.).
126+
127+
Note: Currently, benchmark result filenames are in the format of
128+
<benchmark_save_name>_<Device>_<Backend>_YYYYMMDD_HHMMSS.json
129+
type: string
130+
default: ''
131+
required: False
132+
benchmark_preset:
133+
description: |
134+
Name of benchmark preset to run.
135+
136+
See /devops/scripts/benchmarks/presets.py for all presets available.
137+
type: string
138+
default: 'Minimal'
139+
required: False
140+
117141
workflow_dispatch:
118142
inputs:
119143
runner:
@@ -153,7 +177,7 @@ on:
153177
options:
154178
- e2e
155179
- cts
156-
- compute-benchmarks
180+
- benchmarks
157181

158182
env:
159183
description: |
@@ -171,14 +195,6 @@ on:
171195
Extra options to be added to LIT_OPTS.
172196
default: ''
173197

174-
reset_intel_gpu:
175-
description: |
176-
Reset Intel GPUs
177-
type: choice
178-
options:
179-
- false
180-
- true
181-
182198
e2e_testing_mode:
183199
type: choice
184200
options:
@@ -199,31 +215,15 @@ jobs:
199215
options: ${{ inputs.image_options }}
200216
env: ${{ fromJSON(inputs.env) }}
201217
steps:
202-
- name: Reset Intel GPU
203-
if: inputs.reset_intel_gpu == 'true'
204-
shell: bash
205-
run: |
206-
if [[ '${{ inputs.runner }}' == '["Linux", "bmg"]' ]]; then
207-
sudo bash -c 'echo 0000:05:00.0 > /sys/bus/pci/drivers/xe/unbind'
208-
sudo bash -c 'echo 1 > /sys/bus/pci/devices/0000:05:00.0/reset'
209-
sudo bash -c 'echo 0000:05:00.0 > /sys/bus/pci/drivers/xe/bind'
210-
else
211-
sudo mount -t debugfs none /sys/kernel/debug
212-
base_dir="/sys/kernel/debug/dri"
213-
214-
for dir in "$base_dir"/*; do
215-
if [ -f "$dir/i915_wedged" ]; then
216-
sudo bash -c 'echo 1 > $0/i915_wedged' $dir
217-
fi
218-
done
219-
fi
220218
- uses: actions/checkout@v4
221219
with:
222220
ref: ${{ inputs.devops_ref || inputs.repo_ref }}
223221
sparse-checkout: |
224222
devops
225223
- name: Register cleanup after job is finished
226224
uses: ./devops/actions/cleanup
225+
- name: Reset Intel GPU
226+
uses: ./devops/actions/reset_gpu
227227
- name: Install drivers
228228
if: inputs.install_igc_driver == 'true' || inputs.install_dev_igc_driver == 'true'
229229
env:
@@ -308,6 +308,7 @@ jobs:
308308
- name: Run E2E Tests
309309
if: inputs.tests_selector == 'e2e'
310310
uses: ./devops/actions/run-tests/e2e
311+
timeout-minutes: 60
311312
with:
312313
ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }}
313314
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
@@ -320,6 +321,9 @@ jobs:
320321
- name: Run SYCL CTS Tests
321322
if: inputs.tests_selector == 'cts'
322323
uses: ./devops/actions/run-tests/cts
324+
# Normally this job takes less than 10m. But sometimes it hangs up and
325+
# reaches the 360m limit. Set a lower limit to free up the runner earlier.
326+
timeout-minutes: 35
323327
with:
324328
ref: ${{ inputs.tests_ref || 'main' }}
325329
cts_exclude_ref: ${{ inputs.repo_ref }}
@@ -329,11 +333,14 @@ jobs:
329333
target_devices: ${{ inputs.target_devices }}
330334
retention-days: ${{ inputs.retention-days }}
331335

332-
- name: Run compute-benchmarks on SYCL
333-
if: inputs.tests_selector == 'compute-benchmarks'
336+
- name: Run benchmarks
337+
if: inputs.tests_selector == 'benchmarks'
334338
uses: ./devops/actions/run-tests/benchmark
335339
with:
336340
target_devices: ${{ inputs.target_devices }}
341+
upload_results: ${{ inputs.benchmark_upload_results }}
342+
save_name: ${{ inputs.benchmark_save_name }}
343+
preset: ${{ inputs.benchmark_preset }}
337344
env:
338345
RUNNER_TAG: ${{ inputs.runner }}
339346
GITHUB_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}

0 commit comments

Comments
 (0)