|
|
|
@@ -132,10 +132,11 @@ function Run_Converter() { |
|
|
|
|
|
|
|
# Copy fp16 ms models: |
|
|
|
while read line; do |
|
|
|
model_name=${line%.*} |
|
|
|
if [[ $model_name == \#* ]]; then |
|
|
|
continue |
|
|
|
fp16_line_info=${line} |
|
|
|
if [[ $fp16_line_info == \#* ]]; then |
|
|
|
continue |
|
|
|
fi |
|
|
|
model_name=`echo ${fp16_line_info}|awk -F ' ' '{print $1}'` |
|
|
|
echo 'cp '${ms_models_path}'/'${model_name}'.ms' ${ms_models_path}'/'${model_name}'.fp16.ms' |
|
|
|
cp ${ms_models_path}/${model_name}.ms ${ms_models_path}/${model_name}.fp16.ms |
|
|
|
if [ $? = 0 ]; then |
|
|
|
@@ -511,25 +512,32 @@ function Run_arm64() { |
|
|
|
|
|
|
|
# Run fp16 converted models: |
|
|
|
while read line; do |
|
|
|
model_name=${line} |
|
|
|
if [[ $model_name == \#* ]]; then |
|
|
|
fp16_line_info=${line} |
|
|
|
if [[ $fp16_line_info == \#* ]]; then |
|
|
|
continue |
|
|
|
fi |
|
|
|
echo ${model_name} >> "${run_arm64_log_file}" |
|
|
|
model_name=`echo ${fp16_line_info}|awk -F ' ' '{print $1}'` |
|
|
|
accuracy_limit=`echo ${fp16_line_info}|awk -F ' ' '{print $2}'` |
|
|
|
echo "---------------------------------------------------------" >> "${run_arm64_log_file}" |
|
|
|
echo "fp16 run: ${model_name}, accuracy limit:${accuracy_limit}" >> "${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 --enableFp16=true --accuracyThreshold=6' >> "${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 --enableFp16=true --accuracyThreshold=6' >> adb_run_cmd.txt |
|
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test' >> adb_run_cmd.txt |
|
|
|
echo './benchmark --modelFile='${model_name}'.fp16.ms --inDataFile=/data/local/tmp/input_output/input/'${model_name}'.ms.bin --benchmarkDataFile=/data/local/tmp/input_output/output/'${model_name}'.ms.out --enableFp16=true --accuracyThreshold='${accuracy_limit} >> adb_run_cmd.txt |
|
|
|
|
|
|
|
cat adb_run_cmd.txt >> "${run_arm64_log_file}" |
|
|
|
adb -s ${device_id} shell < adb_run_cmd.txt >> "${run_arm64_log_file}" |
|
|
|
if [ $? = 0 ]; then |
|
|
|
run_result='arm64_fp16: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
|
else |
|
|
|
run_result='arm64_fp16: '${model_name}' failed'; echo ${run_result} >> ${run_benchmark_result_file}; return 1 |
|
|
|
fi |
|
|
|
|
|
|
|
# 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 --enableFp16=true' >> "${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 --enableFp16=true' >> adb_run_cmd.txt |
|
|
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/benchmark_test' >> adb_run_cmd.txt |
|
|
|
echo './benchmark --modelFile='${model_name}'.fp16.ms --warmUpLoopCount=1 --loopCount=2 --enableFp16=true' >> adb_run_cmd.txt |
|
|
|
cat adb_run_cmd.txt >> "${run_arm64_log_file}" |
|
|
|
adb -s ${device_id} shell < adb_run_cmd.txt >> "${run_arm64_log_file}" |
|
|
|
if [ $? = 0 ]; then |
|
|
|
run_result='arm64_fp16: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
|
|