Skip to content

Commit 4a440da

Browse files
Yang,Yinbader
andauthored
[CI] Enable CUDA SYCL CTS tests (#6439)
Signed-off-by: Yin Yang <yin.yang@intel.com> Co-authored-by: Alexey Bader <alexey.bader@intel.com>
1 parent c1181f0 commit 4a440da

File tree

7 files changed

+255
-0
lines changed

7 files changed

+255
-0
lines changed

.github/workflows/sycl_gen_test_matrix.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
type: string
2020
required: true
2121
default: ""
22+
cts_config:
23+
type: string
24+
required: false
25+
default: ""
2226
uniq:
2327
description: Unique string to name dynamic runners in AWS
2428
type: string
@@ -33,6 +37,9 @@ on:
3337
lts_matrix:
3438
description: "Generated Matrix"
3539
value: ${{ jobs.test_matrix.outputs.lts_matrix }}
40+
cts_matrix:
41+
description: "Generated SYCL CTS Matrix"
42+
value: ${{ jobs.test_matrix.outputs.cts_matrix }}
3643
lts_aws_matrix:
3744
description: "Generated Matrix AWS subset"
3845
value: ${{ jobs.test_matrix.outputs.lts_aws_matrix }}
@@ -42,6 +49,7 @@ jobs:
4249
runs-on: ubuntu-latest
4350
outputs:
4451
lts_matrix: ${{ steps.work.outputs.lts_matrix }}
52+
cts_matrix: ${{ steps.work.outputs.cts_matrix }}
4553
lts_aws_matrix: ${{ steps.work.outputs.lts_aws_matrix }}
4654
steps:
4755
- name: Download scripts and configs

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ on:
5656
type: number
5757
required: false
5858
default: 4
59+
cts_matrix:
60+
type: string
61+
required: false
62+
default: ""
63+
cts_cmake_extra_args:
64+
type: string
65+
required: false
66+
default: ""
67+
cts_ref:
68+
type: string
69+
required: false
70+
default: 'SYCL-2020'
5971

6072
jobs:
6173
build:
@@ -230,6 +242,53 @@ jobs:
230242
check_sycl_all: ${{ matrix.check_sycl_all }}
231243
results_name_suffix: ${{ matrix.config }}_${{ inputs.build_artifact_suffix }}
232244
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
245+
246+
khronos_sycl_cts:
247+
needs: build
248+
if: ${{ inputs.cts_matrix != '' }}
249+
strategy:
250+
fail-fast: false
251+
max-parallel: ${{ inputs.max_parallel }}
252+
matrix:
253+
include: ${{ fromJSON(inputs.cts_matrix) }}
254+
name: ${{ matrix.name }}
255+
runs-on: ${{ matrix.runs-on }}
256+
env: ${{ matrix.env }}
257+
container:
258+
image: ${{ matrix.image }}
259+
options: ${{ matrix.container_options }}
260+
steps:
261+
- name: Reset GPU
262+
if: ${{ contains(matrix.config, 'gen9') }}
263+
run: |
264+
sudo mount -t debugfs none /sys/kernel/debug
265+
sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged'
266+
- run: cp -r /actions .
267+
- name: Register cleanup after job is finished
268+
uses: ./actions/cleanup
269+
- name: Install drivers
270+
if: env.compute_runtime_tag != ''
271+
run: |
272+
if [ -e /opt/install_drivers.sh ]; then
273+
# TODO pack this script into container
274+
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/scripts/get_release.py
275+
sudo mv get_release.py /opt/
276+
sudo -E /opt/install_drivers.sh --all
277+
fi
278+
# FIXME cached_checkout fails here, but works everywhere else
279+
# TODO: figure out if we remove this action
280+
- uses: actions/checkout@v2
281+
with:
282+
path: llvm
283+
# TODO should this action be packed into container as well?
284+
- uses: ./llvm/devops/actions/khronos_cts_test
285+
name: Run Khronos SYCL CTS
286+
with:
287+
test_ref: ${{ inputs.cts_ref }}
288+
sycl_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
289+
sycl_archive: llvm_sycl.tar.xz
290+
sycl_device_filter: ${{ matrix.sycl_device_filter }}
291+
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.cts_cmake_extra_args }}'
233292

234293
aws-stop:
235294
name: Stop AWS

.github/workflows/sycl_post_commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: ./.github/workflows/sycl_gen_test_matrix.yml
1818
with:
1919
lts_config: "l0_gen9"
20+
cts_config: "cuda"
2021
linux_default:
2122
name: Linux Default
2223
needs: test_matrix
@@ -26,6 +27,7 @@ jobs:
2627
build_cache_root: "/__w/llvm"
2728
build_artifact_suffix: "post_commit"
2829
lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }}
30+
cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }}
2931
lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }}
3032
linux_no_assert:
3133
name: Linux (no assert)
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: 'Run khronos_sycl_cts testing'
2+
description: 'Run SYCL tests from khronos_sycl_cts'
3+
inputs:
4+
test_ref:
5+
description: 'commit-ish identifier for test repo'
6+
required: true
7+
default: 'SYCL-2020'
8+
sycl_artifact:
9+
description: 'Name of the artifact, that contains compiler toolchain'
10+
required: true
11+
sycl_archive:
12+
description: 'Name of SYCL toolchain archive file'
13+
required: false
14+
default: 'llvm_sycl.tar.xz'
15+
sycl_device_filter:
16+
description: 'List of SYCL backends with set of target devices per each to be tested iteratively'
17+
required: true
18+
cmake_args:
19+
description: 'Extra arguments to cmake command'
20+
required: false
21+
22+
post-if: false
23+
runs:
24+
using: "composite"
25+
steps:
26+
- run: |
27+
cp -r /actions .
28+
git config --global --add safe.directory /__w/repo_cache/KhronosGroup/SYCL-CTS
29+
shell: bash
30+
- run: apt update && apt install -yqq opencl-headers ocl-icd-opencl-dev
31+
shell: bash
32+
- name: Checkout SYCL CTS
33+
uses: ./actions/cached_checkout
34+
with:
35+
path: khronos_sycl_cts
36+
repository: 'KhronosGroup/SYCL-CTS'
37+
ref: ${{ inputs.test_ref }}
38+
default_branch: 'SYCL-2020'
39+
cache_path: "/__w/repo_cache/"
40+
- run: |
41+
cd khronos_sycl_cts
42+
git submodule update --init
43+
shell: bash
44+
- name: Download compiler toolchain
45+
uses: actions/download-artifact@v2
46+
with:
47+
name: ${{ inputs.sycl_artifact }}
48+
- name: Extract SYCL toolchain
49+
shell: bash
50+
run: |
51+
mkdir toolchain
52+
tar -xf ${{ inputs.sycl_archive }} -C toolchain
53+
rm -f ${{ inputs.sycl_archive }}
54+
- name: Build SYCL-CTS
55+
shell: bash
56+
run: |
57+
echo "::group::CMake configuration"
58+
export LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH
59+
mkdir build
60+
cmake -GNinja -B./build -S./khronos_sycl_cts -DSYCL_IMPLEMENTATION=DPCPP \
61+
-DCMAKE_CXX_COMPILER="$PWD/toolchain/bin/clang++" \
62+
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES="$PWD/llvm/devops/cts_exclude_filter" \
63+
-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF \
64+
-DSYCL_CTS_MEASURE_BUILD_TIMES=ON \
65+
-DDPCPP_INSTALL_DIR="$PWD/toolchain" \
66+
${{ inputs.cmake_args }}
67+
echo "::endgroup::"
68+
echo "::group::Bulid testing"
69+
cd build
70+
ninja
71+
echo "::endgroup::"
72+
- name: Run SYCL-CTS
73+
shell: bash
74+
run: |
75+
echo "::group::Configure execution environment"
76+
export PATH=$PWD/toolchain/bin/:$PATH
77+
export LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH
78+
# TODO make this part of container build
79+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/hip/lib/:/opt/rocm/lib
80+
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
81+
source /runtimes/oneapi-tbb/env/vars.sh;
82+
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
83+
source /opt/runtimes/oneapi-tbb/env/vars.sh;
84+
else
85+
echo "no TBB vars in /opt/runtimes or /runtimes";
86+
fi
87+
# TODO remove workaround of FPGA emu bug
88+
mkdir -p icd
89+
echo /usr/lib/x86_64-linux-gnu/intel-opencl/libigdrcl.so > icd/gpu.icd
90+
echo /runtimes/oclcpu/x64/libintelocl.so > icd/cpu.icd
91+
echo /opt/runtimes/oclcpu/x64/libintelocl.so > icd/cpu2.icd
92+
export OCL_ICD_VENDORS=$PWD/icd
93+
echo "::endgroup::"
94+
echo "::group::sycl-ls --verbose"
95+
sycl-ls --verbose
96+
echo "::endgroup::"
97+
echo "::group::SYCL_PI_TRACE=-1 sycl-ls"
98+
echo $LD_LIBRARY_PATH
99+
SYCL_PI_TRACE=-1 sycl-ls
100+
echo "::endgroup::"
101+
echo "::group::Run testing"
102+
export SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1
103+
export SYCL_DEVICE_FILTER=${{ matrix.sycl_device_filter }}
104+
./build/bin/test_all --list-devices
105+
./build/bin/test_all
106+
echo "::endgroup::"
107+
- name: Cleanup
108+
shell: bash
109+
if: always()
110+
run: |
111+
rm -rf toolchain
112+
rm -rf build
113+
rm -rf khronos_sycl_cts

devops/cts_exclude_filter

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
context
2+
device
3+
event
4+
exceptions
5+
kernel
6+
multi_ptr
7+
platform
8+
queue
9+
reduction
10+
optional_kernel_features
11+
accessor
12+
accessor_legacy
13+
vector_alias
14+
vector_api
15+
vector_constructors
16+
vector_load_store
17+
vector_operators
18+
vector_swizzle_assignment
19+
vector_swizzles
20+
kernel_bundle
21+
specialization_constants
22+
device_selector

devops/scripts/generate_test_matrix.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,43 @@ module.exports = ({core, process}) => {
6969

7070
core.setOutput('lts_matrix', ltsString);
7171
core.setOutput('lts_aws_matrix', ltsAWSString);
72+
73+
const ctsConfigs = inputs.cts_config.split(';');
74+
75+
const enabledCTSConfigs = [];
76+
77+
testConfigs.cts.forEach(v => {
78+
if (ctsConfigs.includes(v.config)) {
79+
if (needsDrivers) {
80+
v["env"] = {
81+
"compute_runtime_tag" :
82+
driverNew["linux"]["compute_runtime"]["github_tag"],
83+
"igc_tag" : driverNew["linux"]["igc"]["github_tag"],
84+
"cm_tag" : driverNew["linux"]["cm"]["github_tag"],
85+
"tbb_tag" : driverNew["linux"]["tbb"]["github_tag"],
86+
"cpu_tag" : driverNew["linux"]["oclcpu"]["github_tag"],
87+
"fpgaemu_tag" : driverNew["linux"]["fpgaemu"]["github_tag"],
88+
};
89+
} else {
90+
v["env"] = {};
91+
}
92+
enabledCTSConfigs.push(v);
93+
}
94+
});
95+
96+
let ctsString = JSON.stringify(enabledCTSConfigs);
97+
console.log(ctsString);
98+
99+
for (let [key, value] of Object.entries(inputs)) {
100+
ctsString = ctsString.replaceAll("${{ inputs." + key + " }}", value);
101+
}
102+
if (needsDrivers) {
103+
ctsString = ctsString.replaceAll(
104+
"ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest",
105+
"ghcr.io/intel/llvm/ubuntu2004_base:latest");
106+
}
107+
108+
core.setOutput('cts_matrix', ctsString);
72109
}
73110
});
74111
}

devops/test_configs.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,19 @@
7272
"check_sycl_all": "cuda:gpu,host",
7373
"cmake_args": ""
7474
}
75+
],
76+
"cts": [
77+
{
78+
"config": "cuda",
79+
"name": "CUDA SYCL CTS",
80+
"runs-on": [
81+
"Linux",
82+
"cuda"
83+
],
84+
"image": "${{ inputs.cuda_image }}",
85+
"container_options": "--gpus all",
86+
"sycl_device_filter": "ext_oneapi_cuda:gpu,host",
87+
"cmake_args": "-DDPCPP_TARGET_TRIPLES=nvptx64-nvidia-cuda"
88+
}
7589
]
7690
}

0 commit comments

Comments
 (0)