forked from uxlfoundation/oneapi-construction-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
318 lines (283 loc) · 11 KB
/
planned_testing.yml
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# Simple workflow for running non-documentation PR testing
name: Run ock tests for PR testing
on:
workflow_call:
inputs:
ock:
required: false
type: boolean
default: true
target_list:
required: false
type: string
default: '["x86_64", "aarch64", "riscv64"]'
os_list:
required: false
type: string
default: '["ubuntu-22.04", "windows-2019"]'
update_cache:
required: false
type: boolean
default: false
# target_host_x86_64_windows:
# required: false
# type: boolean
# default: false
# target_host_aarch64_linux:
# required: false
# type: boolean
# default: true
llvm_version:
required: false
type: string
default: 18
env:
target_list: '["x86_64","aarch64", "riscv64"]'
os_list: '["ubuntu-22.04", "windows-2019"]'
jobs:
calc_matrix:
runs-on: ubuntu-latest
name: Calc matrix
outputs:
target_list: ${{ steps.step1.outputs.target_list }}
os_list: ${{ steps.step1.outputs.os_list }}
steps:
- id: step1
run: |
# echo "target_list=$target_list" >> "$GITHUB_OUTPUT"
# echo "os_list=$os_list" >> "$GITHUB_OUTPUT"
echo 'target_list=${{ inputs.target_list }}' >> "$GITHUB_OUTPUT"
echo 'os_list=${{ inputs.os_list }}' >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
# create_ock_artefacts:
# needs: calc_matrix
# strategy:
# matrix:
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# - target: riscv64
# # - target: aarch64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
# TODO: Move this to a single action
- name: load native llvm
if: ${{ matrix.target }} != "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: actions/cache/restore@v4
with:
path: llvm_install/**
key: llvm-ubuntu-22.04-x86_64-v19-RelAssert
fail-on-cache-miss: true
- name: mv llvm native
if: ${{ matrix.target }} != "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
run: mv llvm_install llvm_install_native
# installs tools, ninja, installs llvm and sets up sccache
- name: setup-ubuntu
if: ${{ matrix.target }} == "x86_64" && ${{ matrix.os }} == "ubuntu-22.04"
uses: ./.github/actions/setup_build
with:
llvm_version: 19
llvm_build_type: RelAssert
# For now target and arch match
arch: ${{ matrix.target }}
save: ${{ inputs.update_cache }}
- name: build ock x86
if: ${{ matrix.target == 'x86_64' }}
uses: ./.github/actions/do_build_ock
with:
build_targets: install
offline_kernel_tests: OFF
- name: build ock other ${{ matrix.target }}
if: ${{ matrix.target != 'x86_64' }}
uses: ./.github/actions/do_build_ock
with:
build_targets: install
# Todo : target does not directly equate to arch here
arch: ${{ matrix.target }}
toolchain_file: "platform/arm-linux/aarch64-toolchain.cmake"
extra_flags: -DCA_BUILTINS_TOOLS_DIR=${{ github.workspace }}/llvm_install_native/bin
# Do we need the offline kernel as an artefact? If so currently this requires an external clc or qemu to be installed.
offline_kernel_tests: OFF
host_fp16: ON
# Prune it as there is too much things in there we don't want to use
# We may want to extend this a bit as time goes on such as clc or UnitCL
- name: prune ock artefact ${{ matrix.target }}
run: |
# delete all but city runner and the python associated file under bin
find install_ock_${{matrix.os}}_${{matrix.target}}/bin -maxdepth 1 -type f ! -name "*.py" -delete
rm -rf install_ock_${{matrix.os}}_${{matrix.target}}/share
- name: upload ock artefact
uses: actions/upload-artifact@v4
with:
name: ock_${{matrix.os}}_${{matrix.target}}
path: install
retention-days: 1
# use_ock_artefacts_all:
# needs: [ calc_matrix, create_ock_artefacts ]
# strategy:
# matrix:
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# target: aarch64
# - os: windows-2019
# target: riscv64
build_icd:
needs: [ calc_matrix ]
strategy:
matrix:
target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
build_type: [RelAssert]
exclude:
- os: windows-2019
- target: riscv64
runs-on: ${{ matrix.os }}
steps:
- name: Install Ninja
uses: llvm/actions/install-ninja@main
- name: clone ock platform
uses: actions/checkout@v4
with:
sparse-checkout: |
platform
.github
# todo look into setting variables in a common way so we can pass toolchains in for different jobs
- name : build and upload icd
# if: ${{ matrix.target != 'x86_64' }}
uses: ./.github/actions/do_build_icd
with:
# Todo : not just support linux here
toolchain: ${{ matrix.target == 'aarch64' && '--toolchain $GITHUB_WORKSPACE/platform/arm-linux/aarch64-toolchain.cmake' || '' }}
name: icd_${{matrix.os}}_${{matrix.target}}
# Todo do as an action
build_tornado:
needs: [ calc_matrix, build_icd ]
# needs: [ calc_matrix ]
strategy:
matrix:
target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
build_type: [RelAssert]
exclude:
- os: windows-2019
- target: riscv64
runs-on: ${{ matrix.os }}
steps:
# - name: Install Ninja
# uses: llvm/actions/install-ninja@main
- name: clone ock platform
uses: actions/checkout@v4
with:
sparse-checkout: |
platform
.github
- name: download icd artifact
uses: actions/download-artifact@v4
with:
name: icd_${{matrix.os}}_${{matrix.target}}
path: install_icd
# Get maven
- name: fetch maven
run: |
wget https://archive.apache.org/dist/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.tar.gz
tar xf apache-maven-3.9.3-bin.tar.gz
# for x86, we'll need to do something else for aarch64
- name: select jdk21
run: |
sudo update-java-alternatives -s temurin-21-jdk-amd64
pip install tqdm
- name: build tornadovm
run: |
git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1 TornadoVM_build
export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk
export PATH=$PWD/apache-maven-3.9.3/bin:$PATH
mvn -v
java --version
cd TornadoVM_build
# The tornado build system links in OpenCL assuming it's in a known place. This gets around
# this by pass CXX as an environment variable as it's difficult to change the build system
# even if we don't use this script.
CXX="g++ -L$GITHUB_WORKSPACE/install_icd/lib" make -j8 jdk21 BACKEND=opencl
# # Not sure if gitlab ci does not follow symbolic links so copy for the artefact
# cp -r -L $TORNADO_SDK $GITHUB_WORKSPACE/TornadoVM_SDK
- name: Download ock artefact
uses: actions/download-artifact@v4
with:
name: ock_${{matrix.os}}_${{matrix.target}}
path: ock
- name: Run tornado example
run: |
export ARETEFACT_CHECKOUT_PATH=$GITHUB_WORKSPACE/ock
echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH
ls $ARTEFACT_CHECKOUT_PATH
export ICD_LOADER_INSTALL_PATH=$GITHUB_WORKSPACE/icd
echo ICD_LOADER_INSTALL_PATH is $ICD_LOADER_INSTALL_PATH
ls $ICD_LOADER_INSTALL_PATH
export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so
export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk
export PATH=$TORNADO_SDK/bin:$PATH
git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1
cd TornadoVM
tornado-test -V "uk.ac.manchester.tornado.unittests.TestHello"
# todo : download ock artefact
# Run tornado example
# at some point we will make an artefact if we want to do more, but it is enough to show it working using the created files.
# - name: run tornado example
# run: |
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH
# ls $ARTEFACT_CHECKOUT_PATH
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH
# echo $LD_LIBRARY_PATH
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'`
# export TORNADO_SDK=$CI_PROJECT_DIR/TornadoVM_SDK
# export PATH=$TORNADO_SDK/bin:$PATH
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1
# cd TornadoVM
# toolchain:
# description: 'path to toolchain'
# default: $GITHUB_WORKSPACE/ock/platform/x86_64-linux.cmake
# build_type:
# description: 'path to toolchain'
# default: ock/platform/x86_64-linux.cmake
# name:
# description: 'artifact name'
# default: ubuntu-22.04-x86_64
# use_ock_artefacts:
# needs: [ calc_matrix, create_ock_artefacts ]
# strategy:
# matrix:
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }}
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }}
# build_type: [RelAssert]
# exclude:
# - os: windows-2019
# - target: riscv64
# runs-on: ${{ matrix.os }}
# steps:
# - name: Download ock artefact
# uses: actions/download-artifact@v4
# with:
# name: ock_${{matrix.os}}_${{matrix.target}}
# path: ock_${{matrix.os}}_${{matrix.target}}
# - name: print ock artefact
# run: |
# ls -R .
# echo "${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.arch }}" > foo.txt
# --define CA_CL_ENABLE_ICD_LOADER=ON
# --define OCL_EXTENSION_cl_khr_command_buffer=ON
# --define OCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=ON
# --define OCL_EXTENSION_cl_khr_extended_async_copies=ON
# --target check-ock
# -B build