From 898486dd4601f63f20d1d5b79b1488b569cf877b Mon Sep 17 00:00:00 2001 From: wuhuanzhou Date: Tue, 29 Dec 2020 16:51:56 +0800 Subject: [PATCH] Add direction info log and filter disabled ops in PR-CI-OP-benchmark (#29946) * Add direction info log and filter disabled ops in PR-CI-OP-benchmark, test=op_benchmark * filter disabled ops, notest, test=op_benchmark * remove test codes, test=document_fix --- tools/check_op_benchmark_result.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/check_op_benchmark_result.py b/tools/check_op_benchmark_result.py index 43ba2fc097..7d6e1205bb 100644 --- a/tools/check_op_benchmark_result.py +++ b/tools/check_op_benchmark_result.py @@ -24,6 +24,15 @@ def check_path_exists(path): assert os.path.exists(path), "%s does not exist." % path +def parse_case_name(log_file_name): + """Parse case name. + """ + case_id, case_info = log_file_name.split("-") + direction = case_info.split(".")[0].split("_")[-1] + + return "%s(%s)" % (case_id, direction) + + def parse_log_file(log_file): """Load one case result from log file. """ @@ -34,6 +43,8 @@ def parse_log_file(log_file): for line in f.read().strip().split('\n')[::-1]: try: result = json.loads(line) + if result.get("disabled", False) == True: + return None return result except ValueError: pass # do nothing @@ -157,7 +168,7 @@ if __name__ == "__main__": pr_result = parse_log_file(os.path.join(args.pr_logs_dir, log_file)) if develop_result is None or pr_result is None: continue - case_name = log_file.split("-")[0] + case_name = parse_case_name(log_file) compare_benchmark_result(case_name, develop_result, pr_result, check_results) -- GitLab