-
Notifications
You must be signed in to change notification settings - Fork 8
355 lines (313 loc) · 17.9 KB
/
integration_tests.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
name: Integration Tests
on:
schedule:
# 6am UTC is 7am Central European Time (CET) or 8am Central European Summer Time (CEST).
- cron: '0 6 * * *'
push:
branches:
- 'master'
# - 'sync'
pull_request:
branches: [ "master" ]
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request || github.ref }}
cancel-in-progress: true
jobs:
TFLM_Built_In_Tests_with_Patch:
strategy:
fail-fast: false
matrix:
tflm_ref:
- main # latest upstream
- 8eb6b23de4470d6a8da3131650d6a67514dfa130 # Last working commit (needs to be updated manually)
config:
- {vext: "OFF", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "gcc", arch: "native", vlen: 0, elen: 64, sim: "Native"}
- {vext: "OFF", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "gcc", arch: "rv32gc", vlen: 0, elen: 64, sim: "Spike"}
- {vext: "OFF", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "llvm", arch: "rv32gc", vlen: 0, elen: 64, sim: "Spike"}
# - {vext: "OFF", portable: "OFF", pext: "ON", mode: "release_with_logs", toolchain: "gcc", arch: "rv32gcp", vlen: 0, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "gcc", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "llvm", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "gcc", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "OFF", pext: "OFF", mode: "release_with_logs", toolchain: "llvm", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "ON", pext: "OFF", mode: "release_with_logs", toolchain: "gcc", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "ON", pext: "OFF", mode: "release_with_logs", toolchain: "llvm", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "ON", pext: "OFF", mode: "release_with_logs", toolchain: "gcc", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext: "ON", portable: "ON", pext: "OFF", mode: "release_with_logs", toolchain: "llvm", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
name: TFLM Built-In Tests
runs-on: ubuntu-22.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
- name: Install TFLM dependencies
run: |
sudo apt-get install python3-setuptools
pip3 install wheel
pip3 install Pillow
pip3 install Wave
pip3 install numpy
- name: Get dates
id: dates
run: |
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "yesterday=$(date +'%Y-%m-%d' -d yesterday)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d' -d 'last saturday')" >> $GITHUB_OUTPUT
- name: Download Cached GCC + LLVM Binaries
if: ${{ matrix.config.sim }} != "Native"
id: cache-gcc
uses: actions/cache/restore@v4
env:
cache-name: cache-gcc-binaries
with:
path: |
./Toolchain
!./Toolchain/*.sh
fail-on-cache-miss: true
key: gcc-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
gcc-binaries-${{ steps.dates.outputs.yesterday }}
gcc-binaries-${{ steps.dates.outputs.date }}
gcc-binaries-
- name: Install Spike Dependencies
if: ${{ matrix.config.sim }} == "Spike"
run: |
sudo apt-get install libboost-all-dev
sudo apt-get install device-tree-compiler
- name: Download Spike Cache
if: ${{ matrix.config.sim }} == "Spike"
id: cache-Spike
uses: actions/cache/restore@v4
env:
cache-name: cache-spike-binaries
with:
path: ./Sim/Spike/bin
fail-on-cache-miss: true
key: spike-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
spike-binaries-${{ steps.dates.outputs.yesterday }}
spike-binaries-${{ steps.dates.outputs.date }}
spike-binaries-
- name: Download TFLM
working-directory: ./Integration/tflm_builtin
run: |
git clone https://github.com/tensorflow/tflite-micro.git
if [[ "${{ matrix.tflm_ref }}" != "" ]]
then
git -C tflite-micro checkout ${{ matrix.tflm_ref }}
fi
- name: Patch TFLM
working-directory: ./Integration/tflm_builtin/tflite-micro
run: git apply ../muriscv_nn.patch
- name: TFLM Integration Test for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }}, VLEN = ${{ matrix.config.vlen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tflm_builtin/tflite-micro
run: ../tflm_integration_tests.sh ${{ matrix.config.vext }} ${{ matrix.config.pext }} ${{ matrix.config.portable }} ${{ matrix.config.mode }} ${{ matrix.config.toolchain }} ${{ matrix.config.arch }} ${{ matrix.config.vlen }} ${{ matrix.config.elen }} ${{ matrix.config.sim }}
TVM_Integration_Tests:
strategy:
fail-fast: false
matrix:
tvm_version:
- stable # latest stable release (on PyPI)
- nightly # latest nightly release (on PyPI)
- 0.11.1 # Last working release (on PyPI, needs to be updated manually)
config:
- {vext_flag: "", portable_flag: "", pext_flag: "", toolchain: "x86", arch: "", vlen: 0, elen: 0, sim: "Native"}
- {vext_flag: "", portable_flag: "", pext_flag: "", toolchain: "GCC", arch: "rv32gc", vlen: 0, elen: 0, sim: "Spike"}
- {vext_flag: "", pext_flag: "", toolchain: "LLVM", arch: "rv32gc", vlen: 0, elen: 0, sim: "Spike"}
# - {vext_flag: "", portable_flag: "", pext_flag: "-p", toolchain: "GCC", arch: "rv32gcp", vlen: 0, elen: 0, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
name: TVM Integration Tests
runs-on: ubuntu-22.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
- name: Get dates
id: dates
run: |
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "yesterday=$(date +'%Y-%m-%d' -d yesterday)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d' -d 'last saturday')" >> $GITHUB_OUTPUT
- name: Download Cached GCC + LLVM Binaries
if: ${{ matrix.config.sim }} != "Native"
id: cache-gcc
uses: actions/cache/restore@v4
env:
cache-name: cache-gcc-binaries
with:
path: |
./Toolchain
!./Toolchain/*.sh
fail-on-cache-miss: true
key: gcc-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
gcc-binaries-${{ steps.dates.outputs.yesterday }}
gcc-binaries-${{ steps.dates.outputs.date }}
gcc-binaries-
- name: Install Spike Dependencies
if: ${{ matrix.config.sim }} == "Spike"
run: |
sudo apt-get install libboost-all-dev
sudo apt-get install device-tree-compiler
- name: Download Spike Cache
if: ${{ matrix.config.sim }} == "Spike"
id: cache-Spike
uses: actions/cache/restore@v4
env:
cache-name: cache-spike-binaries
with:
path: ./Sim/Spike/bin
fail-on-cache-miss: true
key: spike-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
spike-binaries-${{ steps.dates.outputs.yesterday }}
spike-binaries-${{ steps.dates.outputs.date }}
spike-binaries-
- name: TVM Integration Test AWW for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }}, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tvm
if: '!cancelled()'
run: ./run_tvm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b aww
env:
TVM_VERSION: ${{ matrix.tvm_version }}
- name: TVM Integration Test VWW for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }}, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tvm
if: '!cancelled()'
run: ./run_tvm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b vww -S
env:
TVM_VERSION: ${{ matrix.tvm_version }}
- name: TVM Integration Test RESNET for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }}, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tvm
if: '!cancelled()'
run: ./run_tvm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b ic -S
env:
TVM_VERSION: ${{ matrix.tvm_version }}
- name: TVM Integration Test TOYCAR for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }}, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tvm
if: '!cancelled()'
run: ./run_tvm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b toy -S
env:
TVM_VERSION: ${{ matrix.tvm_version }}
TFLM_Integration_Tests:
strategy:
fail-fast: false
matrix:
tflm_ref:
- main # latest upstream
- 8eb6b23de4470d6a8da3131650d6a67514dfa130 # Last working commit (needs to be updated manually)
config:
- {vext_flag: "", portable_flag: "", pext_flag: "", toolchain: "x86", arch: "", vlen: 0, elen: 0, sim: "Native"}
- {vext_flag: "", portable_flag: "", pext_flag: "", toolchain: "GCC", arch: "rv32gc", vlen: 0, elen: 0, sim: "Spike"}
- {vext_flag: "", portable_flag: "", pext_flag: "", toolchain: "LLVM", arch: "rv32gc", vlen: 0, elen: 0, sim: "Spike"}
# - {vext_flag: "", portable_flag: "", pext_flag: "-p", toolchain: "GCC", arch: "rv32gcp", vlen: 0, elen: 0, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 128, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "GCC", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
- {vext_flag: "-v", portable_flag: "-x", pext_flag: "", toolchain: "LLVM", arch: "rv32gcv", vlen: 512, elen: 64, sim: "Spike"}
name: TFLM Integration Tests
runs-on: ubuntu-22.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
- name: Get dates
id: dates
run: |
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "yesterday=$(date +'%Y-%m-%d' -d yesterday)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d' -d 'last saturday')" >> $GITHUB_OUTPUT
- name: Download Cached GCC + LLVM Binaries
if: ${{ matrix.config.sim }} != "Native"
id: cache-gcc
uses: actions/cache/restore@v4
env:
cache-name: cache-gcc-binaries
with:
path: |
./Toolchain
!./Toolchain/*.sh
fail-on-cache-miss: true
key: gcc-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
gcc-binaries-${{ steps.dates.outputs.yesterday }}
gcc-binaries-${{ steps.dates.outputs.date }}
gcc-binaries-
- name: Install Spike Dependencies
if: ${{ matrix.config.sim }} == "Spike"
run: |
sudo apt-get install libboost-all-dev
sudo apt-get install device-tree-compiler
- name: Download Spike Cache
if: ${{ matrix.config.sim }} == "Spike"
id: cache-Spike
uses: actions/cache/restore@v4
env:
cache-name: cache-spike-binaries
with:
path: ./Sim/Spike/bin
fail-on-cache-miss: true
key: spike-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
spike-binaries-${{ steps.dates.outputs.yesterday }}
spike-binaries-${{ steps.dates.outputs.date }}
spike-binaries-
- name: Install TFLM dependencies
run: |
sudo apt-get install python3-setuptools
pip3 install wheel
pip3 install Pillow
pip3 install Wave
pip3 install numpy
- name: Download TFLM and build Source Tree
working-directory: ./Integration/tflm
run: ./download_tflm.sh
env:
TFLM_REF: ${{ matrix.tflm_ref }}
- name: TFLM Integration Test AWW for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }} with Spike, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tflm
if: '!cancelled()'
run: ./run_tflm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b aww
- name: TFLM Integration Test VWW for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }} with Spike, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tflm
if: '!cancelled()'
run: ./run_tflm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b vww -S
- name: TFLM Integration Test RESNET for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }} with Spike, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tflm
if: '!cancelled()'
run: ./run_tflm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b ic -S
- name: TFLM Integration Test TOYCAR for ${{ matrix.config.arch }} muRISCV-NN with ${{ matrix.config.toolchain }} with Spike, VLEN = ${{ matrix.config.vlen }}, ELEN = ${{ matrix.config.elen }}, SIM = ${{ matrix.config.sim }}
working-directory: ./Integration/tflm
if: '!cancelled()'
run: ./run_tflm_integration_tests.sh ${{ matrix.config.vext_flag }} ${{ matrix.config.portable_flag }} ${{ matrix.config.pext_flag }} -t ${{ matrix.config.toolchain }} -l ${{ matrix.config.vlen }} -e ${{ matrix.config.elen }} -s ${{ matrix.config.sim }} -b toy -S