Merge branch 'xmain-disable-alignment' of https://github.com/intel-re… #4
This file contains 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
name: SYCL E2E | ||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
runner: | ||
type: string | ||
image: | ||
type: string | ||
image_options: | ||
type: string | ||
extra_cmake_args: | ||
type: string | ||
target_devices: | ||
type: string | ||
<<<<<<< HEAD:.github/workflows/linux_single_e2e.yml | ||
======= | ||
required: True | ||
extra_cmake_args: | ||
description: | | ||
If empty, then HIP_PLATFORM and AMD_ARCH would be automatically added | ||
if inputs.target_devices contains 'ext_oneapi_hip' | ||
type: string | ||
required: False | ||
tests_selector: | ||
description: | | ||
Two possible options: "e2e" and "cts". | ||
type: string | ||
default: "e2e" | ||
>>>>>>> 1f6142be74b8a5a8ffe297643a842f163dbaa8a5:.github/workflows/sycl_linux_run_tests.yml | ||
ref: | ||
type: string | ||
reset_gpu: | ||
type: string | ||
merge: | ||
type: string | ||
sycl_toolchain_artifact: | ||
type: string | ||
default: '' | ||
sycl_toolchain_archive: | ||
type: string | ||
default: '' | ||
sycl_toolchain_decompress_command: | ||
type: string | ||
default: '' | ||
<<<<<<< HEAD:.github/workflows/linux_single_e2e.yml | ||
env: | ||
type: string | ||
default: '{}' | ||
======= | ||
reset_gpu: | ||
type: string | ||
required: False | ||
install_drivers: | ||
type: string | ||
required: False | ||
env: | ||
type: string | ||
default: '{}' | ||
required: False | ||
workflow_dispatch: | ||
inputs: | ||
runner: | ||
type: choice | ||
options: | ||
- '["Linux", "gen12"]' | ||
- '["amdgpu"]' | ||
image: | ||
description: | | ||
Use option ending with ":build" for AMDGPU, ":latest" for the rest. | ||
type: choice | ||
options: | ||
- 'ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:latest' | ||
- 'ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build' | ||
image_options: | ||
description: | | ||
Use option with "--device=/dev/kfd" for AMDGPU, without it for the rest. | ||
type: choice | ||
options: | ||
- '-u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN' | ||
- '-u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN' | ||
target_devices: | ||
type: choice | ||
options: | ||
- 'opencl:cpu' | ||
- 'opencl:gpu' | ||
- 'opencl:acc' | ||
- 'ext_oneapi_level_zero:gpu' | ||
- 'ext_oneapi_hip:gpu' | ||
- 'ext_intel_esimd_emulator:gpu' | ||
tests_selector: | ||
type: choice | ||
options: | ||
- e2e | ||
- cts | ||
env: | ||
description: | | ||
Suggested variables: for E2E tests - LIT_FILTER, LIT_FILTER_OUT. | ||
LIT_OPTS won't work as we redefine it as part of this workflow. | ||
For SYCL CTS - CTS_TEST_ARGS that will be passed as an argument to the | ||
test_all executable. | ||
Format: '{"VAR1":"VAL1","VAR2":"VAL2",...}' | ||
default: '{}' | ||
install_drivers: | ||
type: choice | ||
options: | ||
- false | ||
- true | ||
>>>>>>> 1f6142be74b8a5a8ffe297643a842f163dbaa8a5:.github/workflows/sycl_linux_run_tests.yml | ||
jobs: | ||
run: | ||
name: ${{ inputs.name }} | ||
runs-on: ${{ fromJSON(inputs.runner) }} | ||
container: | ||
image: ${{ inputs.image }} | ||
options: ${{ inputs.image_options }} | ||
env: ${{ fromJSON(inputs.env) }} | ||
steps: | ||
- name: Reset GPU | ||
if: inputs.reset_gpu == 'true' | ||
run: | | ||
sudo mount -t debugfs none /sys/kernel/debug | ||
sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged' | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
sparse-checkout: | | ||
devops | ||
- name: Register cleanup after job is finished | ||
uses: ./devops/actions/cleanup | ||
- name: Checkout E2E tests | ||
if: inputs.tests_selector == 'e2e' | ||
uses: ./devops/actions/cached_checkout | ||
with: | ||
path: llvm | ||
ref: ${{ inputs.ref }} | ||
cache_path: "/__w/repo_cache/" | ||
<<<<<<< HEAD:.github/workflows/linux_single_e2e.yml | ||
merge: ${{ inputs.merge }} | ||
======= | ||
- name: Checkout SYCL CTS tests | ||
if: inputs.tests_selector == 'cts' | ||
uses: ./devops/actions/cached_checkout | ||
with: | ||
path: khronos_sycl_cts | ||
repository: 'KhronosGroup/SYCL-CTS' | ||
ref: 'SYCL-2020' | ||
default_branch: 'SYCL-2020' | ||
cache_path: "/__w/repo_cache/" | ||
- name: SYCL CTS GIT submodules init | ||
if: inputs.tests_selector == 'cts' | ||
run: | | ||
git -C khronos_sycl_cts submodule update --init | ||
>>>>>>> 1f6142be74b8a5a8ffe297643a842f163dbaa8a5:.github/workflows/sycl_linux_run_tests.yml | ||
- name: Install drivers | ||
if: inputs.install_drivers == 'true' | ||
run: | | ||
# TODO install into image | ||
sudo apt install -yq jq | ||
sudo cp devops/scripts/get_release.py /opt/ | ||
sudo -E devops/scripts/install_drivers.sh llvm/devops/dependencies.json --all | ||
- name: Install drivers (deprecated CI interface) | ||
if: env.compute_runtime_tag != '' && inputs.install_drivers != 'true' | ||
run: | | ||
if [ -e /opt/install_drivers.sh ]; then | ||
# TODO pack this script into container | ||
sudo cp devops/scripts/get_release.py /opt/ | ||
sudo -E /opt/install_drivers.sh --all | ||
fi | ||
- name: Source OneAPI TBB vars.sh | ||
shell: bash | ||
run: | | ||
# https://github.com/actions/runner/issues/1964 prevents us from using | ||
# the ENTRYPOINT in the image. | ||
env | sort > env_before | ||
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then | ||
source /runtimes/oneapi-tbb/env/vars.sh; | ||
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then | ||
source /opt/runtimes/oneapi-tbb/env/vars.sh; | ||
else | ||
echo "no TBB vars in /opt/runtimes or /runtimes"; | ||
fi | ||
env | sort > env_after | ||
comm -13 env_before env_after >> $GITHUB_ENV | ||
rm env_before env_after | ||
- name: Download SYCL toolchain | ||
if: inputs.sycl_toolchain_artifact != '' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.sycl_toolchain_artifact }} | ||
- name: Extract/Setup SYCL toolchain | ||
if: inputs.sycl_toolchain_artifact != '' | ||
run: | | ||
mkdir toolchain | ||
tar -I '${{ inputs.sycl_toolchain_decompress_command }}' -xf ${{ inputs.sycl_toolchain_archive }} -C toolchain | ||
rm -f ${{ inputs.sycl_toolchain_archive }} | ||
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV | ||
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV | ||
- run: which clang++ sycl-ls | ||
- run: sycl-ls --verbose | ||
- run: SYCL_PI_TRACE=-1 sycl-ls | ||
<<<<<<< HEAD:.github/workflows/linux_single_e2e.yml | ||
- name: Configure | ||
======= | ||
- name: Deduce E2E CMake options | ||
if: inputs.tests_selector == 'e2e' | ||
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 | ||
else | ||
if [ "${{ contains(inputs.target_devices, 'ext_oneapi_hip') }}" == "true" ]; then | ||
echo 'opts=-DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"' >> $GITHUB_OUTPUT | ||
else | ||
echo 'opts=' >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
- name: Configure E2E tests | ||
if: inputs.tests_selector == 'e2e' | ||
>>>>>>> 1f6142be74b8a5a8ffe297643a842f163dbaa8a5:.github/workflows/sycl_linux_run_tests.yml | ||
run: | | ||
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.target_devices }}" -DCMAKE_CXX_COMPILER="$(which clang++)" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ inputs.extra_cmake_args }} | ||
- name: SYCL End-to-end tests | ||
if: inputs.tests_selector == 'e2e' | ||
env: | ||
LIT_OPTS: -v --no-progress-bar --show-unsupported --max-time 3600 --time-tests | ||
run: | | ||
ninja -C build-e2e check-sycl-e2e | ||
- name: Build SYCL CTS tests | ||
if: inputs.tests_selector == 'cts' | ||
env: | ||
CMAKE_EXTRA_ARGS: ${{ inputs.extra_cmake_args }} | ||
run: | | ||
cmake -GNinja -B./build-cts -S./khronos_sycl_cts -DCMAKE_CXX_COMPILER=$(which clang++) \ | ||
-DSYCL_IMPLEMENTATION=DPCPP \ | ||
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$PWD/devops/cts_exclude_filter" \ | ||
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \ | ||
-DSYCL_CTS_MEASURE_BUILD_TIMES=ON \ | ||
-DDPCPP_INSTALL_DIR="$$(dirname (which clang++))/.." \ | ||
$CMAKE_EXTRA_ARGS | ||
ninja -C build-cts | ||
- name: Run SYCL CTS tests | ||
if: inputs.tests_selector == 'cts' | ||
env: | ||
ONEAPI_DEVICE_SELECTOR: ${{ inputs.target_devices }} | ||
run: | | ||
./build-cts/bin/test_all --list-devices | ||
./build-cts/bin/test_all $CTS_TEST_ARGS |