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