Skip to content

[CI] Use prebuilt E2E binaries when running on Windows Gen12 #17335

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 20 commits into from
Apr 10, 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
38 changes: 37 additions & 1 deletion .github/workflows/sycl-windows-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,25 @@ jobs:
with:
changes: ${{ needs.detect_changes.outputs.filters }}

e2e:
build-e2e:
needs: build
# Continue if build was successful.
if: |
always()
&& !cancelled()
&& needs.build.outputs.build_conclusion == 'success'
uses: ./.github/workflows/sycl-windows-run-tests.yml
with:
name: Build Windows E2E tests
runner: '["Windows", "build-e2e"]'
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
e2e_testing_mode: build-only
extra_lit_opts: --param sycl_build_targets="spir"
e2e_binaries_artifact: sycl_windows_e2ebin

run_prebuilt_e2e_tests:
needs: [build, build-e2e]
# Continue if build was successful.
if: |
always()
&& !cancelled()
Expand All @@ -63,10 +79,30 @@ jobs:
include:
- name: Intel GEN12 Graphics with Level Zero
runner: '["Windows","gen12"]'
uses: ./.github/workflows/sycl-windows-run-tests.yml
with:
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
e2e_testing_mode: run-only
e2e_binaries_artifact: sycl_windows_e2ebin

run_full_e2e_tests:
needs: build
# Continue if build was successful.
if: |
always()
&& !cancelled()
&& needs.build.outputs.build_conclusion == 'success'
strategy:
fail-fast: false
matrix:
include:
- name: Intel Battlemage Graphics with Level Zero
runner: '["Windows","bmg"]'
Comment on lines +90 to 102
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping BMG running in full mode since multiple tests seem to hang #17582

uses: ./.github/workflows/sycl-windows-run-tests.yml
with:
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
e2e_testing_mode: full
54 changes: 53 additions & 1 deletion .github/workflows/sycl-windows-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ on:
required: false
default: "cl"

e2e_testing_mode:
type: string
default: "full"

e2e_binaries_artifact:
type: string
default: ''
required: False

cts_testing_mode:
description: |
Testing mode to run SYCL-CTS in, can be either `full`, `build-only`
Expand Down Expand Up @@ -143,17 +152,36 @@ jobs:
sycl-ls
- run: |
sycl-ls --verbose

- name: Download E2E Binaries
if: ${{ inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'run-only' }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.e2e_binaries_artifact }}
- name: Extract E2E Binaries
if: ${{ inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'run-only' }}
shell: bash
run: |
mkdir build-e2e
tar -xf e2e_bin.tar.gz -C build-e2e

- name: Configure E2E with Level Zero target
if: inputs.tests_selector == 'e2e'
shell: cmd
run: |
mkdir build-e2e
cmake -GNinja -B build-e2e -S.\llvm\sycl\test-e2e -DSYCL_TEST_E2E_TARGETS="level_zero:gpu" -DCMAKE_CXX_COMPILER="clang++" -DLEVEL_ZERO_LIBS_DIR="D:\\github\\level-zero_win-sdk\\lib" -DLEVEL_ZERO_INCLUDE="D:\\github\\level-zero_win-sdk\\include" -DLLVM_LIT="..\\llvm\\llvm\\utils\\lit\\lit.py"

- name: Keep track of files after configuring E2E step
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
shell: bash
run: ls build-e2e > e2econf_files.txt

- name: Run End-to-End tests
if: inputs.tests_selector == 'e2e'
shell: bash {0}
env:
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param print_features=True ${{ inputs.extra_lit_opts }}
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param print_features=True --param test-mode=${{ inputs.e2e_testing_mode }} ${{ inputs.extra_lit_opts }}
run: |
# Run E2E tests.
if [[ ${{inputs.compiler}} == 'icx' ]]; then
Expand All @@ -169,6 +197,30 @@ jobs:
fi
exit $exit_code

# Github CI doesn't support containers on Windows, so we cannot guarantee
# that paths are the same between building and running systems. To avoid
# CMake issues related to absolute paths we reconfigure the build-e2e
# folder on the run system.
- name: Remove E2E configuration files
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
shell: bash
run: |
for FILE in $(cat e2econf_files.txt); do rm -r build-e2e/$FILE; done
rm e2econf_files.txt

- name: Pack E2E test binaries
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
shell: bash
run: |
tar -czf e2e_bin.tar.gz -C build-e2e .
- name: Upload E2E test binaries
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.e2e_binaries_artifact }}
path: e2e_bin.tar.gz
retention-days: 3

- name: Run SYCL CTS Tests
if: inputs.tests_selector == 'cts'
uses: ./devops/actions/run-tests/windows/cts
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/AOT/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//

// REQUIRES: opencl-aot, cpu
// REQUIRES: opencl-aot, cpu, opencl-cpu-rt

// CPU AOT targets host isa, so we compile on the run system instead.
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -o %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/AOT/multiple-devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: opencl-aot, ocloc, cpu, gpu, target-spir
// REQUIRES: opencl-aot, ocloc, cpu, gpu, target-spir, opencl-cpu-rt

// Produce a fat object for all targets (generic SPIR-V, CPU, GPU)
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen %S/Inputs/aot.cpp -c -o %t.o
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/AOT/reqd-sg-size.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This test ensures that a program that has a kernel
// using various required sub-group sizes can be compiled AOT.

// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
// REQUIRES: ocloc, opencl-aot, any-device-is-cpu, opencl-cpu-rt
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Adapters/cuda_queue_priority.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: gpu, cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit
// RUN: %{build} %cuda_options -o %t.out
// RUN: %{run} %t.out
//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Adapters/sycl-targets-order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="opencl:*" %t-nvptx64-spir64.out
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="cuda:*" %t-nvptx64-spir64.out

// REQUIRES: opencl, target-spir, any-triple-is-nvidia
// REQUIRES: opencl, target-spir, any-target-is-nvidia

//==------- sycl-targets-order.cpp - SYCL -fsycl-targets order test --------==//
//
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Basic/interop/make_kernel_subdevice_l0.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: level_zero, opencl, level_zero_dev_kit
// RUN: %{build} %level_zero_options -lOpenCL -o %t.ze.out
// REQUIRES: level_zero, opencl, level_zero_dev_kit, opencl_icd
// RUN: %{build} %level_zero_options %opencl_lib -o %t.ze.out
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="level_zero:*" %t.ze.out

#include <cstdlib>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %{build} %cuda_options -o %t.out
// RUN: %{run} %t.out
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit

#include <cuda.h>
#include <sycl/backend.hpp>
Expand Down
1 change: 1 addition & 0 deletions sycl/test-e2e/E2EExpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class E2EExpr(BooleanExpression):
"any-target-is-nvidia",
"any-target-is-amd",
"any-target-is-native_cpu",
"opencl-cpu-rt",
"spirv-backend",
"linux",
"system-linux",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out %cuda_options
// RUN: %{run} %t.out
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit

#include <cuda.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit
// UNSUPPORTED: cuda
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16951
// RUN: %{build} -o %t.out %cuda_options
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Graph/NativeCommand/cuda_explicit_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit

#include <cuda.h>
#include <sycl/backend.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit
// REQUIRES: aspect-usm_shared_allocations

// Test that when a host-task splits a graph into multiple backend UR
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Graph/NativeCommand/cuda_record_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit

#include <cuda.h>
#include <sycl/backend.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Graph/NativeCommand/cuda_record_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit

#include <cuda.h>
#include <sycl/backend.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Graph/NativeCommand/opencl_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run} %t.out
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %threads_lib %opencl_lib %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
// REQUIRES: opencl
// REQUIRES: opencl, opencl_icd

#include <sycl/backend.hpp>
#include <sycl/detail/cl.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit
//
// RUN: %{build} -o %t.out %cuda_options
// RUN: %{run} %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/HostInteropTask/interop-task-cuda.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %{build} -o %t.out %cuda_options
// RUN: %{run} %t.out
// REQUIRES: cuda, cuda_dev_kit
// REQUIRES: target-nvidia, cuda_dev_kit

#include <iostream>
#include <sycl/backend.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/NewOffloadDriver/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//

// REQUIRES: opencl-aot, cpu
// REQUIRES: opencl-aot, cpu, opencl-cpu-rt

// CPU AOT targets host isa, so we compile on the run system instead.
// Test with `--offload-new-driver`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// REQUIRES: opencl-aot, ocloc

// UNSUPPORTED: windows
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515
// There is no CPU device on win yet, so opencl-aot fails to compile the kernel.
// REQUIRES: opencl-aot, ocloc, opencl-cpu-rt

// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/is_compatible_with_env.cpp -o %t.out

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: opencl-aot, any-device-is-cpu
// REQUIRES: opencl-aot, opencl-cpu-rt

// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ProgramManager/uneven_kernel_split.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: any-device-is-cpu, gpu, opencl-aot, ocloc, target-spir
// REQUIRES: any-device-is-cpu, gpu, opencl-aot, ocloc, target-spir, opencl-cpu-rt

// UNSUPPORTED: linux
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17305
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/reduction_resource_leak_dw.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: level_zero, level_zero_dev_kit
// XFAIL: windows
// XFAIL: windows && run-mode
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16418
//
// RUN: %{build} %level_zero_options -o %t.out
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: opencl-aot, cpu, target-spir
// REQUIRES: opencl-aot, cpu, target-spir, opencl-cpu-rt

// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64 %S/Inputs/common.cpp -o %t_spv_cpu.out
// RUN: %{run} %t_spv_cpu.out
Expand Down
14 changes: 9 additions & 5 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,17 @@ def open_check_file(file_name):
if "amdgcn" in sp[1]:
config.sycl_build_targets.add("target-amd")

cmd = "{} {}".format(config.run_launcher, sycl_ls) if config.run_launcher else sycl_ls
sycl_ls_output = subprocess.check_output(cmd, text=True, shell=True)

# In contrast to `cpu` feature this is a compile-time feature, which is needed
# to check if we can build cpu AOT tests.
if "opencl:cpu" in sycl_ls_output:
config.available_features.add("opencl-cpu-rt")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCL CPU runtimes were installed on the windows CI machines, so those tests are now able to compile there. However I'm still introducing this feature so that we can mark the tests that would fail to compile if there is no CPU rt as requiring this. This is basically a build mode analogue of the any-device-is-cpu feature, however the reason this needs to be a separate feature rather than changing any-device-is-cpu to also be available during the build stage, is that we already use that feature to mark tests that do not necessarily need a cpu device listed to be able to compile, but do need a cpu device to be able to run.

Copy link
Contributor Author

@ayylol ayylol Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, for those who approved previously when this pr added XFAILs (@fabiomestre and @aarongreig). I changed those to require this feature instead.


if len(config.sycl_devices) == 1 and config.sycl_devices[0] == "all":
devices = set()
cmd = (
"{} {}".format(config.run_launcher, sycl_ls) if config.run_launcher else sycl_ls
)
sp = subprocess.check_output(cmd, text=True, shell=True)
for line in sp.splitlines():
for line in sycl_ls_output.splitlines():
if not line.startswith("["):
continue
(backend, device) = line[1:].split("]")[0].split(":")
Expand Down
7 changes: 5 additions & 2 deletions sycl/test-e2e/syclcompat/kernel/kernel_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

// DEFINE: %{sharedflag} = %if cl_options %{/clang:-shared%} %else %{-shared%}

// RUN: %clangxx %{sharedflag} -fsycl %{sycl_target_opts} %S\Inputs\kernel_module.cpp -o %t.dll
// RUN: %clangxx -DTEST_SHARED_LIB='"%/t.dll"' -fsycl %{sycl_target_opts} %S\Inputs\kernel_function.cpp -o %t.out
// This test is sensitive to the absolute path of the dll file produced, so we
// run the test completely on the run system to avoid issues.

// RUN: %{run-aux} %clangxx %{sharedflag} -fsycl %{sycl_target_opts} %S\Inputs\kernel_module.cpp -o %t.dll
// RUN: %{run-aux} %clangxx -DTEST_SHARED_LIB='"%/t.dll"' -fsycl %{sycl_target_opts} %S\Inputs\kernel_function.cpp -o %t.out
// RUN: %{run} %t.out