Skip to content

Commit 45a6d11

Browse files
authored
[CI] Build & run CTS separately (#16460)
Gen12 takes ~90min to build and run SYCL-CTS, where run takes less than 10mins. This patch updates workflows to build the suite on PVC and then upload artifacts to required machines.
1 parent cea6895 commit 45a6d11

File tree

4 files changed

+121
-19
lines changed

4 files changed

+121
-19
lines changed

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

+65-5
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ on:
7979
type: string
8080
default: 'default'
8181
retention-days:
82-
description: 'E2E binaries artifact retention period.'
82+
description: 'E2E/SYCL-CTS binaries artifact retention period.'
8383
type: string
8484
default: 1
8585

@@ -102,6 +102,19 @@ on:
102102
default: 'false'
103103
required: False
104104

105+
cts_testing_mode:
106+
description: |
107+
Testing mode to run SYCL-CTS in, can be either `full`, `build-only`
108+
or `run-only`. In `build-only` mode an artifact of the CTS binaries
109+
will be uploaded.
110+
type: string
111+
default: 'full'
112+
113+
sycl_cts_artifact:
114+
type: string
115+
default: ''
116+
required: False
117+
105118
workflow_dispatch:
106119
inputs:
107120
runner:
@@ -147,7 +160,7 @@ on:
147160
LIT_OPTS won't work as we redefine it as part of this workflow.
148161
149162
For SYCL CTS - CTS_TESTS_TO_BUILD to specify which categories to
150-
build.
163+
build, e.g. {"CTS_TESTS_TO_BUILD":"test_category1 test_category2..."}.
151164
152165
Format: '{"VAR1":"VAL1","VAR2":"VAL2",...}'
153166
default: '{}'
@@ -340,7 +353,7 @@ jobs:
340353
fi
341354
exit $exit_code
342355
- name: Build SYCL CTS tests
343-
if: inputs.tests_selector == 'cts'
356+
if: inputs.tests_selector == 'cts' && inputs.sycl_cts_artifact == ''
344357
env:
345358
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }}
346359
run: |
@@ -372,17 +385,64 @@ jobs:
372385
# "test_conformance" target skips building "test_all" executable.
373386
ninja -C build-cts -k0 $( [ -n "$CTS_TESTS_TO_BUILD" ] && echo "$CTS_TESTS_TO_BUILD" || echo "test_conformance")
374387
388+
- name: Pack SYCL-CTS binaries
389+
if: always() && !cancelled() && inputs.cts_testing_mode == 'build-only'
390+
run: tar -I 'zstd -9' -cf sycl_cts_bin.tar.zst -C ./build-cts/bin .
391+
392+
- name: Upload SYCL-CTS binaries
393+
if: always() && !cancelled() && inputs.cts_testing_mode == 'build-only'
394+
uses: actions/upload-artifact@v4
395+
with:
396+
name: sycl_cts_bin
397+
path: sycl_cts_bin.tar.zst
398+
retention-days: ${{ inputs.retention-days }}
399+
400+
- name: Download SYCL-CTS binaries
401+
if: inputs.sycl_cts_artifact != ''
402+
uses: actions/download-artifact@v4
403+
with:
404+
name: ${{ inputs.sycl_cts_artifact }}
405+
406+
- name: Extract SYCL-CTS binaries
407+
if: inputs.sycl_cts_artifact != ''
408+
run: |
409+
mkdir -p build-cts/bin
410+
tar -I 'zstd' -xf sycl_cts_bin.tar.zst -C build-cts/bin
411+
375412
- name: SYCL CTS List devices
376413
# Proceed with execution even if the 'build' step did not succeed.
377-
if: inputs.tests_selector == 'cts' && (success() || failure())
414+
if: inputs.tests_selector == 'cts' && (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only'
378415
env:
379416
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
380417
run: |
381418
./build-cts/bin/* --list-devices
382419
420+
# If the suite was built on another machine then the build contains the full
421+
# set of tests. We have special files to filter out some test categories,
422+
# see "devops/cts_exclude_filter_*". Each configuration has its own file, e.g.
423+
# there is "cts_exclude_filter_OCL_CPU" for opencl:cpu device. Therefore,
424+
# these files may differ from each other, so when there is a pre-built set of
425+
# tests, we need to filter it according to the filter-file.
426+
- name: Filter SYCL CTS test categories
427+
if: inputs.sycl_cts_artifact != ''
428+
shell: bash
429+
run: |
430+
cts_exclude_filter=""
431+
if [ "${{ contains(inputs.target_devices, 'opencl:cpu') }}" = "true" ]; then
432+
cts_exclude_filter=$PWD/devops/cts_exclude_filter_OCL_CPU
433+
elif [ "${{ contains(inputs.target_devices, 'level_zero:gpu') }}" = "true" ]; then
434+
cts_exclude_filter=$PWD/devops/cts_exclude_filter_L0_GPU
435+
fi
436+
437+
while IFS= read -r line; do
438+
if [[ $line != \#* ]]; then
439+
rm "./build-cts/bin/test_$line"
440+
fi
441+
done < "$cts_exclude_filter"
442+
383443
- name: Run SYCL CTS tests
384444
# Proceed with execution even if the previous two steps did not succeed.
385-
if: inputs.tests_selector == 'cts' && (success() || failure())
445+
if: inputs.tests_selector == 'cts' && (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only'
386446
env:
387447
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
388448
# This job takes ~100min usually. But sometimes some test isn't

.github/workflows/sycl-nightly.yml

+52-14
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,6 @@ jobs:
8989
image_options: -u 1001
9090
target_devices: opencl:cpu
9191
tests_selector: e2e
92-
93-
- name: SYCL-CTS on OCL CPU
94-
runner: '["Linux", "gen12"]'
95-
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
96-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
97-
target_devices: opencl:cpu
98-
tests_selector: cts
99-
100-
- name: SYCL-CTS on L0 gen12
101-
runner: '["Linux", "gen12"]'
102-
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
103-
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
104-
target_devices: level_zero:gpu
105-
tests_selector: cts
10692
uses: ./.github/workflows/sycl-linux-run-tests.yml
10793
with:
10894
name: ${{ matrix.name }}
@@ -175,6 +161,58 @@ jobs:
175161
with:
176162
mode: stop
177163

164+
build-sycl-cts:
165+
needs: ubuntu2204_build
166+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
167+
uses: ./.github/workflows/sycl-linux-run-tests.yml
168+
with:
169+
name: Build SYCL-CTS
170+
runner: '["Linux", "build"]'
171+
cts_testing_mode: 'build-only'
172+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
173+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
174+
tests_selector: cts
175+
ref: ${{ github.sha }}
176+
sycl_toolchain_artifact: sycl_linux_default
177+
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
178+
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
179+
180+
run-sycl-cts:
181+
needs: [ubuntu2204_build, build-sycl-cts]
182+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
183+
strategy:
184+
fail-fast: false
185+
matrix:
186+
include:
187+
- name: SYCL-CTS on OCL CPU
188+
runner: '["Linux", "gen12"]'
189+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
190+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
191+
target_devices: opencl:cpu
192+
tests_selector: cts
193+
194+
- name: SYCL-CTS on L0 gen12
195+
runner: '["Linux", "gen12"]'
196+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
197+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
198+
target_devices: level_zero:gpu
199+
tests_selector: cts
200+
uses: ./.github/workflows/sycl-linux-run-tests.yml
201+
with:
202+
name: ${{ matrix.name }}
203+
runner: ${{ matrix.runner }}
204+
cts_testing_mode: 'run-only'
205+
image: ${{ matrix.image }}
206+
image_options: ${{ matrix.image_options }}
207+
target_devices: ${{ matrix.target_devices }}
208+
tests_selector: ${{ matrix.tests_selector }}
209+
ref: ${{ github.sha }}
210+
merge_ref: ''
211+
sycl_toolchain_artifact: sycl_linux_default
212+
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
213+
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
214+
sycl_cts_artifact: sycl_cts_bin
215+
178216
nightly_build_upload:
179217
name: Nightly Build Upload
180218
if: ${{ github.ref_name == 'sycl' }}

devops/cts_exclude_filter_L0_GPU

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# Please use "#" to add comments here.
2+
# Do not delete the file even if it's empty.
13
# CMPLRTST-26179
24
device

devops/cts_exclude_filter_OCL_CPU

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Please use "#" to add comments here.
2+
# Do not delete the file even if it's empty.

0 commit comments

Comments
 (0)