Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Build & run CTS separately #16460

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 65 additions & 5 deletions .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ on:
type: string
default: 'default'
retention-days:
description: 'E2E binaries artifact retention period.'
description: 'E2E/SYCL-CTS binaries artifact retention period.'
type: string
default: 1

Expand All @@ -102,6 +102,19 @@ on:
default: 'false'
required: False

cts_testing_mode:
description: |
Testing mode to run SYCL-CTS in, can be either `full`, `build-only`
or `run-only`. In `build-only` mode an artifact of the CTS binaries
will be uploaded.
type: string
default: 'full'

sycl_cts_artifact:
type: string
default: ''
required: False

workflow_dispatch:
inputs:
runner:
Expand Down Expand Up @@ -147,7 +160,7 @@ on:
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.
build, e.g. {"CTS_TESTS_TO_BUILD":"test_category1 test_category2..."}.

Format: '{"VAR1":"VAL1","VAR2":"VAL2",...}'
default: '{}'
Expand Down Expand Up @@ -340,7 +353,7 @@ jobs:
fi
exit $exit_code
- name: Build SYCL CTS tests
if: inputs.tests_selector == 'cts'
if: inputs.tests_selector == 'cts' && inputs.sycl_cts_artifact == ''
env:
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }}
run: |
Expand Down Expand Up @@ -372,17 +385,64 @@ jobs:
# "test_conformance" target skips building "test_all" executable.
ninja -C build-cts -k0 $( [ -n "$CTS_TESTS_TO_BUILD" ] && echo "$CTS_TESTS_TO_BUILD" || echo "test_conformance")

- name: Pack SYCL-CTS binaries
if: always() && !cancelled() && inputs.cts_testing_mode == 'build-only'
run: tar -I 'zstd -9' -cf sycl_cts_bin.tar.zst -C ./build-cts/bin .

- name: Upload SYCL-CTS binaries
if: always() && !cancelled() && inputs.cts_testing_mode == 'build-only'
uses: actions/upload-artifact@v4
with:
name: sycl_cts_bin
path: sycl_cts_bin.tar.zst
retention-days: ${{ inputs.retention-days }}

- name: Download SYCL-CTS binaries
if: inputs.sycl_cts_artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.sycl_cts_artifact }}

- name: Extract SYCL-CTS binaries
if: inputs.sycl_cts_artifact != ''
run: |
mkdir -p build-cts/bin
tar -I 'zstd' -xf sycl_cts_bin.tar.zst -C build-cts/bin

- name: SYCL CTS List devices
# Proceed with execution even if the 'build' step did not succeed.
if: inputs.tests_selector == 'cts' && (success() || failure())
if: inputs.tests_selector == 'cts' && (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only'
env:
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
run: |
./build-cts/bin/* --list-devices

# If the suite was built on another machine then the build contains the full
# set of tests. We have special files to filter out some test categories,
# see "devops/cts_exclude_filter_*". Each configuration has its own file, e.g.
# there is "cts_exclude_filter_OCL_CPU" for opencl:cpu device. Therefore,
# these files may differ from each other, so when there is a pre-built set of
# tests, we need to filter it according to the filter-file.
- name: Filter SYCL CTS test categories
if: inputs.sycl_cts_artifact != ''
shell: bash
run: |
cts_exclude_filter=""
KornevNikita marked this conversation as resolved.
Show resolved Hide resolved
if [ "${{ contains(inputs.target_devices, 'opencl:cpu') }}" = "true" ]; then
cts_exclude_filter=$PWD/devops/cts_exclude_filter_OCL_CPU
elif [ "${{ contains(inputs.target_devices, 'level_zero:gpu') }}" = "true" ]; then
cts_exclude_filter=$PWD/devops/cts_exclude_filter_L0_GPU
fi

while IFS= read -r line; do
if [[ $line != \#* ]]; then
rm "./build-cts/bin/test_$line"
fi
done < "$cts_exclude_filter"

- name: Run SYCL CTS tests
# Proceed with execution even if the previous two steps did not succeed.
if: inputs.tests_selector == 'cts' && (success() || failure())
if: inputs.tests_selector == 'cts' && (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only'
env:
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
# This job takes ~100min usually. But sometimes some test isn't
Expand Down
66 changes: 52 additions & 14 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,6 @@ jobs:
image_options: -u 1001
target_devices: opencl:cpu
tests_selector: e2e

- name: SYCL-CTS on OCL CPU
runner: '["Linux", "gen12"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: opencl:cpu
tests_selector: cts

- name: SYCL-CTS on L0 gen12
runner: '["Linux", "gen12"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu
tests_selector: cts
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -175,6 +161,58 @@ jobs:
with:
mode: stop

build-sycl-cts:
needs: ubuntu2204_build
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: Build SYCL-CTS
runner: '["Linux", "build"]'
cts_testing_mode: 'build-only'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
tests_selector: cts
ref: ${{ github.sha }}
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}

run-sycl-cts:
needs: [ubuntu2204_build, build-sycl-cts]
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
include:
- name: SYCL-CTS on OCL CPU
runner: '["Linux", "gen12"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: opencl:cpu
tests_selector: cts

- name: SYCL-CTS on L0 gen12
runner: '["Linux", "gen12"]'
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu
tests_selector: cts
uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
cts_testing_mode: 'run-only'
image: ${{ matrix.image }}
image_options: ${{ matrix.image_options }}
target_devices: ${{ matrix.target_devices }}
tests_selector: ${{ matrix.tests_selector }}
ref: ${{ github.sha }}
merge_ref: ''
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
sycl_cts_artifact: sycl_cts_bin

nightly_build_upload:
name: Nightly Build Upload
if: ${{ github.ref_name == 'sycl' }}
Expand Down
2 changes: 2 additions & 0 deletions devops/cts_exclude_filter_L0_GPU
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Please use "#" to add comments here.
# Do not delete the file even if it's empty.
# CMPLRTST-26179
device
2 changes: 2 additions & 0 deletions devops/cts_exclude_filter_OCL_CPU
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Please use "#" to add comments here.
# Do not delete the file even if it's empty.
Loading