[MSLITE][DEVELOP] add npu+fp16 ci for lite

This commit is contained in:
yangruoqi713 2021-07-05 14:24:37 +08:00
parent eeac849968
commit f77fa7150a
2 changed files with 99 additions and 1 deletions

View File

@ -0,0 +1,73 @@
mobilenet_v1_0.25_128.tflite 2.5
mobilenet_v2_1.0_224.tflite 2.5
squeezenet.tflite 2.5
inception_resnet_v2.tflite 2
inception_v3.tflite 1
inception_v4.tflite 0.5
efficientnet_lite0_fp32_2.tflite 1
efficientnet_lite1_fp32_2.tflite 1
efficientnet_lite2_fp32_2.tflite 1
efficientnet_lite3_fp32_2.tflite 1
efficientnet_lite4_fp32_2.tflite 1
deeplabv3_1_default_1.tflite 2.5
6c_seg_nomean_20200610 1.5
ml_video_edit_person_divison 0.5
ml_video_edit_style_transfer_autoportrait.onnx 9
ml_video_edit_style_transfer_candy.onnx 11
ml_video_edit_style_transfer_gongnongbing.onnx 11
ml_video_edit_style_transfer_starry.onnx 11
porseg_tmp.onnx;2 1
ml_video_edit_Mnet 1.5
ml_video_edit_hairSeg_have_imageProcessLayer_interpTo145 0.5
ml_video_edit_img_segment 1
ml_video_edit_video_segment_gauss_adaptis_part1 2
ml_video_edit_generate_filter.pb 1
ml_video_edit_img_segment_adaptise.pb;2 0.5
ml_video_edit_video_segment_gauss_adaptis_part2.pb;2 10
ml_video_edit_person_divison_pic 0.5
ml_video_edit_person_divison_video;2 13
ml_video_edit_judge.onnx 5
ml_video_edit_vignet.onnx 0.5
hdc_Face_Aesthetic_MTI_Aesthetic 0.5
hdc_Face_Emotion_MTI_Aesthetic.onnx 33
hdc_Face_Landmark5_MTI_Aesthetic.onnx 0.5
hdc_Image_Aesthetic_MTI_Aesthetic.onnx 0.5
hdc_mobilenet_1w_class.onnx 10
hdc_resnet_1w_class.onnx 5
#hdc_age_medium 6
hdc_contour_pose_128 4
hdc_emotion 0.5
hdc_fivembnet 0.5
hdc_isface 0.5
hdc_mobilenetface 4
#hdc_retinaface #too many subgraphs
hdc_resnet 3
ml_video_edit_detect 1
ml_video_edit_hairSeg_have_imageProcessLayer_interpTo145_20210121 0.5
ml_video_edit_have_imageProcessLayer_interpTo145_20201015 0.5
ml_video_edit_MnetN367_extract_1010_pay 0.5
ml_video_edit_reid 0.5
ml_video_edit_v10_best_model_nomean_20200723 8
#hdc_ocr_attention.onnx 0.5 #too many subgraphs
#hdc_ocr_detect.onnx 30 #too many subgraphs
ml_edu_kit_hand_detection.onnx 1
ml_edu_kit_hand_key_position.onnx 2
ml_video_edit_oneclick_adaptis.pb;3 2.4
densenet.tflite 3
resnet_v2_101_299.tflite 1
ml_video_edit_enhance.pb 2
ml_video_edit_video_segment_gauss_adaptis_part2_pb2tflite.tflite;2 10
ml_video_edit_img_segment_adaptise_pb2tflite.tflite;2 0.5
#the fifth value of the ml_video_edit_imitate_filter.onnx's output is very small (10-5).
ml_video_edit_imitate_filter.onnx 200
hdc_mobilenet_1w_class.onnx 20
hdc_age_medium 504
posenet_mobilenet_float_075_1_default_1.tflite 395
nasnet_mobile.tflite 1
#ml_video_edit_art_generate.onnx, output is out of range
ml_video_edit_art_transfer.onnx;3 3
ml_video_edit_enhance_update_tmp.onnx 0.5
#ml_video_edit_art_generate_20210513.onnx, output is out of range
ml_video_edit_art_transfer_20210513.onnx;3 1
ml_video_edit_hair_dyeing_segmodel_v2 0.5
ml_video_edit_makeup_mobilenetv203.onnx 2

View File

@ -32,6 +32,17 @@ function Run_npu() {
Run_Benchmark "${npu_cfg_file_list[*]}" . '/data/local/tmp' $run_npu_log_file $run_benchmark_result_file 'arm64' 'NPU' $device_id
}
# Run on npu and fp16 platform:
function Run_npu_fp16() {
# Push files to the phone
Push_Files $arm64_path "aarch64" $version $benchmark_test_path "adb_push_log.txt" $device_id
# Prepare the config file list
local npu_fp16_cfg_file_list=("$models_npu_fp16_config")
# Run converted models:
# $1:cfgFileList; $2:modelPath; $3:dataPath; $4:logFile; $5:resultFile; $6:platform; $7:processor; $8:phoneId;
Run_Benchmark "${npu_fp16_cfg_file_list[*]}" . '/data/local/tmp' $run_npu_fp16_log_file $run_benchmark_result_file 'arm64' 'NPU' $device_id
}
basepath=$(pwd)
echo ${basepath}
#set -e
@ -70,6 +81,7 @@ version=${file_name_array[2]}
# Set models config filepath
models_npu_config=${basepath}/../config/models_npu.cfg
models_npu_fp16_config=${basepath}/../config/models_npu_fp16.cfg
ms_models_path=${basepath}/ms_models
@ -104,6 +116,9 @@ echo ' ' > ${run_benchmark_result_file}
run_npu_log_file=${basepath}/run_npu_log.txt
echo 'run npu logs: ' > ${run_npu_log_file}
run_npu_fp16_log_file=${basepath}/run_npu_fp16_log.txt
echo 'run npu fp16 logs: ' > ${run_npu_fp16_log_file}
# Copy the MindSpore models:
echo "Push files to the arm and run benchmark"
benchmark_test_path=${basepath}/benchmark_test
@ -131,8 +146,18 @@ if [[ $backend == "all" || $backend == "npu" ]]; then
cat ${run_npu_log_file}
isFailed=1
fi
echo "start Run npu fp16 ..."
Run_npu_fp16
Run_npu_fp16_status=$?
sleep 1
if [[ ${Run_npu_fp16_status} != 0 ]];then
echo "Run_npu_fp16 failed"
cat ${run_npu_fp16_log_file}
isFailed=1
fi
fi
echo "Run_npu is ended"
echo "Run_npu and Run_npu_fp16 ended"
Print_Benchmark_Result $run_benchmark_result_file
exit ${isFailed}