Skip to content

Commit 19d023b

Browse files
uditagarwal97Pavel V Chupinbader
authored
[CI] Enable SYCL End-to-End tests on Windows for post-commit (#8656)
This PR augments Pavel's work (#7477) on running llvm_test_suite in Windows CI for post-commit testing. Keeping in mind that the intel/llvm_test_suite repo is getting merged into intel/llvm, this PR tests in-tree SYCL E2E tests. --------- Co-authored-by: Pavel V Chupin <[email protected]> Co-authored-by: Alexey Bader <[email protected]>
1 parent 2953d25 commit 19d023b

13 files changed

+180
-23
lines changed

.github/workflows/sycl_gen_test_matrix.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,25 @@ on:
3434
required: false
3535
default: ${{ github.sha }}
3636
outputs:
37-
lts_matrix:
38-
description: "Generated Matrix"
39-
value: ${{ jobs.test_matrix.outputs.lts_matrix }}
37+
lts_lx_matrix:
38+
description: "Linux LTS"
39+
value: ${{ jobs.test_matrix.outputs.lts_lx_matrix }}
40+
lts_wn_matrix:
41+
description: "Windows LTS"
42+
value: ${{ jobs.test_matrix.outputs.lts_wn_matrix }}
4043
cts_matrix:
41-
description: "Generated SYCL CTS Matrix"
44+
description: "SYCL CTS"
4245
value: ${{ jobs.test_matrix.outputs.cts_matrix }}
4346
lts_aws_matrix:
44-
description: "Generated Matrix AWS subset"
47+
description: "Linux AWS"
4548
value: ${{ jobs.test_matrix.outputs.lts_aws_matrix }}
4649
jobs:
4750
test_matrix:
4851
name: Generate Test Matrix
4952
runs-on: ubuntu-20.04
5053
outputs:
51-
lts_matrix: ${{ steps.work.outputs.lts_matrix }}
54+
lts_lx_matrix: ${{ steps.work.outputs.lts_lx_matrix }}
55+
lts_wn_matrix: ${{ steps.work.outputs.lts_wn_matrix }}
5256
cts_matrix: ${{ steps.work.outputs.cts_matrix }}
5357
lts_aws_matrix: ${{ steps.work.outputs.lts_aws_matrix }}
5458
steps:

.github/workflows/sycl_post_commit.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if: github.repository == 'intel/llvm'
2323
uses: ./.github/workflows/sycl_gen_test_matrix.yml
2424
with:
25-
lts_config: "l0_gen9"
25+
lts_config: "l0_gen9;win_l0_gen12"
2626
cts_config: "cuda"
2727
linux_default:
2828
name: Linux Default
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
build_cache_root: "/__w/llvm"
3535
build_artifact_suffix: "post_commit"
36-
lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }}
36+
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
3737
cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }}
3838
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
3939
build_configure_extra_args: --hip --cuda --enable-esimd-emulator --cmake-opt="-DSYCL_ENABLE_STACK_PRINTING=ON" --cmake-opt="-DSYCL_LIB_WITH_DEBUG_SYMBOL=ON"
@@ -63,8 +63,11 @@ jobs:
6363

6464
windows_default:
6565
name: Windows
66+
needs: test_matrix
6667
if: github.repository == 'intel/llvm'
6768
uses: ./.github/workflows/sycl_windows_build_and_test.yml
69+
with:
70+
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}
6871

6972
macos_default:
7073
name: macOS

.github/workflows/sycl_precommit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ jobs:
6464
build_cache_size: "8G"
6565
build_artifact_suffix: "default"
6666
build_cache_suffix: "default"
67-
lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }}
67+
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
6868
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}

.github/workflows/sycl_windows_build_and_test.yml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@ on:
1010
build_ref:
1111
type: string
1212
required: false
13+
lts_matrix:
14+
type: string
15+
required: false
16+
default: "[]"
17+
lts_cmake_extra_args:
18+
type: string
19+
required: false
20+
default: ""
1321

1422
jobs:
1523
build:
1624
name: Build + LIT
1725
runs-on: [Windows, build]
26+
strategy:
27+
matrix:
28+
include: ${{ fromJSON(inputs.lts_matrix) }}
1829
# TODO use cached checkout
1930
steps:
2031
- uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
@@ -40,7 +51,7 @@ jobs:
4051
mkdir build
4152
mkdir install
4253
IF NOT EXIST D:\github\_work\cache MKDIR D:\github\_work\cache
43-
IF NOT EXIST D:\github\_work\cache\sycl_${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
54+
IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
4455
python.exe src/buildbot/configure.py -o build ^
4556
--ci-defaults ^
4657
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
@@ -50,9 +61,9 @@ jobs:
5061
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache"
5162
- name: Build
5263
id: build
64+
shell: bash
5365
run: |
5466
cmake --build build --target sycl-toolchain
55-
sccache --show-stats
5667
- name: check-llvm
5768
shell: bash
5869
if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }}
@@ -80,9 +91,62 @@ jobs:
8091
cmake --build build --target check-xptifw
8192
- name: Install
8293
shell: bash
83-
run: cmake --build build --target deploy-sycl-toolchain
94+
run: |
95+
# TODO replace utility installation with a single CMake target
96+
cmake --build build --target utils/count/install
97+
cmake --build build --target utils/not/install
98+
cmake --build build --target utils/lit/install
99+
cmake --build build --target utils/llvm-lit/install
100+
cmake --build build --target install-llvm-size
101+
cmake --build build --target install-llvm-cov
102+
cmake --build build --target install-llvm-profdata
103+
# TODO: Figure out why installing FileCheck does not install
104+
# the FileCheck binary in the install/bin directory.
105+
cmake --build build --target utils/FileCheck/install
106+
cmake --build build --target install-compiler-rt
107+
cmake --build build --target deploy-sycl-toolchain
108+
# Copy FileCheck to install/bin for use by E2E tests.
109+
cp build/bin/FileCheck.exe install/bin/.
110+
- name: Pack toolchain
111+
shell: bash
112+
run: |
113+
tar -czf llvm_sycl.tar.gz -C install .
84114
- name: Upload toolchain
85115
uses: actions/upload-artifact@v3
86116
with:
87117
name: sycl_windows_default
88-
path: install/**/*
118+
path: llvm_sycl.tar.gz
119+
120+
e2e-tests:
121+
needs: build
122+
if: ${{ inputs.lts_matrix != '[]' }}
123+
strategy:
124+
fail-fast: false
125+
matrix:
126+
include: ${{ fromJSON(inputs.lts_matrix) }}
127+
name: ${{ matrix.name }}
128+
runs-on: ${{ matrix.runs-on }}
129+
env: ${{ matrix.env }}
130+
steps:
131+
- uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
132+
with:
133+
arch: amd64
134+
- name: Set env
135+
run: |
136+
git config --system core.longpaths true
137+
git config --global core.autocrlf false
138+
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
139+
# TODO: use cached_checkout
140+
- uses: actions/checkout@v3
141+
with:
142+
persist-credentials: false
143+
ref: ${{ inputs.build_ref || github.sha }}
144+
path: llvm
145+
- name: Register cleanup after job is finished
146+
uses: ./llvm/devops/actions/cleanup
147+
- uses: ./llvm/devops/actions/e2e-tests-win
148+
name: Run SYCL End-to-End tests
149+
with:
150+
sycl_artifact: sycl_windows_default
151+
targets: ${{ matrix.targets }}
152+
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Run SYCL End-to-End testing'
2+
description: 'Run SYCL End-to-End testing'
3+
inputs:
4+
sycl_artifact:
5+
description: 'Name of the artifact, that contains compiler toolchain'
6+
required: true
7+
targets:
8+
description: 'List of SYCL backends with set of target devices per each to be tested iteratively'
9+
required: true
10+
cmake_args:
11+
description: 'Extra arguments to cmake command'
12+
required: false
13+
14+
post-if: false
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Download compiler toolchain
19+
uses: actions/download-artifact@v3
20+
with:
21+
name: ${{ inputs.sycl_artifact }}
22+
- name: Extract SYCL toolchain
23+
shell: bash
24+
run: |
25+
mkdir install
26+
tar -xf llvm_sycl.tar.gz -C install
27+
rm llvm_sycl.tar.gz
28+
- name: Configure
29+
shell: cmd
30+
run: |
31+
mkdir build-e2e
32+
set PATH=%GITHUB_WORKSPACE%\install\bin;%PATH%
33+
cmake -GNinja -B build-e2e -S.\llvm\sycl\test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.targets }}" -DCMAKE_CXX_COMPILER="clang++" -DLLVM_LIT="..\llvm\llvm\utils\lit\lit.py" ${{ inputs.cmake_args }}
34+
- name: Run testing
35+
shell: bash
36+
run: |
37+
# Run E2E tests.
38+
export LIT_OPTS="-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests"
39+
cmake --build build-e2e --target check-sycl-e2e
40+
- name: Cleanup
41+
shell: cmd
42+
if: always()
43+
run: |
44+
rmdir /q /s install
45+
rmdir /q /s build-e2e

devops/scripts/generate_test_matrix.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = ({core, process}) => {
22
const fs = require('fs');
33
fs.readFile('./test_configs.json', 'utf8', (err, data) => {
44
if (err) {
5-
console.log(`Error reading file from disk: ${err}`);
5+
console.error(`Error reading file from disk: ${err}`);
66
} else {
77
const driverNew =
88
JSON.parse(fs.readFileSync('./dependencies.json', 'utf8'));
@@ -28,9 +28,12 @@ module.exports = ({core, process}) => {
2828

2929
const ltsConfigs = inputs.lts_config.split(';');
3030

31-
const enabledLTSConfigs = [];
31+
const enabledLTSLxConfigs = [];
32+
const enabledLTSWnConfigs = [];
3233
const enabledLTSAWSConfigs = [];
3334

35+
// Process LTS (LLVM Test Suite)
36+
3437
testConfigs.lts.forEach(v => {
3538
if (ltsConfigs.includes(v.config)) {
3639
if (needsDrivers) {
@@ -47,32 +50,47 @@ module.exports = ({core, process}) => {
4750
} else {
4851
v["env"] = {};
4952
}
50-
enabledLTSConfigs.push(v);
53+
if (v["runs-on"].includes("Windows"))
54+
enabledLTSWnConfigs.push(v);
55+
else if (v["runs-on"].includes("Linux"))
56+
enabledLTSLxConfigs.push(v);
57+
else
58+
console.error("runs-on OS is not recognized");
5159
if (v["aws-type"]) enabledLTSAWSConfigs.push(v);
5260
}
5361
});
5462

55-
let ltsString = JSON.stringify(enabledLTSConfigs);
63+
let ltsLxString = JSON.stringify(enabledLTSLxConfigs);
64+
let ltsWnString = JSON.stringify(enabledLTSWnConfigs);
5665
let ltsAWSString = JSON.stringify(enabledLTSAWSConfigs);
57-
console.log(ltsString);
66+
console.log("Linux LTS config:")
67+
console.log(ltsLxString);
68+
console.log("Windows LTS config:")
69+
console.log(ltsWnString);
70+
console.log("Linux AWS LTS config:")
5871
console.log(ltsAWSString)
5972

73+
// drivers update is supported on Linux only
6074
for (let [key, value] of Object.entries(inputs)) {
61-
ltsString = ltsString.replaceAll("${{ inputs." + key + " }}", value);
75+
ltsLxString =
76+
ltsLxString.replaceAll("${{ inputs." + key + " }}", value);
6277
ltsAWSString = ltsAWSString.replaceAll("${{ inputs." + key + " }}", value);
6378
}
6479
if (needsDrivers) {
65-
ltsString = ltsString.replaceAll(
80+
ltsLxString = ltsLxString.replaceAll(
6681
"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest",
6782
"ghcr.io/intel/llvm/ubuntu2004_base:latest");
6883
ltsAWSString = ltsAWSString.replaceAll(
6984
"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest",
7085
"ghcr.io/intel/llvm/ubuntu2004_base:latest");
7186
}
7287

73-
core.setOutput('lts_matrix', ltsString);
88+
core.setOutput('lts_lx_matrix', ltsLxString);
89+
core.setOutput('lts_wn_matrix', ltsWnString);
7490
core.setOutput('lts_aws_matrix', ltsAWSString);
7591

92+
// Process CTS (Conformance Test Suite)
93+
7694
const ctsConfigs = inputs.cts_config.split(';');
7795

7896
const enabledCTSConfigs = [];
@@ -98,6 +116,7 @@ module.exports = ({core, process}) => {
98116
});
99117

100118
let ctsString = JSON.stringify(enabledCTSConfigs);
119+
console.log("CTS config:")
101120
console.log(ctsString);
102121

103122
for (let [key, value] of Object.entries(inputs)) {

devops/test_configs.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
"targets": "level_zero:gpu",
1313
"cmake_args": ""
1414
},
15+
{
16+
"config": "win_l0_gen12",
17+
"name": "L0 GEN12 LLVM Test Suite",
18+
"runs-on": [
19+
"Windows",
20+
"gen12"
21+
],
22+
"targets": "level_zero:gpu",
23+
"cmake_args": ""
24+
},
1525
{
1626
"config": "ocl_gen9",
1727
"name": "OCL GEN9 LLVM Test Suite",

sycl/test-e2e/Basic/build_log.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: opencl || level_zero, gpu
2-
// UNSUPPORTED: gpu-intel-dg1
2+
// UNSUPPORTED: gpu-intel-dg1 || windows
33
//
44
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
55
// RUN: %GPU_RUN_PLACEHOLDER env SYCL_RT_WARNING_LEVEL=2 %t.out 2>&1 %GPU_CHECK_PLACEHOLDER

sycl/test-e2e/ESIMD/dword_atomic_cmpxchg.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// REQUIRES: gpu
1111
// UNSUPPORTED: gpu-intel-gen9 && windows
1212
// UNSUPPORTED: cuda || hip
13+
// TODO: Re-enable this test on Windows after the following issue gets fixed:
14+
// https://github.com/intel/llvm/issues/8934
15+
// UNSUPPORTED: windows
1316
// TODO: esimd_emulator fails due to random timeouts (_XFAIL_: esimd_emulator)
1417
// UNSUPPORTED: esimd_emulator
1518
// RUN: %clangxx -fsycl %s -o %t.out

sycl/test-e2e/ESIMD/dword_atomic_cmpxchg_scalar_off.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// REQUIRES: gpu
1111
// UNSUPPORTED: gpu-intel-gen9 && windows
1212
// UNSUPPORTED: cuda || hip
13+
// TODO: Re-enable this test on Windows after the following issue gets fixed:
14+
// https://github.com/intel/llvm/issues/8934
15+
// UNSUPPORTED: windows
1316
// TODO: esimd_emulator fails due to random timeouts (_XFAIL_: esimd_emulator)
1417
// UNSUPPORTED: esimd_emulator
1518
// RUN: %clangxx -fsycl %s -o %t.out

sycl/test-e2e/ESIMD/dword_atomic_smoke.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// REQUIRES: gpu
1111
// UNSUPPORTED: gpu-intel-gen9 && windows
1212
// UNSUPPORTED: cuda || hip
13+
// TODO: Re-enable this test on Windows after the following issue gets fixed:
14+
// https://github.com/intel/llvm/issues/8934
15+
// UNSUPPORTED: windows
1316
// RUN: %clangxx -fsycl %s -o %t.out
1417
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1518

sycl/test-e2e/ESIMD/dword_atomic_smoke_scalar_off.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// REQUIRES: gpu
1111
// UNSUPPORTED: gpu-intel-gen9 && windows
1212
// UNSUPPORTED: cuda || hip
13+
// TODO: Re-enable this test on Windows after the following issue gets fixed:
14+
// https://github.com/intel/llvm/issues/8934
15+
// UNSUPPORTED: windows
1316
// TODO: esimd_emulator fails due to random timeouts (_XFAIL_: esimd_emulator)
1417
// UNSUPPORTED: esimd_emulator
1518
// RUN: %clangxx -fsycl %s -o %t.out

sycl/test-e2e/Regression/reduction_resource_leak_usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: level_zero, level_zero_dev_kit
22
// TODO: ZE_DEBUG=4 produces no output on Windows. Enable when fixed.
3-
// XFAIL: windows
3+
// UNSUPPORTED: windows
44
//
55
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
66
// RUN: env ONEAPI_DEVICE_SELECTOR="level_zero:*" ZE_DEBUG=4 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER

0 commit comments

Comments
 (0)