diff --git a/.github/workflows/sycl-linux-run-tests.yml b/.github/workflows/sycl-linux-run-tests.yml index 8e54f90348427..1aa89ce637196 100644 --- a/.github/workflows/sycl-linux-run-tests.yml +++ b/.github/workflows/sycl-linux-run-tests.yml @@ -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 @@ -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: @@ -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: '{}' @@ -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: | @@ -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="" + 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 diff --git a/.github/workflows/sycl-nightly.yml b/.github/workflows/sycl-nightly.yml index 104eaea16d0e2..3d823def12ff5 100644 --- a/.github/workflows/sycl-nightly.yml +++ b/.github/workflows/sycl-nightly.yml @@ -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 }} @@ -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' }} diff --git a/devops/cts_exclude_filter_L0_GPU b/devops/cts_exclude_filter_L0_GPU index d3172efdae4ab..fa45b9ac1e5cf 100644 --- a/devops/cts_exclude_filter_L0_GPU +++ b/devops/cts_exclude_filter_L0_GPU @@ -1,2 +1,4 @@ +# Please use "#" to add comments here. +# Do not delete the file even if it's empty. # CMPLRTST-26179 device diff --git a/devops/cts_exclude_filter_OCL_CPU b/devops/cts_exclude_filter_OCL_CPU index e69de29bb2d1d..44d3870b88048 100644 --- a/devops/cts_exclude_filter_OCL_CPU +++ b/devops/cts_exclude_filter_OCL_CPU @@ -0,0 +1,2 @@ +# Please use "#" to add comments here. +# Do not delete the file even if it's empty.