Browse Source

add model st for micro

pull/15866/head
yangjie159 4 years ago
parent
commit
d02812be83
3 changed files with 14 additions and 6 deletions
  1. +1
    -0
      mindspore/lite/test/codegen/models_codegen.cfg
  2. +1
    -0
      mindspore/lite/test/models_onnx.cfg
  3. +12
    -6
      mindspore/lite/test/run_benchmark_nets.sh

mindspore/lite/test/codegen/models_tflite.cfg → mindspore/lite/test/codegen/models_codegen.cfg View File

@@ -169,3 +169,4 @@ Q_AADB_HADB_MBV2_model.tflite
# text_classification.tflite
# Q_detect_fpn_add_inception-1448650.tflite
# Q_hand_0812_pb2tflite.tflite
simple_IPS_model_4D_input.onnx

+ 1
- 0
mindspore/lite/test/models_onnx.cfg View File

@@ -78,3 +78,4 @@ bloom_hongmo_detection_tmp.onnx
Q_face_recognition.onnx
Q888_face_recognition.onnx
Q888_iris_detect.onnx
simple_IPS_model_4D_input.onnx

+ 12
- 6
mindspore/lite/test/run_benchmark_nets.sh View File

@@ -2333,21 +2333,27 @@ function Run_x86_codegen() {
continue
fi
echo ${model_name} >> "${run_x86_codegen_log_file}"
${CODEGEN_PATH}/codegen --codePath=${build_path} --modelPath=${ms_models_path}/${model_name}.ms >> ${run_x86_codegen_log_file}
local PARALLEL=$1
${CODEGEN_PATH}/codegen --codePath=${build_path} --modelPath=${ms_models_path}/${model_name}.ms --supportParallel=${PARALLEL} >> ${run_x86_codegen_log_file}
# 1. build benchmark
mkdir -p ${build_path}/${model_name}/build && cd ${build_path}/${model_name}/build || exit 1
cmake -DPKG_PATH=${x86_path}/mindspore-lite-${version}-inference-linux-x64 ${build_path}/${model_name} >> ${run_x86_codegen_log_file}
make >> ${run_x86_codegen_log_file}
# 2. run benchmark
echo "net file: ${build_path}/${model_name}/src/net.bin" >> ${run_x86_codegen_log_file}
echo "./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out" >> ${run_x86_codegen_log_file}
./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out >> ${run_x86_codegen_log_file}
if [[ "${PARALLEL}" == "false" ]]; then
echo "./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out" >> ${run_x86_codegen_log_file}
./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out >> ${run_x86_codegen_log_file}
else
echo "./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out 4 0" >> ${run_x86_codegen_log_file}
./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out 4 0 >> ${run_x86_codegen_log_file}
fi
if [ $? = 0 ]; then
run_result='x86_codegen: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file}
else
run_result='x86_codegen: '${model_name}' failed'; echo ${run_result} >> ${run_benchmark_result_file}; return 1
fi
done < ${codegen_models_tflite_config}
done < ${models_codegen_config}

rm -rf ${build_path}
}
@@ -2446,7 +2452,7 @@ models_compatibility_config=${basepath}/models_compatibility.cfg
models_with_multiple_inputs_config=${basepath}/models_with_multiple_inputs.cfg
models_for_process_only_config=${basepath}/models_for_process_only.cfg
models_tf_weightquant_config=${basepath}/models_tf_weightquant.cfg
codegen_models_tflite_config=${basepath}/codegen/models_tflite.cfg
models_codegen_config=${basepath}/codegen/models_codegen.cfg

ms_models_path=${basepath}/ms_models
build_path=${basepath}/codegen_build
@@ -2561,7 +2567,7 @@ fi
if [[ $backend == "all" || $backend == "x86-all" || $backend == "x86-codegen" ]]; then
# Run on x86-java
echo "start Run x86 codegen ..."
Run_x86_codegen`` &
Run_x86_codegen "false" &
Run_x86_codegen_PID=$!
sleep 1
fi


Loading…
Cancel
Save