-
Notifications
You must be signed in to change notification settings - Fork 790
[CI][sycl-rel] Pull some changes from sycl branch #16816
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
name: 'Run SYCL CTS tests' | ||
|
||
inputs: | ||
extra_cmake_args: | ||
required: false | ||
cts_testing_mode: | ||
required: true | ||
sycl_cts_artifact: | ||
require: false | ||
target_devices: | ||
required: true | ||
retention-days: | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout SYCL CTS tests | ||
if: inputs.cts_testing_mode != 'run-only' | ||
uses: ./devops/actions/cached_checkout | ||
with: | ||
path: khronos_sycl_cts | ||
repository: 'KhronosGroup/SYCL-CTS' | ||
ref: 'main' | ||
default_branch: 'main' | ||
cache_path: "/__w/repo_cache/" | ||
- name: SYCL CTS GIT submodules init | ||
if: inputs.cts_testing_mode != 'run-only' | ||
shell: bash | ||
run: | | ||
git -C khronos_sycl_cts submodule update --init | ||
- name: Build SYCL CTS tests | ||
if: inputs.sycl_cts_artifact == '' | ||
shell: bash | ||
env: | ||
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }} | ||
run: | | ||
cts_exclude_filter="" | ||
# If CTS_TESTS_TO_BUILD is null - use filter | ||
if [ -z "$CTS_TESTS_TO_BUILD" ]; then | ||
if [ "${{ contains(inputs.cts_testing_mode, 'build-only') }}" = "true" ]; then | ||
cts_exclude_filter=$PWD/devops/cts_exclude_filter_compfails | ||
elif [ "${{ 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 | ||
|
||
# List excluded SYCL CTS categories: | ||
# SYCL_CTS_EXCLUDE_TEST_CATEGORIES - Optional file specifying a list | ||
# of test categories to be excluded from the build. | ||
echo "::group::Excluded test categories" | ||
cat $cts_exclude_filter | ||
echo "::endgroup::" | ||
fi | ||
|
||
cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER=$(which clang++) \ | ||
-DSYCL_IMPLEMENTATION=DPCPP \ | ||
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$cts_exclude_filter" \ | ||
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \ | ||
-DDPCPP_INSTALL_DIR="$(dirname $(which clang++))/.." \ | ||
$CMAKE_EXTRA_ARGS | ||
# Ignore errors so that if one category build fails others still have a | ||
# chance to finish and be executed at the run stage. Note that | ||
# "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' | ||
shell: bash | ||
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 != '' | ||
shell: bash | ||
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: (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only' | ||
shell: bash | ||
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: (always() && !cancelled()) && inputs.cts_testing_mode != 'build-only' | ||
env: | ||
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }} | ||
# By-default GitHub actions execute the "run" shell script with -e option, | ||
# so the execution terminates if any command returns a non-zero status. | ||
# Since we're using a loop to run all test-binaries separately, some test | ||
# may fail and terminate the execution. Setting "shell" value to override | ||
# the default behavior. | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell | ||
shell: bash {0} | ||
run: | | ||
# Run each test category separately so that | ||
# - crash on one would not affect others | ||
# - multiple tests could be run in parallel | ||
mkdir logs | ||
find build-cts/bin/ -type f -print | \ | ||
xargs -t -I % -P 8 sh -c 'log=logs/$(basename %).log ; echo % >$log ; date >>$log ; timeout 60m % >>$log 2>&1 ; ret=$? ; echo "exit code: $ret" >>$log ; date >>$log ; exit $ret' | ||
ret=$? | ||
|
||
for f in logs/* ; do | ||
echo "::group::$f" | ||
cat $f | ||
echo "::endgroup::" | ||
done | ||
|
||
echo "::group::Fails:" | ||
grep 'exit code: [^0]' -r logs | ||
echo "::endgroup::" | ||
|
||
grep 'exit code: [^0]' -r logs >> $GITHUB_STEP_SUMMARY | ||
|
||
exit $ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: 'Run SYCL E2E tests' | ||
|
||
inputs: | ||
ref: | ||
required: false | ||
binaries_artifact: | ||
required: false | ||
testing_mode: | ||
required: true | ||
extra_cmake_args: | ||
required: false | ||
target_devices: | ||
required: true | ||
extra_lit_opts: | ||
required: false | ||
retention-days: | ||
required: false | ||
cxx_compiler: | ||
required: false | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout E2E tests | ||
uses: ./devops/actions/cached_checkout | ||
with: | ||
path: llvm | ||
ref: ${{ inputs.ref || github.sha }} | ||
cache_path: "/__w/repo_cache/" | ||
|
||
- name: Download E2E Binaries | ||
if: inputs.testing_mode == 'run-only' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.binaries_artifact }} | ||
- name: Extract E2E Binaries | ||
if: inputs.testing_mode == 'run-only' | ||
shell: bash | ||
run: | | ||
mkdir build-e2e | ||
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e | ||
|
||
- name: Deduce E2E CMake options | ||
if: inputs.testing_mode != 'run-only' | ||
id: cmake_opts | ||
shell: bash | ||
env: | ||
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }} | ||
run: | | ||
if [ -n "$CMAKE_EXTRA_ARGS" ]; then | ||
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Configure E2E tests | ||
if: inputs.testing_mode != 'run-only' | ||
shell: bash | ||
run: | | ||
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler || '$(which clang++)'}}" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }} | ||
- name: SYCL End-to-end tests | ||
shell: bash {0} | ||
env: | ||
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param test-mode=${{ inputs.testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }} | ||
run: | | ||
ninja -C build-e2e check-sycl-e2e > e2e.log 2>&1 | ||
exit_code=$? | ||
cat e2e.log | ||
if [ $exit_code -ne 0 ]; then | ||
awk '/^Failed Tests|Unexpectedly Passed Tests|Unresolved tests|Timed Out Tests|Testing Time/{flag=1}/FAILED: CMakeFiles/{flag=0}flag' e2e.log >> $GITHUB_STEP_SUMMARY | ||
fi | ||
exit $exit_code | ||
|
||
- name: Pack E2E binaries | ||
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}} | ||
shell: bash | ||
run: | | ||
tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C ./build-e2e . | ||
- name: Upload E2E binaries | ||
if: ${{ always() && !cancelled() && inputs.binaries_artifact != '' && inputs.testing_mode != 'run-only'}} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.binaries_artifact }} | ||
path: e2e_binaries.tar.zst | ||
retention-days: ${{ inputs.retention-days }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# These categories require patches not included in this release | ||
language | ||
multi_ptr | ||
header | ||
device |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# These categories require patches not included in this release | ||
language | ||
multi_ptr | ||
header |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is meaningless without the part in
.github/workflows/sycl-linux-run-tests.yml
, yet I don't see that here. Can you clarify?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the thing is that we use workflows from
sycl
branch insycl-rel nightly
, but thedevops
dir fromsycl-rel
branch. I assume that may be we should usedevops
fromsycl
branch for both builds, but the build may be somehow not compatible with new dependencies / cts tests and so on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aelovikov-intel any other comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use
devops/actions
fromsycl
branch? And the configs/deps fromsycl-rel
.