提交 da3784cd 编写于 作者: Y yejianwu

fix run

上级 72544211
# example.yaml # example.yaml
# Each yaml file describes a exported library (could be named [target_abi]/libmace-${filename}.a), # Each yaml file describes a exported library (could be named [target_abi]/libmace-${filename}.a),
# which can contains more than one models # which can contains more than one models
# target_soc can get by `adb shell getprop | grep ro.board.platform | cut -d [ -f3 | cut -d ] -f1`
target_abis: [armeabi-v7a, arm64-v8a] target_abis: [armeabi-v7a, arm64-v8a]
target_socs: [MSM8953] target_socs: [MSM8953]
embed_model_data: 1 embed_model_data: 1
......
...@@ -136,10 +136,10 @@ def build_run_throughput_test(run_seconds, merged_lib_file, model_input_dir): ...@@ -136,10 +136,10 @@ def build_run_throughput_test(run_seconds, merged_lib_file, model_input_dir):
run_command(command) run_command(command)
def validate_model(model_output_dir): def validate_model(target_soc, model_output_dir):
generate_data_or_not = False generate_data_or_not = False
command = "bash tools/validate_tools.sh {} {}".format( command = "bash tools/validate_tools.sh {} {} {}".format(
model_output_dir, int(generate_data_or_not)) target_soc, model_output_dir, int(generate_data_or_not))
run_command(command) run_command(command)
...@@ -262,13 +262,13 @@ def main(unused_args): ...@@ -262,13 +262,13 @@ def main(unused_args):
build_mace_run_prod(target_soc, model_output_dir, FLAGS.tuning, global_runtime) build_mace_run_prod(target_soc, model_output_dir, FLAGS.tuning, global_runtime)
if FLAGS.mode == "run" or FLAGS.mode == "validate" or FLAGS.mode == "all": if FLAGS.mode == "run" or FLAGS.mode == "validate" or FLAGS.mode == "all":
run_model(target_soc, model_output_dir, FLAGS.round, FLAGS.restart_round) run_model(target_soc, model_output_dir, FLAGS.round, FLAGS.restart_round, option_args)
if FLAGS.mode == "benchmark": if FLAGS.mode == "benchmark":
benchmark_model(model_output_dir) benchmark_model(model_output_dir, option_args)
if FLAGS.mode == "validate" or FLAGS.mode == "all": if FLAGS.mode == "validate" or FLAGS.mode == "all":
validate_model(model_output_dir) validate_model(target_soc, model_output_dir)
if FLAGS.mode == "build" or FLAGS.mode == "merge" or FLAGS.mode == "all": if FLAGS.mode == "build" or FLAGS.mode == "merge" or FLAGS.mode == "all":
merge_libs_and_tuning_results(target_soc, FLAGS.output_dir + "/" + os.environ["PROJECT_NAME"], merge_libs_and_tuning_results(target_soc, FLAGS.output_dir + "/" + os.environ["PROJECT_NAME"],
......
...@@ -79,13 +79,13 @@ else ...@@ -79,13 +79,13 @@ else
--device=${DEVICE_TYPE} \ --device=${DEVICE_TYPE} \
--round=$ROUND \ --round=$ROUND \
--restart_round=$RESTART_ROUND \ --restart_round=$RESTART_ROUND \
$OPTION_ARGS; echo \\$?" $OPTION_ARGS; echo \$?"
echo $ADB_CMD_STR echo $ADB_CMD_STR
mace_adb_output=`adb -s $DEVICE_ID </dev/null shell "$ADB_CMD_STR"` || exit 1 mace_adb_output=`adb -s $DEVICE_ID </dev/null shell "$ADB_CMD_STR"` || exit 1
echo "$mace_adb_output" | head -n -1 echo "$mace_adb_output" | head -n -1
mace_adb_return_code=`echo "$mace_adb_output" | tail -1` mace_adb_return_code=`echo "$mace_adb_output" | tail -1`
if [ ${mace_adb_return_code%?} -ne 0 ]; then if ! [[ ${mace_adb_return_code%?} = 0 || ${mace_adb_return_code} = 0 ]]; then
exit 1 exit 1
fi fi
fi fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册