Skip to content

Commit 35f944f

Browse files
[CI] Move SPIRV-backend testing to post-commit (#19669)
Development happens mostly upstream, so there is no need to have that in pre-commit, post-commit should be enough. Before this PR, when running E2E tests in "in-tree" mode (as opposite to a standalone e2e tests cmake invocation), some utilities (e.g. `llvm-ar`) were only searched for in `PATH` that didn't contain freshly built toolchain. Our pre-commit used a container image with last successful "Nightly" toolchain installed, so those were picked up from there. Post-commit uses GNU Compiler instead of Clang, so these utilities aren't available in `PATH`. This PR modifies`lit.cfg.py` such that we search for those utilities in the newly built toolchain first (still not modifying `PATH` which seems to be the approach taken in LIT). That also ensures that `opencl-aot` feature is available when running E2E tests in `build-only` mode in Post-commit's build job.
1 parent 1ef3069 commit 35f944f

File tree

5 files changed

+23
-30
lines changed

5 files changed

+23
-30
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060

6161
toolchain_artifact: sycl_linux_default
6262
e2e_binaries_artifact: e2e_bin
63-
e2e_binaries_spirv_backend_artifact: e2e_bin_spirv_backend
6463
e2e_binaries_preview_artifact: e2e_bin_preview
6564

6665
# If a PR changes CUDA adapter, run the build on Ubuntu 22.04 as well.
@@ -129,12 +128,6 @@ jobs:
129128
runner: '["Linux", "bmg"]'
130129
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
131130
target_devices: level_zero_v1:gpu;level_zero_v2:gpu
132-
- name: SPIR-V Backend / Intel Battlemage Graphics
133-
runner: '["Linux", "bmg"]'
134-
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
135-
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
136-
extra_lit_opts: --param spirv-backend=True
137-
e2e_binaries_artifact: e2e_bin_spirv_backend
138131
- name: Preview Mode
139132
runner: '["Linux", "gen12"]'
140133
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN

.github/workflows/sycl-post-commit.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
build_configure_extra_args: --no-assertions --hip --cuda --native_cpu -DSYCL_ENABLE_STACK_PRINTING=ON -DSYCL_LIB_WITH_DEBUG_SYMBOL=ON
4444

4545
toolchain_artifact: sycl_linux_default
46+
e2e_binaries_spirv_backend_artifact: e2e_bin_spirv_backend
4647

4748
e2e-lin:
4849
needs: [detect_changes, build-lin]
@@ -73,6 +74,13 @@ jobs:
7374
env: '{"LIT_FILTER":"PerformanceTests/"}'
7475
extra_lit_opts: -a -j 1 --param enable-perf-tests=True
7576
target_devices: all
77+
- name: SPIR-V Backend / Intel Battlemage Graphics
78+
runner: '["Linux", "bmg"]'
79+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
80+
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
81+
extra_lit_opts: --param spirv-backend=True
82+
e2e_binaries_artifact: e2e_bin_spirv_backend
83+
e2e_testing_mode: 'run-only'
7684
uses: ./.github/workflows/sycl-linux-run-tests.yml
7785
with:
7886
name: ${{ matrix.name }}
@@ -89,6 +97,9 @@ jobs:
8997
toolchain_artifact_filename: ${{ needs.build-lin.outputs.toolchain_artifact_filename }}
9098
toolchain_decompress_command: ${{ needs.build-lin.outputs.toolchain_decompress_command }}
9199

100+
e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact }}
101+
e2e_testing_mode: ${{ matrix.e2e_testing_mode || 'full' }}
102+
92103
# Do not install drivers on AMD and CUDA runners.
93104
install_igc_driver: >-
94105
${{ github.event_name == 'pull_request' }} &&

sycl/test-e2e/Graph/Explicit/interop-level-zero-get-native-mem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// UNSUPPORTED: ze_debug
33
// UNSUPPORTED-INTENDED: Leaks detection is done at UR level and doesn't account
44
// for native L0 API calls.
5-
// UNSUPPORTED: linux && gpu-intel-dg2 && run-mode && !igc-dev
5+
// UNSUPPORTED: linux && (gpu-intel-dg2 || arch-intel_gpu_bmg_g21) && run-mode && !igc-dev
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/18273
77
// RUN: %{build} %level_zero_options -o %t.out
88
// RUN: %{run} %t.out

sycl/test-e2e/Graph/RecordReplay/interop-level-zero-get-native-mem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// UNSUPPORTED: ze_debug
33
// UNSUPPORTED-INTENDED: Leaks detection is done at UR level and doesn't account
44
// for native L0 API calls.
5-
// UNSUPPORTED: linux && gpu-intel-dg2 && run-mode && !igc-dev
5+
// UNSUPPORTED: linux && (gpu-intel-dg2 || arch-intel_gpu_bmg_g21) && run-mode && !igc-dev
66
// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/18273
77
// RUN: %{build} %level_zero_options -o %t.out
88
// RUN: %{run} %t.out

sycl/test-e2e/lit.cfg.py

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -650,12 +650,6 @@ def open_check_file(file_name):
650650
if not sycl_ls:
651651
lit_config.fatal("can't find `sycl-ls`")
652652

653-
syclbin_dump = FindTool("syclbin-dump").resolve(
654-
llvm_config, os.pathsep.join([config.dpcpp_bin_dir, config.llvm_tools_dir])
655-
)
656-
if not syclbin_dump:
657-
lit_config.fatal("can't find `syclbin-dump`")
658-
659653
if (
660654
len(config.sycl_build_targets) == 1
661655
and next(iter(config.sycl_build_targets)) == "target-all"
@@ -824,6 +818,8 @@ def remove_level_zero_suffix(devices):
824818
feature_tools = [
825819
ToolSubst("llvm-spirv", unresolved="ignore"),
826820
ToolSubst("llvm-link", unresolved="ignore"),
821+
ToolSubst("opencl-aot", unresolved="ignore"),
822+
ToolSubst("ocloc", unresolved="ignore"),
827823
]
828824

829825
tools = [
@@ -833,8 +829,14 @@ def remove_level_zero_suffix(devices):
833829
ToolSubst(
834830
r"\| \bnot\b", command=FindTool("not"), verbatim=True, unresolved="ignore"
835831
),
836-
ToolSubst("sycl-ls", command=sycl_ls, unresolved="ignore"),
837-
ToolSubst("syclbin-dump", command=syclbin_dump, unresolved="ignore"),
832+
ToolSubst("sycl-ls", command=sycl_ls, unresolved="fatal"),
833+
ToolSubst("syclbin-dump", unresolved="fatal"),
834+
ToolSubst("llvm-ar", unresolved="fatal"),
835+
ToolSubst("clang-offload-bundler", unresolved="fatal"),
836+
ToolSubst("clang-offload-wrapper", unresolved="fatal"),
837+
ToolSubst("sycl-post-link", unresolved="fatal"),
838+
ToolSubst("file-table-tform", unresolved="fatal"),
839+
ToolSubst("llvm-foreach", unresolved="fatal"),
838840
] + feature_tools
839841

840842
# Try and find each of these tools in the DPC++ bin directory, in the llvm tools directory
@@ -855,19 +857,6 @@ def remove_level_zero_suffix(devices):
855857
if shutil.which("cmc") is not None:
856858
config.available_features.add("cm-compiler")
857859

858-
# Device AOT compilation tools aren't part of the SYCL project,
859-
# so they need to be pre-installed on the machine
860-
aot_tools = ["ocloc", "opencl-aot"]
861-
862-
for aot_tool in aot_tools:
863-
if shutil.which(aot_tool) is not None:
864-
lit_config.note("Found pre-installed AOT device compiler " + aot_tool)
865-
config.available_features.add(aot_tool)
866-
else:
867-
lit_config.warning(
868-
"Couldn't find pre-installed AOT device compiler " + aot_tool
869-
)
870-
871860
# Clear build targets when not in build-only, to populate according to devices
872861
if config.test_mode != "build-only":
873862
config.sycl_build_targets = set()

0 commit comments

Comments
 (0)