Skip to content

Commit 2ee62ad

Browse files
authored
[CI] Use prebuilt E2E binaries when running on Windows Gen12 (#17335)
Windows Gen12 job, previously took around 42min. With prebuilt binaries building the e2e tests takes around 12min, and running them took around 6min.
1 parent 585606a commit 2ee62ad

27 files changed

+128
-36
lines changed

.github/workflows/sycl-windows-precommit.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,25 @@ jobs:
5050
with:
5151
changes: ${{ needs.detect_changes.outputs.filters }}
5252

53-
e2e:
53+
build-e2e:
5454
needs: build
5555
# Continue if build was successful.
56+
if: |
57+
always()
58+
&& !cancelled()
59+
&& needs.build.outputs.build_conclusion == 'success'
60+
uses: ./.github/workflows/sycl-windows-run-tests.yml
61+
with:
62+
name: Build Windows E2E tests
63+
runner: '["Windows", "build-e2e"]'
64+
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
65+
e2e_testing_mode: build-only
66+
extra_lit_opts: --param sycl_build_targets="spir"
67+
e2e_binaries_artifact: sycl_windows_e2ebin
68+
69+
run_prebuilt_e2e_tests:
70+
needs: [build, build-e2e]
71+
# Continue if build was successful.
5672
if: |
5773
always()
5874
&& !cancelled()
@@ -63,10 +79,30 @@ jobs:
6379
include:
6480
- name: Intel GEN12 Graphics with Level Zero
6581
runner: '["Windows","gen12"]'
82+
uses: ./.github/workflows/sycl-windows-run-tests.yml
83+
with:
84+
name: ${{ matrix.name }}
85+
runner: ${{ matrix.runner }}
86+
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
87+
e2e_testing_mode: run-only
88+
e2e_binaries_artifact: sycl_windows_e2ebin
89+
90+
run_full_e2e_tests:
91+
needs: build
92+
# Continue if build was successful.
93+
if: |
94+
always()
95+
&& !cancelled()
96+
&& needs.build.outputs.build_conclusion == 'success'
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
include:
66101
- name: Intel Battlemage Graphics with Level Zero
67102
runner: '["Windows","bmg"]'
68103
uses: ./.github/workflows/sycl-windows-run-tests.yml
69104
with:
70105
name: ${{ matrix.name }}
71106
runner: ${{ matrix.runner }}
72107
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
108+
e2e_testing_mode: full

.github/workflows/sycl-windows-run-tests.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ on:
6363
required: false
6464
default: "cl"
6565

66+
e2e_testing_mode:
67+
type: string
68+
default: "full"
69+
70+
e2e_binaries_artifact:
71+
type: string
72+
default: ''
73+
required: False
74+
6675
cts_testing_mode:
6776
description: |
6877
Testing mode to run SYCL-CTS in, can be either `full`, `build-only`
@@ -143,17 +152,36 @@ jobs:
143152
sycl-ls
144153
- run: |
145154
sycl-ls --verbose
155+
156+
- name: Download E2E Binaries
157+
if: ${{ inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'run-only' }}
158+
uses: actions/download-artifact@v4
159+
with:
160+
name: ${{ inputs.e2e_binaries_artifact }}
161+
- name: Extract E2E Binaries
162+
if: ${{ inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'run-only' }}
163+
shell: bash
164+
run: |
165+
mkdir build-e2e
166+
tar -xf e2e_bin.tar.gz -C build-e2e
167+
146168
- name: Configure E2E with Level Zero target
147169
if: inputs.tests_selector == 'e2e'
148170
shell: cmd
149171
run: |
150172
mkdir build-e2e
151173
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"
174+
175+
- name: Keep track of files after configuring E2E step
176+
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
177+
shell: bash
178+
run: ls build-e2e > e2econf_files.txt
179+
152180
- name: Run End-to-End tests
153181
if: inputs.tests_selector == 'e2e'
154182
shell: bash {0}
155183
env:
156-
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 }}
184+
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 }}
157185
run: |
158186
# Run E2E tests.
159187
if [[ ${{inputs.compiler}} == 'icx' ]]; then
@@ -169,6 +197,30 @@ jobs:
169197
fi
170198
exit $exit_code
171199
200+
# Github CI doesn't support containers on Windows, so we cannot guarantee
201+
# that paths are the same between building and running systems. To avoid
202+
# CMake issues related to absolute paths we reconfigure the build-e2e
203+
# folder on the run system.
204+
- name: Remove E2E configuration files
205+
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
206+
shell: bash
207+
run: |
208+
for FILE in $(cat e2econf_files.txt); do rm -r build-e2e/$FILE; done
209+
rm e2econf_files.txt
210+
211+
- name: Pack E2E test binaries
212+
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
213+
shell: bash
214+
run: |
215+
tar -czf e2e_bin.tar.gz -C build-e2e .
216+
- name: Upload E2E test binaries
217+
if: ${{ always() && inputs.tests_selector == 'e2e' && inputs.e2e_testing_mode == 'build-only' }}
218+
uses: actions/upload-artifact@v4
219+
with:
220+
name: ${{ inputs.e2e_binaries_artifact }}
221+
path: e2e_bin.tar.gz
222+
retention-days: 3
223+
172224
- name: Run SYCL CTS Tests
173225
if: inputs.tests_selector == 'cts'
174226
uses: ./devops/actions/run-tests/windows/cts

sycl/test-e2e/AOT/cpu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===---------------------------------------------------------------------===//
88

9-
// REQUIRES: opencl-aot, cpu
9+
// REQUIRES: opencl-aot, cpu, opencl-cpu-rt
1010

1111
// CPU AOT targets host isa, so we compile on the run system instead.
1212
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -o %t.out

sycl/test-e2e/AOT/multiple-devices.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

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

1111
// Produce a fat object for all targets (generic SPIR-V, CPU, GPU)
1212
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64,spir64_gen %S/Inputs/aot.cpp -c -o %t.o

sycl/test-e2e/AOT/reqd-sg-size.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test ensures that a program that has a kernel
22
// using various required sub-group sizes can be compiled AOT.
33

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

sycl/test-e2e/Adapters/cuda_queue_priority.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: gpu, cuda, cuda_dev_kit
1+
// REQUIRES: target-nvidia, cuda_dev_kit
22
// RUN: %{build} %cuda_options -o %t.out
33
// RUN: %{run} %t.out
44
//

sycl/test-e2e/Adapters/sycl-targets-order.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="opencl:*" %t-nvptx64-spir64.out
66
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="cuda:*" %t-nvptx64-spir64.out
77

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

1010
//==------- sycl-targets-order.cpp - SYCL -fsycl-targets order test --------==//
1111
//

sycl/test-e2e/Basic/interop/make_kernel_subdevice_l0.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// REQUIRES: level_zero, opencl, level_zero_dev_kit
2-
// RUN: %{build} %level_zero_options -lOpenCL -o %t.ze.out
1+
// REQUIRES: level_zero, opencl, level_zero_dev_kit, opencl_icd
2+
// RUN: %{build} %level_zero_options %opencl_lib -o %t.ze.out
33
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="level_zero:*" %t.ze.out
44

55
#include <cstdlib>

sycl/test-e2e/DeviceImageBackendContent/CUDA_interop_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %{build} %cuda_options -o %t.out
22
// RUN: %{run} %t.out
3-
// REQUIRES: cuda, cuda_dev_kit
3+
// REQUIRES: target-nvidia, cuda_dev_kit
44

55
#include <cuda.h>
66
#include <sycl/backend.hpp>

sycl/test-e2e/E2EExpr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class E2EExpr(BooleanExpression):
1414
"any-target-is-nvidia",
1515
"any-target-is-amd",
1616
"any-target-is-native_cpu",
17+
"opencl-cpu-rt",
1718
"spirv-backend",
1819
"linux",
1920
"system-linux",

sycl/test-e2e/EnqueueNativeCommand/custom-command-cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out %cuda_options
22
// RUN: %{run} %t.out
3-
// REQUIRES: cuda, cuda_dev_kit
3+
// REQUIRES: target-nvidia, cuda_dev_kit
44

55
#include <cuda.h>
66

sycl/test-e2e/EnqueueNativeCommand/custom-command-multiple-dev-cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: cuda, cuda_dev_kit
1+
// REQUIRES: target-nvidia, cuda_dev_kit
22
// UNSUPPORTED: cuda
33
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16951
44
// RUN: %{build} -o %t.out %cuda_options

sycl/test-e2e/Graph/NativeCommand/cuda_explicit_usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
5-
// REQUIRES: cuda, cuda_dev_kit
5+
// REQUIRES: target-nvidia, cuda_dev_kit
66

77
#include <cuda.h>
88
#include <sycl/backend.hpp>

sycl/test-e2e/Graph/NativeCommand/cuda_multiple_native_commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
5-
// REQUIRES: cuda, cuda_dev_kit
5+
// REQUIRES: target-nvidia, cuda_dev_kit
66
// REQUIRES: aspect-usm_shared_allocations
77

88
// Test that when a host-task splits a graph into multiple backend UR

sycl/test-e2e/Graph/NativeCommand/cuda_record_buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
5-
// REQUIRES: cuda, cuda_dev_kit
5+
// REQUIRES: target-nvidia, cuda_dev_kit
66

77
#include <cuda.h>
88
#include <sycl/backend.hpp>

sycl/test-e2e/Graph/NativeCommand/cuda_record_usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %cuda_options %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
5-
// REQUIRES: cuda, cuda_dev_kit
5+
// REQUIRES: target-nvidia, cuda_dev_kit
66

77
#include <cuda.h>
88
#include <sycl/backend.hpp>

sycl/test-e2e/Graph/NativeCommand/opencl_buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %threads_lib %opencl_lib %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
5-
// REQUIRES: opencl
5+
// REQUIRES: opencl, opencl_icd
66

77
#include <sycl/backend.hpp>
88
#include <sycl/detail/cl.h>

sycl/test-e2e/HostInteropTask/interop-task-cuda-buffer-migrate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: cuda, cuda_dev_kit
1+
// REQUIRES: target-nvidia, cuda_dev_kit
22
//
33
// RUN: %{build} -o %t.out %cuda_options
44
// RUN: %{run} %t.out

sycl/test-e2e/HostInteropTask/interop-task-cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %{build} -o %t.out %cuda_options
22
// RUN: %{run} %t.out
3-
// REQUIRES: cuda, cuda_dev_kit
3+
// REQUIRES: target-nvidia, cuda_dev_kit
44

55
#include <iostream>
66
#include <sycl/backend.hpp>

sycl/test-e2e/NewOffloadDriver/cpu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===---------------------------------------------------------------------===//
88

9-
// REQUIRES: opencl-aot, cpu
9+
// REQUIRES: opencl-aot, cpu, opencl-cpu-rt
1010

1111
// CPU AOT targets host isa, so we compile on the run system instead.
1212
// Test with `--offload-new-driver`

sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// REQUIRES: opencl-aot, ocloc
2-
3-
// UNSUPPORTED: windows
4-
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515
5-
// There is no CPU device on win yet, so opencl-aot fails to compile the kernel.
1+
// REQUIRES: opencl-aot, ocloc, opencl-cpu-rt
62

73
// 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
84

sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: opencl-aot, any-device-is-cpu
1+
// REQUIRES: opencl-aot, opencl-cpu-rt
22

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

sycl/test-e2e/ProgramManager/uneven_kernel_split.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: any-device-is-cpu, gpu, opencl-aot, ocloc, target-spir
1+
// REQUIRES: any-device-is-cpu, gpu, opencl-aot, ocloc, target-spir, opencl-cpu-rt
22

33
// UNSUPPORTED: linux
44
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17305

sycl/test-e2e/Regression/reduction_resource_leak_dw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: level_zero, level_zero_dev_kit
2-
// XFAIL: windows
2+
// XFAIL: windows && run-mode
33
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16418
44
//
55
// RUN: %{build} %level_zero_options -o %t.out

sycl/test-e2e/SpecConstants/2020/non_native/multiple-targets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: opencl-aot, cpu, target-spir
1+
// REQUIRES: opencl-aot, cpu, target-spir, opencl-cpu-rt
22

33
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_x86_64 %S/Inputs/common.cpp -o %t_spv_cpu.out
44
// RUN: %{run} %t_spv_cpu.out

sycl/test-e2e/lit.cfg.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,17 @@ def open_check_file(file_name):
620620
if "amdgcn" in sp[1]:
621621
config.sycl_build_targets.add("target-amd")
622622

623+
cmd = "{} {}".format(config.run_launcher, sycl_ls) if config.run_launcher else sycl_ls
624+
sycl_ls_output = subprocess.check_output(cmd, text=True, shell=True)
625+
626+
# In contrast to `cpu` feature this is a compile-time feature, which is needed
627+
# to check if we can build cpu AOT tests.
628+
if "opencl:cpu" in sycl_ls_output:
629+
config.available_features.add("opencl-cpu-rt")
630+
623631
if len(config.sycl_devices) == 1 and config.sycl_devices[0] == "all":
624632
devices = set()
625-
cmd = (
626-
"{} {}".format(config.run_launcher, sycl_ls) if config.run_launcher else sycl_ls
627-
)
628-
sp = subprocess.check_output(cmd, text=True, shell=True)
629-
for line in sp.splitlines():
633+
for line in sycl_ls_output.splitlines():
630634
if not line.startswith("["):
631635
continue
632636
(backend, device) = line[1:].split("]")[0].split(":")

sycl/test-e2e/syclcompat/kernel/kernel_win.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

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

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

0 commit comments

Comments
 (0)