forked from XiaoMi/mace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci-new.yml
286 lines (263 loc) · 9.02 KB
/
.gitlab-ci-new.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
stages:
- .pre
- linting
- build
- test
- benchmark
- model_validate
- .post
variables:
MI_9_SE: 22927ca0
REDMI_K30_PRO: 1a6be0d8
MI_NOTE_3: f13dacf7
SIRIUS: aa52c843
ANDROID_NDK_HOME: /opt/android-ndk-r17b
IMAGE_TAG_VERSION: tmp
clean-device-workspace:
stage: .pre
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
only:
- schedule
script:
- adb -s $REDMI_K30_PRO shell "rm -rf /data/local/tmp/*"
check-env:
stage: .pre
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
script:
- adb devices
- ls -lh ~/.ssh
- ssh [email protected] echo "Hi, This is raspberrypi"
cpplint:
stage: linting
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
script:
- sh tools/cpplint.sh
pylint:
stage: linting
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
script:
- pycodestyle . --filename=*.py --exclude=examples,third_party
build_docs:
stage: build
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
when: manual
script:
- cd docs && make html
artifacts:
paths:
- docs/_build
linux-x64:build:
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
stage: build
artifacts:
paths:
- build/cmake-build/host/install
script:
- RUNTIME=CPU QUANTIZE=ON tools/cmake/cmake-build-host.sh
linux-x64:test:
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
stage: test
needs:
- "linux-x64:build"
dependencies:
- "linux-x64:build"
script:
- ls build -lh
- ./build/cmake-build/host/install/bin/mace_cc_test host/install/bin/mace_cc_test --gtest_filter=*:-*GPU*:*OPENCL*:*Quant*:*OpenCL*:*DepthwiseDeconv2dOpTest*:*EltwiseOpTest*:*FullyConnectedOpTest*:*Gather*:*CPUFall*:*PadTest*:*QUANT*:*SpaceToBatchTest*:*BiasAddSimple2DCPU*:*Conv2dOpTest*
linux-x64:model_validate:
stage: model_validate
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "linux-x64:build"
dependencies:
- "linux-x64:build"
before_script:
- echo "git clone mace-models"
- rm -rf mace-models
- git clone https://github.com/XiaoMi/mace-models.git
script:
- TARGET_SOCS=random
- CONF_FILE=mace-models/mobilenet-v1/mobilenet-v1.yml
- python tools/python/convert.py --config=${CONF_FILE}
- python tools/python/run_model.py --config=${CONF_FILE} --target_socs=$TARGET_SOCS --target_abi=host --validate --benchmark --runtime=cpu
linux-arm-quant:build:
stage: build
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
script:
- LINARO_ARM_LINUX_GNUEABIHF=/usr RUNTIME=CPU QUANTIZE=ON ./tools/cmake/cmake-build-arm-linux-gnueabihf.sh
android-aarch64-gpu&quant:build:
stage: build
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
artifacts:
paths:
- build/cmake-build/arm64-v8a/install
script:
- RUNTIME=GPU QUANTIZE=ON tools/cmake/cmake-build-arm64-v8a.sh
- LIBMACE64_FULL_SIZE=`stat -c%s build/cmake-build/arm64-v8a/install/lib/libmace.so`
- if (( LIBMACE64_FULL_SIZE > 2500000 )) ; then echo "The libmace.so size too large"; exit 1; fi
android-aarch64-gpu&quant:test:
stage: test
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- android-aarch64-gpu&quant:build
dependencies:
- android-aarch64-gpu&quant:build
tags:
- mace-host
script:
- adb -s $REDMI_K30_PRO shell rm -rf /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install
- adb -s $REDMI_K30_PRO push build/cmake-build/arm64-v8a/install /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install
- adb -s $REDMI_K30_PRO shell /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install/bin/mace_cc_test
- adb -s $REDMI_K30_PRO shell rm -rf /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install
android-aarch64-gpu&quant:benchmark:
stage: benchmark
when: manual
needs:
- android-aarch64-gpu&quant:build
dependencies:
- android-aarch64-gpu&quant:build
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
script:
- adb -s $REDMI_K30_PRO shell rm -rf /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install
- adb -s $REDMI_K30_PRO push build/cmake-build/arm64-v8a/install /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install
- adb -s $REDMI_K30_PRO shell /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install/bin/mace_cc_benchmark
- adb -s $REDMI_K30_PRO shell rm -rf /data/local/$IMAGE_TAG_VERSION/${CI_JOB_ID}_install
android-aarch64-gpu:model_validate:
stage: model_validate
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "android-aarch64-gpu&quant:build"
dependencies:
- "android-aarch64-gpu&quant:build"
before_script:
- echo "git clone mace-models"
- rm -rf mace-models
- git clone https://github.com/XiaoMi/mace-models.git
script:
- CONF_FILE=mace-models/mobilenet-v1/mobilenet-v1.yml
- python tools/python/convert.py --config=${CONF_FILE}
- python tools/python/run_model.py --config=${CONF_FILE} --target_socs=random --target_abi=arm64-v8a --validate --benchmark --runtime=gpu
android-aarch64-hexagon_dsp:build:
stage: build
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
artifacts:
paths:
- build/cmake-build/arm64-v8a/install
script:
- RUNTIME=HEXAGON QUANTIZE=ON tools/cmake/cmake-build-arm64-v8a.sh
android-aarch64-hexagon_dsp:model_validate:
stage: model_validate
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "android-aarch64-hexagon_dsp:build"
dependencies:
- "android-aarch64-hexagon_dsp:build"
before_script:
- echo "git clone mace-models"
- rm -rf mace-models
- git clone https://github.com/XiaoMi/mace-models.git
script:
- CONF_FILE=mace-models/mobilenet-v1/mobilenet-v1-quantize-retrain-dsp.yml
- python tools/python/convert.py --config=${CONF_FILE}
- python tools/python/run_model.py --config=${CONF_FILE} --target_socs=sdm660 --target_abi=arm64-v8a --validate --benchmark --runtime=dsp
android-aarch64-hexagon_hta:build:
stage: build
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
artifacts:
paths:
- build/cmake-build/arm64-v8a/install
script:
- git reset origin/hta third_party/hta && git checkout third_party/hta
- RUNTIME=HTA QUANTIZE=ON tools/cmake/cmake-build-arm64-v8a.sh
android-aarch64-hexagon_hta:model_validate:
stage: model_validate
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "android-aarch64-hexagon_hta:build"
dependencies:
- "android-aarch64-hexagon_hta:build"
before_script:
- echo "git clone mace-models"
- rm -rf mace-models
- git clone https://github.com/XiaoMi/mace-models.git
script:
- CONF_FILE=mace-models/mobilenet-v1/mobilenet-v1-quantize-retrain-hta.yml
- python tools/python/convert.py --config=${CONF_FILE}
- python tools/python/run_model.py --config=${CONF_FILE} --target_socs=REDMI_K30_PRO --target_abi=arm64-v8a --validate --benchmark --runtime=hta
android-aarch64-cpu/uint8:model_validate:
stage: model_validate
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "android-aarch64-gpu&quant:build"
dependencies:
- "android-aarch64-gpu&quant:build"
before_script:
- echo "git clone mace-models"
- rm -rf mace-models
- git clone https://github.com/XiaoMi/mace-models.git
script:
- TARGET_SOCS=random
- CONF_FILE=mace-models/mobilenet-v1/mobilenet-v1-quantize-friendly.yml
- python tools/python/convert.py --config=${CONF_FILE}
- python tools/python/run_model.py --config=${CONF_FILE} --target_socs=random --target_abi=arm64-v8a --validate --benchmark --runtime=cpu
host-micro-cmsis:build:
variables:
GIT_SUBMODULE_STRATEGY: recursive
stage: build
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
artifacts:
paths:
- build/micro
script:
- ./micro/tools/cmake/cmake-build-host.sh -DMACE_MICRO_ENABLE_TESTS=ON -DMACE_MICRO_ENABLE_CMSIS=ON
host-micro-cmsis:test:
stage: test
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "host-micro-cmsis:build"
dependencies:
- "host-micro-cmsis:build"
script:
- build/micro/host/test/ccunit/micro_ops_test
host-micro-cmsis:benchmark:
stage: benchmark
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
needs:
- "host-micro-cmsis:build"
dependencies:
- "host-micro-cmsis:build"
script:
- build/micro/host/test/ccbenchmark/micro_cc_benchmark
none-micro-m4:build:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
stage: build
tags:
- mace-host
image: cr.d.xiaomi.net/zhangzhimin1/mace-dev2:$IMAGE_TAG_VERSION
artifacts:
paths:
- build/micro/
script:
- ./micro/tools/cmake/cmake-build-gcc-arm-none-eabi.sh -DARM_CPU=cortex-m7 -DMACE_MICRO_ENABLE_CMSIS=ON -DMACE_MICRO_ENABLE_TESTS=OFF