diff --git a/tools/example.yaml b/tools/example.yaml index b1fc4154b00bd428fe93dca380fabe983246fcdb..882e8514841bed96cc8a509dd86ee8b573e0acf1 100644 --- a/tools/example.yaml +++ b/tools/example.yaml @@ -1,6 +1,7 @@ # example.yaml # Each yaml file describes a exported library (could be named [target_abi]/libmace-${filename}.a), # 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_socs: [MSM8953] embed_model_data: 1 diff --git a/tools/mace_tools.py b/tools/mace_tools.py index 156f8b501735dbe590ed03fede580381b64c0f21..eede57518516712853509b1a22bbeaa7a59643de 100644 --- a/tools/mace_tools.py +++ b/tools/mace_tools.py @@ -136,10 +136,10 @@ def build_run_throughput_test(run_seconds, merged_lib_file, model_input_dir): run_command(command) -def validate_model(model_output_dir): +def validate_model(target_soc, model_output_dir): generate_data_or_not = False - command = "bash tools/validate_tools.sh {} {}".format( - model_output_dir, int(generate_data_or_not)) + command = "bash tools/validate_tools.sh {} {} {}".format( + target_soc, model_output_dir, int(generate_data_or_not)) run_command(command) @@ -262,13 +262,13 @@ def main(unused_args): 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": - 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": - benchmark_model(model_output_dir) + benchmark_model(model_output_dir, option_args) 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": merge_libs_and_tuning_results(target_soc, FLAGS.output_dir + "/" + os.environ["PROJECT_NAME"], diff --git a/tools/tuning_run.sh b/tools/tuning_run.sh index 63897941be33ba67688017320ff30693202fe1ac..1d9f57e5d74f3261b3b13b76a825d097ace1f8d9 100644 --- a/tools/tuning_run.sh +++ b/tools/tuning_run.sh @@ -79,13 +79,13 @@ else --device=${DEVICE_TYPE} \ --round=$ROUND \ --restart_round=$RESTART_ROUND \ - $OPTION_ARGS; echo \\$?" + $OPTION_ARGS; echo \$?" echo $ADB_CMD_STR mace_adb_output=`adb -s $DEVICE_ID