forked from XiaoMi/mobile-ai-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
51 lines (48 loc) · 2.55 KB
/
.gitlab-ci.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
stages:
- cpplint
- pycodestyle
- benchmark
cpplint:
stage: cpplint
script:
- curl -o cpplint.py https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
- python cpplint.py --linelength=80 --counting=detailed $(find aibench -name "*.h" -or -name "*.cc")
pycodestyle:
stage: pycodestyle
script:
- pycodestyle $(find aibench/python -name "*.py")
benchmark:
stage: benchmark
script:
- DATE_STR=`date "+%Y_%m_%d"`
- CI_PROJECT_OUTPUT_PATH=/mace-build-output/$CI_PROJECT_NAME/${DATE_STR}_${CI_PIPELINE_ID}
- mkdir -p $CI_PROJECT_OUTPUT_PATH
- ANDROID_NDK_HOME=/opt/android-ndk-r15c
- DAY_OF_WEEK=`date +%u`
- >
if [ $DAY_OF_WEEK -lt 6 ]; then
bash tools/benchmark.sh --output_dir=$CI_PROJECT_OUTPUT_PATH --benchmark_option=Precision --target_abis=armeabi-v7a,arm64-v8a --max_time_per_lock=30 --executors=MACE --input_dir=http --num_targets=1;
bash tools/benchmark.sh --output_dir=$CI_PROJECT_OUTPUT_PATH --target_abis=armeabi-v7a,arm64-v8a --max_time_per_lock=30 --num_targets=1;
else
bash tools/benchmark.sh --output_dir=$CI_PROJECT_OUTPUT_PATH --benchmark_option=Precision --target_abis=armeabi-v7a,arm64-v8a --max_time_per_lock=30 --executors=MACE --input_dir=http;
bash tools/benchmark.sh --output_dir=$CI_PROJECT_OUTPUT_PATH --target_abis=armeabi-v7a,arm64-v8a --max_time_per_lock=30;
fi
- >
cp $CI_PROJECT_OUTPUT_PATH/*_report.csv .;
echo "------------------------------------------------------------------";
echo "Prepare Time (see FAQ section in README for more explanations)";
echo "------------------------------------------------------------------";
python -c 'import prettytable,sys;print(prettytable.from_csv(sys.stdin));'<prepare_report.csv;
echo "------------------------------------------------------------------";
echo "Run Time Average (See FAQ section in README for more explanations)";
echo "------------------------------------------------------------------";
python -c 'import prettytable,sys;print(prettytable.from_csv(sys.stdin));'<run_report.csv;
echo "------------------------------------------------------------------";
echo "ImageNet Precision (see FAQ section in README for more explanations)";
echo "------------------------------------------------------------------";
python -c 'import prettytable,sys;print(prettytable.from_csv(sys.stdin));'<precision_report.csv;
artifacts:
paths:
- prepare_report.csv
- run_report.csv
- precision_report.csv