@ -51,7 +51,7 @@ function Run_Converter() {
# Convert onnx models:
while read line; do
model_name = ${ line }
model_name = ${ line % : * }
if [ [ $model_name = = \# * ] ] ; then
continue
fi
@ -202,15 +202,17 @@ function Run_x86() {
# Run onnx converted models:
while read line; do
model_name = ${ line }
model_name = ${ line % : * }
length = ${# model_name }
input_shapes = ${ line : length +1 }
if [ [ $model_name = = \# * ] ] ; then
continue
fi
echo ${ model_name } >> " ${ 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
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 >> " ${ 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 -- inputShapes='${ input_shapes } ' -- 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 --inputShapes= ${ input_shapes } -- benchmarkDataFile= /home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${ model_name } .ms.out >> " ${ run_x86_log_file } "
if [ $? = 0 ] ; then
run_result = 'x86: ' ${ model_name } ' pass' ; echo ${ run_result } >> ${ run_benchmark_result_file }
else
@ -245,7 +247,7 @@ function Run_x86() {
echo ${ model_name } >> " ${ 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
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 >> " ${ run_x86_log_file } "
if [ $? = 0 ] ; then
run_result = 'x86: ' ${ model_name } ' pass' ; echo ${ run_result } >> ${ run_benchmark_result_file }
@ -400,14 +402,16 @@ function Run_arm64() {
# Run onnx converted models:
while read line; do
model_name = ${ line }
model_name = ${ line % : * }
length = ${# model_name }
input_shapes = ${ line : length +1 }
if [ [ $model_name = = \# * ] ] ; then
continue
fi
echo ${ model_name } >> " ${ run_arm64_log_file } "
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' >> " ${ 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' >> 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 -- inputShapes='${ input_shapes } ' -- benchmarkDataFile=/data/local/tmp/input_output/output/'${ model_name } '.ms.out' >> " ${ 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 -- inputShapes='${ input_shapes } ' -- benchmarkDataFile=/data/local/tmp/input_output/output/'${ model_name } '.ms.out' >> adb_run_cmd.txt
adb -s ${ device_id } shell < adb_run_cmd.txt >> " ${ run_arm64_log_file } "
if [ $? = 0 ] ; then
run_result = 'arm64: ' ${ model_name } ' pass' ; echo ${ run_result } >> ${ run_benchmark_result_file }
@ -417,8 +421,8 @@ function Run_arm64() {
# run benchmark test without clib data
echo ${ model_name } >> " ${ run_arm64_log_file } "
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 -- warmUpLoopCount=1 --loopCount=2' >> "{run_arm64_log_file}"
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile=' ${ model_name } '.ms -- warmUpLoopCount=1 --loopCount=2' >> adb_run_cmd.txt
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile=' ${ model_name } '.ms -- inputShapes='${ input_shapes } ' -- warmUpLoopCount=1 --loopCount=2' >> "{run_arm64_log_file}"
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test;./benchmark --modelFile=' ${ model_name } '.ms -- inputShapes='${ input_shapes } ' -- warmUpLoopCount=1 --loopCount=2' >> adb_run_cmd.txt
adb -s ${ device_id } shell < adb_run_cmd.txt >> " ${ run_arm64_log_file } "
if [ $? = 0 ] ; then
run_result = 'arm64: ' ${ model_name } ' pass' ; echo ${ run_result } >> ${ run_benchmark_result_file }