Skip to content

[CI] Build & run CTS separately #16460

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

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
63 changes: 58 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,16 @@ on:
default: 'false'
required: False

cts_build_only:
type: string
default: 'false'
required: False

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

workflow_dispatch:
inputs:
runner:
Expand Down Expand Up @@ -146,7 +156,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 @@ -339,7 +349,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 @@ -371,17 +381,60 @@ 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: inputs.tests_selector == 'cts' && (success() || failure()) && inputs.cts_build_only == 'true'
run: tar -I 'zstd -9' -cf sycl_cts_bin.tar.zst -C ./build-cts/bin .

- name: Upload SYCL-CTS binaries
if: inputs.tests_selector == 'cts' && (success() || failure()) && inputs.cts_build_only == 'true'
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.tests_selector == 'cts' && (success() || failure()) && inputs.sycl_cts_artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.sycl_cts_artifact }}

- name: Extract SYCL-CTS binaries
if: inputs.tests_selector == 'cts' && (success() || failure()) && 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' && (success() || failure()) && inputs.cts_build_only != 'true'
env:
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
run: |
./build-cts/bin/* --list-devices

# If the suite was built on another machine then it also contains excluded
# categories. Check the filter file and remove them.
- name: Filter SYCL CTS test categories
if: inputs.tests_selector == 'cts' && (success() || failure()) && inputs.sycl_cts_artifact != ''
shell: bash
run: |
cts_exclude_filter=""
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' && (success() || failure()) && inputs.cts_build_only != 'true'
env:
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }}
# This job takes ~100min usually. But sometimes some test isn't
Expand Down
65 changes: 51 additions & 14 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,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 @@ -174,6 +160,57 @@ 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_build_only: 'true'
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 }}
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