提交 cb7d1396 编写于 作者: 吴承辉

Merge branch 'fix_report_ci_for_host_abi' into 'master'

fix report ci for host abi

See merge request !432
...@@ -121,21 +121,24 @@ def model_benchmark_stdout_processor(stdout, ...@@ -121,21 +121,24 @@ def model_benchmark_stdout_processor(stdout,
metrics[4] = str(float(parts[5])) metrics[4] = str(float(parts[5]))
break break
props = sh_commands.adb_getprop_by_serialno(serialno) device_name = ""
device_type = props.get("ro.product.model", "") target_soc = ""
target_soc = props.get("ro.board.platform", "") if abi != "host":
props = sh_commands.adb_getprop_by_serialno(serialno)
device_name = props.get("ro.product.model", "")
target_soc = props.get("ro.board.platform", "")
report_filename = FLAGS.output_dir + "/report.csv" report_filename = FLAGS.output_dir + "/report.csv"
if not os.path.exists(report_filename): if not os.path.exists(report_filename):
with open(report_filename, 'w') as f: with open(report_filename, 'w') as f:
f.write("model_name,device_type,soc,abi,runtime,create_net," f.write("model_name,device_name,soc,abi,runtime,create_net,"
"engine_ctor,init,warmup,run_avg\n") "engine_ctor,init,warmup,run_avg\n")
data_str = "{model_name},{device_type},{soc},{abi},{runtime}," \ data_str = "{model_name},{device_name},{soc},{abi},{runtime}," \
"{create_net},{engine_ctor},{init},{warmup},{run_avg}\n" \ "{create_net},{engine_ctor},{init},{warmup},{run_avg}\n" \
.format( .format(
model_name=model_name, model_name=model_name,
device_type=device_type, device_name=device_name,
soc=target_soc, soc=target_soc,
abi=abi, abi=abi,
runtime=runtime, runtime=runtime,
......
...@@ -530,8 +530,6 @@ def tuning_run(abi, ...@@ -530,8 +530,6 @@ def tuning_run(abi,
output_file_name="model_out"): output_file_name="model_out"):
print("* Run '%s' with round=%s, restart_round=%s, tuning=%s" % print("* Run '%s' with round=%s, restart_round=%s, tuning=%s" %
(model_tag, running_round, restart_round, str(tuning))) (model_tag, running_round, restart_round, str(tuning)))
stdout_buff = []
process_output = make_output_processor(stdout_buff)
if abi == "host": if abi == "host":
p = subprocess.Popen([ p = subprocess.Popen([
"env", "env",
...@@ -547,8 +545,14 @@ def tuning_run(abi, ...@@ -547,8 +545,14 @@ def tuning_run(abi,
"--device=%s" % device_type, "--device=%s" % device_type,
"--round=%s" % running_round, "--round=%s" % running_round,
"--restart_round=%s" % restart_round, "--restart_round=%s" % restart_round,
"%s" % option_args]) "%s" % option_args],
p.wait() stderr=subprocess.PIPE,
stdout=subprocess.PIPE)
out, err = p.communicate()
stdout = err + out
print stdout
print("Running finished!\n")
return stdout
else: else:
sh.adb("-s", serialno, "shell", "mkdir", "-p", phone_data_dir) sh.adb("-s", serialno, "shell", "mkdir", "-p", phone_data_dir)
compiled_opencl_dir = "/data/local/tmp/mace_run/cl_program/" compiled_opencl_dir = "/data/local/tmp/mace_run/cl_program/"
...@@ -567,6 +571,8 @@ def tuning_run(abi, ...@@ -567,6 +571,8 @@ def tuning_run(abi,
adb_push("mace/core/runtime/hexagon/libhexagon_controller.so", adb_push("mace/core/runtime/hexagon/libhexagon_controller.so",
phone_data_dir, serialno) phone_data_dir, serialno)
stdout_buff = []
process_output = make_output_processor(stdout_buff)
p = sh.adb( p = sh.adb(
"-s", "-s",
serialno, serialno,
...@@ -596,9 +602,8 @@ def tuning_run(abi, ...@@ -596,9 +602,8 @@ def tuning_run(abi,
_bg=True, _bg=True,
_err_to_out=True) _err_to_out=True)
p.wait() p.wait()
print("Running finished!\n")
print("Running finished!\n") return "".join(stdout_buff)
return "".join(stdout_buff)
def validate_model(abi, def validate_model(abi,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册