Repository navigation
176 lines (146 loc) · 5.53 KB
/
Copy pathsdk_opensource_dpcpp.yml
File metadata and controls
176 lines (146 loc) · 5.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: sdk-opensource-dpcpp-build-and-test
#
# Build and test the SDK with the open-source DPC++ compiler (github.com/intel/llvm,
# branch sycl-rel-7_0) instead of oneAPI.
#
on:
push:
branches: [ "master" ]
paths:
- .github/workflows/sdk_opensource_dpcpp.yml
pull_request:
branches: [ "master" ]
paths:
- .github/workflows/sdk_opensource_dpcpp.yml
workflow_dispatch:
schedule:
# Daily 8:00 AM UTC / 12:00 AM PST.
- cron: '0 8 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
# Separate job because the container used in 'build-and-test' cannot reach ghcr.
get-toolchain:
name: Extract ${{ matrix.toolchain }}
timeout-minutes: 10
runs-on: [self-hosted, Linux, pti, server]
strategy:
matrix:
include:
- toolchain: dpcpp-7.0
# TODO: move to a repo variable, like the other container images.
# e.g. vars.PTI_DOCKER_DPCPP_REL_7_0
image: ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-7_0
container:
image: ${{ matrix.image }}
options: --user root ${{ vars.PTI_DOCKER_PROXIES }}
credentials:
username: ${{ secrets.PTI_GHCR_USER }}
password: ${{ secrets.PTI_GHCR_PWD }}
if: vars.PTI_RUN_OPENSOURCE_TESTS == 1
steps:
- name: Decompress toolchain
run: |
# Decompressed here, the later container has tar but no zstd.
zstd -d -f /sycl-prebuilt/toolchain.tar.zst -o "$GITHUB_WORKSPACE/toolchain.tar"
ls -lh "$GITHUB_WORKSPACE/toolchain.tar"
- name: Upload toolchain
uses: actions/upload-artifact@v4
with:
name: toolchain-${{ matrix.toolchain }}
path: toolchain.tar
retention-days: 1
# Fast deflate: the tar is ~1 GB of binaries and compresses ~3x.
compression-level: 1
build-and-test:
name: Test PTI ${{ matrix.label }}
needs: get-toolchain
timeout-minutes: 30
runs-on: ${{ fromJSON(matrix.tags) }}
strategy:
# One failing configuration must not cancel the others; the run still fails.
fail-fast: false
matrix:
include:
- label: ubuntu-24.04-client BMG dpcpp-7.0
toolchain: dpcpp-7.0
container: ${{ vars.PTI_DOCKER_UBUNTU_24_4_CLIENT_ONEAPI_N }}
preset: linux-dpclang-release
tags: '["self-hosted", "Linux", "pti", "client", "BMG"]'
container:
image: ${{ matrix.container }}
options: --device=/dev/dri --cap-add CAP_PERFMON --shm-size=24G ${{ vars.PTI_DOCKER_PROXIES }} --volume=/dev/dri/by-path:/dev/dri/by-path
credentials:
username: ${{ vars.PTI_DOCKER_USER }}
password: ${{ secrets.PTI_DOCKER_PWD }}
if: vars.PTI_RUN_OPENSOURCE_TESTS == 1
env:
# The tarball has bin/, include/ and lib/ at its top level.
TC: ${{ github.workspace }}/dpcpp-toolchain
steps:
- name: Checkout
uses: actions/checkout@v4
with:
clean: true
- name: Download toolchain
uses: actions/download-artifact@v4
with:
name: toolchain-${{ matrix.toolchain }}
- name: Unpack toolchain
run: |
mkdir -p "$TC"
tar -xf toolchain.tar -C "$TC"
rm -f toolchain.tar
echo "$TC/bin" >> "$GITHUB_PATH"
echo "LD_LIBRARY_PATH=${TC}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> "$GITHUB_ENV"
echo "LIBRARY_PATH=${TC}/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" >> "$GITHUB_ENV"
echo "CPLUS_INCLUDE_PATH=${TC}/include${CPLUS_INCLUDE_PATH:+:${CPLUS_INCLUDE_PATH}}" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=${TC}${CMAKE_PREFIX_PATH:+:${CMAKE_PREFIX_PATH}}" >> "$GITHUB_ENV"
- name: Verify toolchain and GPU
run: |
echo "dpclang++ resolves to: $(which dpclang++)"
case "$(which dpclang++)" in
"$TC"/bin/dpclang++) ;;
*) echo "::error::dpclang++ is not the open-source toolchain"; exit 1 ;;
esac
dpclang++ --version
if ! sycl-ls | grep -q 'gpu'; then
echo "::error::no SYCL GPU device found"
SYCL_UR_TRACE=1 sycl-ls --verbose || true
exit 1
fi
sycl-ls
- name: Build
id: build
working-directory: sdk
run: |
# Note: "Could NOT find unified-runtime" is expected and fails soft:
# Findunified-runtime.cmake does not search include/unified-runtime/,
# so UR-specific tests are silently skipped.
cmake --preset ${{ matrix.preset }}
cmake --build --preset ${{ matrix.preset }} -j $(($(nproc)/2))
- name: Testing
working-directory: sdk
run: |
# onemkl_gemm_exe and omp_vec_add report Not Run: their samples skip
# themselves at configure time without oneMKL / icx, but the tests are
# still registered.
ctest --output-on-failure --preset ${{ matrix.preset }} \
-LE "performance|quarantine" \
-E "run-onemkl_gemm_exe|run-omp_vec_add"
- name: Quarantined tests # performance and flaky tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
continue-on-error: true
working-directory: sdk
run: |
if ctest --output-on-failure --preset ${{ matrix.preset }} -L 'performance|quarantine'; then
echo "Quarantined tests pass"
else
echo "::warning::Quarantined tests failed"
fi