Skip to content

Commit f279a8a

Browse files
authored
[SYCL][E2E] Add functionality to split build and run of e2e tests (#16016)
Adds functionality to split the compilation and execution of e2e tests across separate machines. This functionality is enabled via the `test-mode` lit parameter. By default this is set to `full` and tests are built and ran on the same system, just like before. setting `test-mode` to either `run-only` or `build-only` enables the test splitting. Two new lit features have been added: `run-mode` which is enabled when either in `run-only` or `full` testing mode, and `build-and-run-mode` which is only enabled when in `full` testing mode. When in `build-only` mode all tests that can be built on the system will be built. When running a lit test in this mode two key things change: - All `RUN:` lines will be executed unless they contain `%{run}`, `%{run-unfiltered-devices}` or `%if run-mode`. - Unsupported and requires statements are ignored. Currently the only way to mark tests as unsupported in build only mode is to include `build-and-run-mode` in a requires statement, or use `UNSUPPORTED: true`. When in `run-only` mode tests are not built, they are only executed. Deciding whether a test is supported in this mode works the same as in `full` mode. To only execute the tests we ignore all lit `RUN:` lines unless they contain `%{run}`, `%{run-unfiltered-devices}` or `%if run-mode`. Since we do not build the tests in this mode, for any test to pass we must have ran the tests in either `build-only` or `full` modes. ### Some notes/current limitations: - Currently only the spir64 triple is supported for the build only mode. - If a test is able to build, but fails during running we need to mark it as `XFAILS: run-mode` so that it does not `XPASS` when in build-only mode. - The build-only mode can be ran manually on CI with the `SYCL E2E` action, selecting the "Linux, build" runner, and adding `--param test-mode=build-only` to `LIT_OPTS`. This pr does not have the needed CI changes to be able to use the run only mode.
1 parent 1e1ffc0 commit f279a8a

File tree

74 files changed

+138
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+138
-62
lines changed

sycl/test-e2e/AmdNvidiaJIT/kernel_and_bundle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// UNSUPPORTED: windows
22
// REQUIRES: cuda || hip
3+
// REQUIRES: build-and-run-mode
34

45
// This test relies on debug output from a pass, make sure that the compiler
56
// can generate it.

sycl/test-e2e/Basic/windows_version_agnostic_sycl_lib.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// REQUIRES: windows
2+
// REQUIRES: build-and-run-mode
23

34
// RUN: %clangxx --driver-mode=cl /std:c++17 /EHsc /imsvc %sycl_include -I%opencl_include_dir %s -o %t.out /link /defaultlib:%sycl_static_libs_dir/sycl.lib
45
// RUN: %{run} %t.out
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// using --offload-compress without zstd should throw an error.
22
// REQUIRES: !zstd
3+
// REQUIRES: build-and-run-mode
34
// RUN: not %{build} %O0 -g --offload-compress %S/Inputs/single_kernel.cpp -o %t_compress.out 2>&1 | FileCheck %s
45
// CHECK: '--offload-compress' option is specified but zstd is not available. The device image will not be compressed.

sycl/test-e2e/Config/config.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// RUN: %{build} %debug_option %O0 -o %t.out
99
// RUN: echo SYCL_PRINT_EXECUTION_GRAPH=always > %t.cfg
1010
// RUN: %{run-unfiltered-devices} env SYCL_CONFIG_FILE_NAME=%t.cfg %t.out
11-
// RUN: cat *.dot > /dev/null
12-
// RUN: rm *.dot
11+
// RUN: %if run-mode %{cat *.dot > /dev/null%}
12+
// RUN: %if run-mode %{rm *.dot%}
1313
// RUN: %{run-unfiltered-devices} env SYCL_PRINT_EXECUTION_GRAPH=always %t.out
14-
// RUN: cat *.dot > /dev/null
15-
// RUN: rm *.dot
14+
// RUN: %if run-mode %{cat *.dot > /dev/null%}
15+
// RUN: %if run-mode %{rm *.dot%}
1616
// RUN: %{run-unfiltered-devices} %t.out
17-
// RUN: not cat *.dot > /dev/null
17+
// RUN: %if run-mode %{not cat *.dot > /dev/null%}
1818

1919
#include <sycl/detail/core.hpp>
2020

sycl/test-e2e/DeviceArchitecture/device_architecture_comparison_on_device_aot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: arch-intel_gpu_pvc, ocloc
22

3-
// XFAIL: arch-intel_gpu_pvc
3+
// XFAIL: run-mode
44
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/14826
55

66
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_pvc %s -o %t.out

sycl/test-e2e/DeviceLib/math_fp64_windows_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// REQUIRES: aspect-fp64, windows
2+
// REQUIRES: build-and-run-mode
23

34
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
45

sycl/test-e2e/DeviceLib/math_windows_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// REQUIRES: windows
2+
// REQUIRES: build-and-run-mode
23

34
// TODO: Add hypotf case back when the missing symbol is fixed.
45

sycl/test-e2e/ESIMD/PerformanceTests/BitonicSortK.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// RUN: mkdir -p %t.dir && %{build} -o %t.dir/exec.out
1212
// RUN: env IGC_DumpToCustomDir=%t.dir IGC_ShaderDumpEnable=1 %{run} %t.dir/exec.out
13-
// RUN: python3 %S/instruction_count.py %t.dir 2914 ZTSZZN11BitonicSort5SolveEPjS0_jENKUlRN4sycl3_V17handlerEE0_clES4_E5Merge.asm
14-
// RUN: echo "Baseline from driver version 1.3.30872"
13+
// RUN: %if run-mode %{python3 %S/instruction_count.py %t.dir 2914 ZTSZZN11BitonicSort5SolveEPjS0_jENKUlRN4sycl3_V17handlerEE0_clES4_E5Merge.asm%}
14+
// RUN: %if run-mode %{echo "Baseline from driver version 1.3.30872"%}
1515

1616
#include "../BitonicSortK.cpp"

sycl/test-e2e/ESIMD/PerformanceTests/BitonicSortKv2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// RUN: mkdir -p %t.dir && %{build} -o %t.dir/exec.out
1212
// RUN: env IGC_DumpToCustomDir=%t.dir IGC_ShaderDumpEnable=1 %{run} %t.dir/exec.out
13-
// RUN: python3 %S/instruction_count.py %t.dir 2969 ZTSZZN11BitonicSort5SolveEPjS0_jENKUlRN4sycl3_V17handlerEE0_clES4_E5Merge.asm
14-
// RUN: echo "Baseline from driver version 1.3.30872"
13+
// RUN: %if run-mode %{python3 %S/instruction_count.py %t.dir 2969 ZTSZZN11BitonicSort5SolveEPjS0_jENKUlRN4sycl3_V17handlerEE0_clES4_E5Merge.asm%}
14+
// RUN: %if run-mode %{echo "Baseline from driver version 1.3.30872"%}
1515

1616
#include "../BitonicSortKv2.cpp"

sycl/test-e2e/ESIMD/PerformanceTests/Stencil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// RUN: mkdir -p %t.dir && %{build} -o %t.dir/exec.out
1212
// RUN: env IGC_DumpToCustomDir=%t.dir IGC_ShaderDumpEnable=1 %{run} %t.dir/exec.out
13-
// RUN: python3 %S/instruction_count.py %t.dir 1699 ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E14Stencil_kernel.asm
14-
// RUN: echo "Baseline from driver version 1.3.29138"
13+
// RUN: %if run-mode %{python3 %S/instruction_count.py %t.dir 1699 ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E14Stencil_kernel.asm%}
14+
// RUN: %if run-mode %{echo "Baseline from driver version 1.3.29138"%}
1515

16-
#include "../Stencil.cpp"
16+
#include "../Stencil.cpp"

0 commit comments

Comments
 (0)