|
|
@@ -68,10 +68,12 @@ function Run_Converter() { |
|
|
|
|
|
|
|
|
# Convert mindspore models: |
|
|
# Convert mindspore models: |
|
|
while read line; do |
|
|
while read line; do |
|
|
model_name=${line} |
|
|
|
|
|
if [[ $model_name == \#* ]]; then |
|
|
|
|
|
|
|
|
mindspore_line_info=${line} |
|
|
|
|
|
if [[ $mindspore_line_info == \#* ]]; then |
|
|
continue |
|
|
continue |
|
|
fi |
|
|
fi |
|
|
|
|
|
model_name=`echo ${mindspore_line_info}|awk -F ' ' '{print $1}'` |
|
|
|
|
|
accuracy_limit=`echo ${mindspore_line_info}|awk -F ' ' '{print $2}'` |
|
|
echo ${model_name} >> "${run_converter_log_file}" |
|
|
echo ${model_name} >> "${run_converter_log_file}" |
|
|
echo './converter_lite --fmk=MINDIR --modelFile='${models_path}'/'${model_name}' --outputFile='${ms_models_path}'/'${model_name}'' >> "${run_converter_log_file}" |
|
|
echo './converter_lite --fmk=MINDIR --modelFile='${models_path}'/'${model_name}' --outputFile='${ms_models_path}'/'${model_name}'' >> "${run_converter_log_file}" |
|
|
./converter_lite --fmk=MINDIR --modelFile=${models_path}/${model_name} --outputFile=${ms_models_path}/${model_name} |
|
|
./converter_lite --fmk=MINDIR --modelFile=${models_path}/${model_name} --outputFile=${ms_models_path}/${model_name} |
|
|
@@ -385,15 +387,18 @@ function Run_x86() { |
|
|
|
|
|
|
|
|
# Run mindspore converted models: |
|
|
# Run mindspore converted models: |
|
|
while read line; do |
|
|
while read line; do |
|
|
model_name=${line} |
|
|
|
|
|
if [[ $model_name == \#* ]]; then |
|
|
|
|
|
|
|
|
mindspore_line_info=${line} |
|
|
|
|
|
if [[ $mindspore_line_info == \#* ]]; then |
|
|
continue |
|
|
continue |
|
|
fi |
|
|
fi |
|
|
echo ${model_name} >> "${run_x86_log_file}" |
|
|
|
|
|
|
|
|
model_name=`echo ${mindspore_line_info}|awk -F ' ' '{print $1}'` |
|
|
|
|
|
accuracy_limit=`echo ${mindspore_line_info}|awk -F ' ' '{print $2}'` |
|
|
|
|
|
echo "---------------------------------------------------------" >> "${run_x86_log_file}" |
|
|
|
|
|
echo "mindspore run: ${model_name}, accuracy limit:${accuracy_limit}" >> "${run_x86_log_file}" |
|
|
echo 'cd '${x86_path}'/mindspore-lite-'${version}'-runtime-x86-'${process_unit_x86} >> "${run_x86_log_file}" |
|
|
echo 'cd '${x86_path}'/mindspore-lite-'${version}'-runtime-x86-'${process_unit_x86} >> "${run_x86_log_file}" |
|
|
cd ${x86_path}/mindspore-lite-${version}-runtime-x86-${process_unit_x86} || return 1 |
|
|
cd ${x86_path}/mindspore-lite-${version}-runtime-x86-${process_unit_x86} || return 1 |
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile='${ms_models_path}'/'${model_name}'.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'.ms.out' >> "${run_x86_log_file}" |
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile='${ms_models_path}'/'${model_name}'.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'.ms.out' >> "${run_x86_log_file}" |
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile=${ms_models_path}/${model_name}.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/${model_name}.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}.ms.out --accuracyThreshold=1.5 >> "${run_x86_log_file}" |
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile=${ms_models_path}/${model_name}.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/${model_name}.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}.ms.out --accuracyThreshold=${accuracy_limit} >> "${run_x86_log_file}" |
|
|
if [ $? = 0 ]; then |
|
|
if [ $? = 0 ]; then |
|
|
run_result='x86: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
run_result='x86: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
else |
|
|
else |
|
|
@@ -633,15 +638,18 @@ function Run_x86_sse() { |
|
|
|
|
|
|
|
|
# Run mindspore converted models: |
|
|
# Run mindspore converted models: |
|
|
while read line; do |
|
|
while read line; do |
|
|
model_name=${line} |
|
|
|
|
|
if [[ $model_name == \#* ]]; then |
|
|
|
|
|
|
|
|
mindspore_line_info=${line} |
|
|
|
|
|
if [[ $mindspore_line_info == \#* ]]; then |
|
|
continue |
|
|
continue |
|
|
fi |
|
|
fi |
|
|
echo ${model_name} >> "${run_x86_sse_log_file}" |
|
|
|
|
|
|
|
|
model_name=`echo ${mindspore_line_info}|awk -F ' ' '{print $1}'` |
|
|
|
|
|
accuracy_limit=`echo ${mindspore_line_info}|awk -F ' ' '{print $2}'` |
|
|
|
|
|
echo "---------------------------------------------------------" >> "${run_x86_sse_log_file}" |
|
|
|
|
|
echo "mindspore run: ${model_name}, accuracy limit:${accuracy_limit}" >> "${run_x86_sse_log_file}" |
|
|
echo 'cd '${x86_path}'/mindspore-lite-'${version}'-runtime-x86-sse-'${process_unit_x86} >> "${run_x86_sse_log_file}" |
|
|
echo 'cd '${x86_path}'/mindspore-lite-'${version}'-runtime-x86-sse-'${process_unit_x86} >> "${run_x86_sse_log_file}" |
|
|
cd ${x86_path}/mindspore-lite-${version}-runtime-x86-sse-${process_unit_x86} || return 1 |
|
|
cd ${x86_path}/mindspore-lite-${version}-runtime-x86-sse-${process_unit_x86} || return 1 |
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile='${ms_models_path}'/'${model_name}'.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'.ms.out' >> "${run_x86_sse_log_file}" |
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile='${ms_models_path}'/'${model_name}'.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'.ms.out' >> "${run_x86_sse_log_file}" |
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile=${ms_models_path}/${model_name}.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/${model_name}.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}.ms.out --accuracyThreshold=1.5 >> "${run_x86_sse_log_file}" |
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib:./third_party/libjpeg-turbo/lib:./third_party/opencv/lib;./benchmark/benchmark --modelFile=${ms_models_path}/${model_name}.ms --inDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/input/${model_name}.ms.bin --benchmarkDataFile=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}.ms.out --accuracyThreshold=${accuracy_limit} >> "${run_x86_sse_log_file}" |
|
|
if [ $? = 0 ]; then |
|
|
if [ $? = 0 ]; then |
|
|
run_result='x86_sse: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
run_result='x86_sse: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
else |
|
|
else |
|
|
@@ -1047,14 +1055,16 @@ function Run_arm64() { |
|
|
|
|
|
|
|
|
# Run mindir converted models: |
|
|
# Run mindir converted models: |
|
|
while read line; do |
|
|
while read line; do |
|
|
model_name=${line} |
|
|
|
|
|
if [[ $model_name == \#* ]]; then |
|
|
|
|
|
|
|
|
mindspore_line_info=${line} |
|
|
|
|
|
if [[ $mindspore_line_info == \#* ]]; then |
|
|
continue |
|
|
continue |
|
|
fi |
|
|
fi |
|
|
echo ${model_name} >> "${run_arm64_log_file}" |
|
|
|
|
|
|
|
|
model_name=`echo ${mindspore_line_info}|awk -F ' ' '{print $1}'` |
|
|
|
|
|
accuracy_limit=`echo ${mindspore_line_info}|awk -F ' ' '{print $2}'` |
|
|
|
|
|
echo "mindspore run: ${model_name}, accuracy limit:${accuracy_limit}" >> "${run_arm64_log_file}" |
|
|
echo 'cd /data/local/tmp/benchmark_test' > adb_run_cmd.txt |
|
|
echo 'cd /data/local/tmp/benchmark_test' > adb_run_cmd.txt |
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --inDataFile=/data/local/tmp/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/data/local/tmp/input_output/output/'${model_name}'.ms.out --accuracyThreshold=1.5' >> "${run_arm64_log_file}" |
|
|
|
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --inDataFile=/data/local/tmp/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/data/local/tmp/input_output/output/'${model_name}'.ms.out --accuracyThreshold=1.5' >> adb_run_cmd.txt |
|
|
|
|
|
|
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --inDataFile=/data/local/tmp/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/data/local/tmp/input_output/output/'${model_name}'.ms.out --accuracyThreshold='${accuracy_limit} >> "${run_arm64_log_file}" |
|
|
|
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile='${model_name}'.ms --inDataFile=/data/local/tmp/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/data/local/tmp/input_output/output/'${model_name}'.ms.out --accuracyThreshold='${accuracy_limit} >> adb_run_cmd.txt |
|
|
adb -s ${device_id} shell < adb_run_cmd.txt >> "${run_arm64_log_file}" |
|
|
adb -s ${device_id} shell < adb_run_cmd.txt >> "${run_arm64_log_file}" |
|
|
if [ $? = 0 ]; then |
|
|
if [ $? = 0 ]; then |
|
|
run_result='arm64: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
run_result='arm64: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
|