Skip to content

Commit 5db8b01

Browse files
author
Pavel V Chupin
committed
[CI] Enable llvm-test-suite on Windows
1 parent 9673e05 commit 5db8b01

File tree

7 files changed

+192
-17
lines changed

7 files changed

+192
-17
lines changed

.github/workflows/sycl_gen_test_matrix.yml

Lines changed: 9 additions & 5 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: "Generated Linux LTS Matrix"
39+
value: ${{ jobs.test_matrix.outputs.lts_lx_matrix }}
40+
lts_wn_matrix:
41+
description: "Generated Windows LTS Matrix"
42+
value: ${{ jobs.test_matrix.outputs.lts_wn_matrix }}
4043
cts_matrix:
4144
description: "Generated SYCL CTS Matrix"
4245
value: ${{ jobs.test_matrix.outputs.cts_matrix }}
4346
lts_aws_matrix:
44-
description: "Generated Matrix AWS subset"
47+
description: "Generated Linux AWS Matrix"
4548
value: ${{ jobs.test_matrix.outputs.lts_aws_matrix }}
4649
jobs:
4750
test_matrix:
4851
name: Generate Test Matrix
4952
runs-on: ubuntu-latest
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
@@ -21,7 +21,7 @@ jobs:
2121
name: Generate Test Matrix
2222
uses: ./.github/workflows/sycl_gen_test_matrix.yml
2323
with:
24-
lts_config: "l0_gen9"
24+
lts_config: "l0_gen9;win_l0_gen9"
2525
cts_config: "cuda"
2626
linux_default:
2727
name: Linux Default
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
build_cache_root: "/__w/llvm"
3333
build_artifact_suffix: "post_commit"
34-
lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }}
34+
lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }}
3535
cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }}
3636
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
3737
linux_no_assert:
@@ -116,8 +116,11 @@ jobs:
116116

117117
windows_default:
118118
name: Windows
119+
needs: test_matrix
119120
if: github.repository == 'intel/llvm'
120121
uses: ./.github/workflows/sycl_windows_build_and_test.yml
122+
with:
123+
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}
121124

122125
macos_default:
123126
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: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ on:
1010
build_ref:
1111
type: string
1212
required: false
13+
lts_matrix:
14+
type: string
15+
required: false
16+
default: "[]"
17+
lts_aws_matrix:
18+
type: string
19+
required: false
20+
default: "[]"
21+
lts_cmake_extra_args:
22+
type: string
23+
required: false
24+
default: ""
25+
lts_ref:
26+
type: string
27+
required: false
28+
default: 'intel'
29+
max_parallel:
30+
type: number
31+
required: false
32+
default: 4
1333

1434
jobs:
1535
build:
@@ -85,4 +105,41 @@ jobs:
85105
uses: actions/upload-artifact@v3
86106
with:
87107
name: sycl_windows_default
88-
path: install/**/*
108+
path: install
109+
- name: Upload LIT
110+
uses: actions/upload-artifact@v3
111+
with:
112+
name: sycl_windows_lit
113+
path: src/llvm/utils/lit
114+
115+
llvm_test_suite:
116+
needs: build
117+
if: ${{ !failure() && inputs.lts_matrix != '[]' }}
118+
strategy:
119+
fail-fast: false
120+
max-parallel: ${{ inputs.max_parallel }}
121+
matrix:
122+
include: ${{ fromJSON(inputs.lts_matrix) }}
123+
name: ${{ matrix.name }}
124+
runs-on: ${{ matrix.runs-on }}
125+
env: ${{ matrix.env }}
126+
steps:
127+
- uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
128+
with:
129+
arch: amd64
130+
# TODO: use cached_checkout
131+
- uses: actions/checkout@v3
132+
with:
133+
persist-credentials: false
134+
path: llvm
135+
- name: Register cleanup after job is finished
136+
uses: ./llvm/devops/actions/cleanup
137+
- uses: ./llvm/devops/actions/llvm_test_suite_win
138+
name: Run LLVM Test Suite
139+
with:
140+
test_ref: ${{ inputs.lts_ref }}
141+
sycl_artifact: sycl_windows_default
142+
lit_artifact: sycl_windows_lit
143+
check_sycl_all: ${{ matrix.check_sycl_all }}
144+
results_name_suffix: ${{ matrix.config }}_default
145+
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: 'Run llvm-test-suite testing'
2+
description: 'Run E2E SYCL tests from llvm-test-suite'
3+
inputs:
4+
test_ref:
5+
description: 'commit-ish identifier for test repo'
6+
required: true
7+
default: 'intel'
8+
sycl_artifact:
9+
description: 'Name of the artifact, that contains compiler toolchain'
10+
required: true
11+
lit_artifact:
12+
description: 'Name of the artifact, that contains LIT tool'
13+
required: true
14+
results_name_suffix:
15+
description: 'Name suffix of the results artifact'
16+
required: true
17+
check_sycl_all:
18+
description: 'List of SYCL backends with set of target devices per each to be tested iteratively'
19+
required: true
20+
cmake_args:
21+
description: 'Extra arguments to cmake command'
22+
required: false
23+
24+
post-if: false
25+
runs:
26+
using: "composite"
27+
steps:
28+
- name: Checkout LLVM Test Suite
29+
# TODO: use cached_checkout
30+
uses: actions/checkout@v3
31+
with:
32+
path: llvm_test_suite
33+
repository: 'intel/llvm-test-suite'
34+
ref: ${{ inputs.test_ref }}
35+
- name: Download compiler toolchain
36+
uses: actions/download-artifact@v3
37+
with:
38+
name: ${{ inputs.sycl_artifact }}
39+
- name: Download LIT
40+
uses: actions/download-artifact@v3
41+
with:
42+
name: ${{ inputs.lit_artifact }}
43+
- name: Configure
44+
shell: cmd
45+
run: |
46+
echo ::group::CMake configuration
47+
dir
48+
mkdir build
49+
set PATH=%GITHUB_WORKSPACE%\install\bin;%PATH%
50+
cmake -GNinja -B.\build -S.\llvm_test_suite -DTEST_SUITE_SUBDIRS=SYCL -DCHECK_SYCL_ALL="${{ inputs.check_sycl_all }}" -DCMAKE_CXX_COMPILER="clang++" -DTEST_SUITE_LIT="%GITHUB_WORKSPACE%\lit\lit.py" ${{ inputs.cmake_args }}
51+
echo ::endgroup::
52+
- name: Run testing
53+
shell: cmd
54+
run: |
55+
set PATH=%GITHUB_WORKSPACE%\install\bin;%PATH%
56+
# TODO make this part of container build
57+
set LIT_OPTS="-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests -o %GITHUB_WORKSPACE%\build\results_${{ inputs.results_name_suffix }}.json"
58+
echo ::group::sycl-ls --verbose
59+
sycl-ls --verbose
60+
echo ::endgroup::
61+
echo ::group::SYCL_PI_TRACE=-1 sycl-ls
62+
SYCL_PI_TRACE=-1 sycl-ls
63+
echo ::endgroup::
64+
cd build
65+
ninja check-sycl-all
66+
- name: Upload test results
67+
uses: actions/upload-artifact@v1
68+
if: always()
69+
with:
70+
name: lit_results_windows
71+
path: build/results_${{ inputs.results_name_suffix }}.json
72+
- name: Cleanup
73+
shell: cmd
74+
if: always()
75+
run: |
76+
del /q install
77+
rmdir install
78+
del /q lit
79+
rmdir lit
80+
del /q build
81+
rmdir build
82+
del /q llvm_test_suite
83+
rmdir llvm_test_suite

devops/scripts/generate_test_matrix.js

Lines changed: 26 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,46 @@ 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 = ltsLxString.replaceAll("${{ inputs." + key + " }}", value);
6276
ltsAWSString = ltsAWSString.replaceAll("${{ inputs." + key + " }}", value);
6377
}
6478
if (needsDrivers) {
65-
ltsString = ltsString.replaceAll(
79+
ltsLxString = ltsLxString.replaceAll(
6680
"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest",
6781
"ghcr.io/intel/llvm/ubuntu2004_base:latest");
6882
ltsAWSString = ltsAWSString.replaceAll(
6983
"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest",
7084
"ghcr.io/intel/llvm/ubuntu2004_base:latest");
7185
}
7286

73-
core.setOutput('lts_matrix', ltsString);
87+
core.setOutput('lts_lx_matrix', ltsLxString);
88+
core.setOutput('lts_wn_matrix', ltsWnString);
7489
core.setOutput('lts_aws_matrix', ltsAWSString);
7590

91+
// Process CTS (Conformance Test Suite)
92+
7693
const ctsConfigs = inputs.cts_config.split(';');
7794

7895
const enabledCTSConfigs = [];
@@ -98,6 +115,7 @@ module.exports = ({core, process}) => {
98115
});
99116

100117
let ctsString = JSON.stringify(enabledCTSConfigs);
118+
console.log("CTS config:")
101119
console.log(ctsString);
102120

103121
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
"check_sycl_all": "level_zero:gpu",
1313
"cmake_args": ""
1414
},
15+
{
16+
"config": "win_l0_gen9",
17+
"name": "L0 GEN9 LLVM Test Suite",
18+
"runs-on": [
19+
"Windows",
20+
"gen12"
21+
],
22+
"check_sycl_all": "level_zero:gpu",
23+
"cmake_args": ""
24+
},
1525
{
1626
"config": "ocl_gen9",
1727
"name": "OCL GEN9 LLVM Test Suite",

0 commit comments

Comments
 (0)