From c1582aaa77b17ddd37e9e1e1d2f6cb73c73cbb2b Mon Sep 17 00:00:00 2001 From: liuqi Date: Tue, 9 Apr 2019 10:19:42 +0800 Subject: [PATCH] Fix report bug for CI. --- tools/converter.py | 45 --------------------------------------------- tools/device.py | 8 ++++---- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/tools/converter.py b/tools/converter.py index 5d8c0c5f..7bf387bd 100644 --- a/tools/converter.py +++ b/tools/converter.py @@ -832,51 +832,6 @@ def convert_func(flags): ################################ # run ################################ -def report_run_statistics(stdout, - abi, - serialno, - model_name, - device_type, - output_dir, - tuned): - metrics = [0] * 3 - for line in stdout.split('\n'): - line = line.strip() - parts = line.split() - if len(parts) == 4 and parts[0].startswith("time"): - metrics[0] = str(float(parts[1])) - metrics[1] = str(float(parts[2])) - metrics[2] = str(float(parts[3])) - break - - 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 = output_dir + "/report.csv" - if not os.path.exists(report_filename): - with open(report_filename, 'w') as f: - f.write("model_name,device_name,soc,abi,runtime," - "init(ms),warmup(ms),run_avg(ms),tuned\n") - - data_str = "{model_name},{device_name},{soc},{abi},{device_type}," \ - "{init},{warmup},{run_avg},{tuned}\n" \ - .format(model_name=model_name, - device_name=device_name, - soc=target_soc, - abi=abi, - device_type=device_type, - init=metrics[0], - warmup=metrics[1], - run_avg=metrics[2], - tuned=tuned) - with open(report_filename, 'a') as f: - f.write(data_str) - - def build_mace_run(configs, target_abi, toolchain, enable_openmp, address_sanitizer, mace_lib_type, debug_mode): library_name = configs[YAMLKeyword.library_name] diff --git a/tools/device.py b/tools/device.py index c1a9456f..39d5783e 100644 --- a/tools/device.py +++ b/tools/device.py @@ -736,10 +736,10 @@ class DeviceWrapper: for line in self.stdout.split('\n'): line = line.strip() parts = line.split() - if len(parts) == 4 and parts[0].startswith('time'): - metrics[0] = str(float(parts[1])) - metrics[1] = str(float(parts[2])) - metrics[2] = str(float(parts[3])) + if len(parts) == 5 and parts[0].startswith('time'): + metrics[0] = str(float(parts[2])) + metrics[1] = str(float(parts[3])) + metrics[2] = str(float(parts[4])) break report_filename = output_dir + '/report.csv' if not os.path.exists(report_filename): -- GitLab