diff --git a/debug/accuracy_tools/atat/pytorch/compare/acc_compare.py b/debug/accuracy_tools/atat/pytorch/compare/acc_compare.py index b8ed192305c4626a08eef4bff7bd5a76d0b0e698..f01b74f98aab1706cd2f3fd8fa468ae15f61f943 100644 --- a/debug/accuracy_tools/atat/pytorch/compare/acc_compare.py +++ b/debug/accuracy_tools/atat/pytorch/compare/acc_compare.py @@ -841,10 +841,9 @@ def compare_process(file_handles, stack_mode, fuzzy_match, summary_compare=False ops_npu_iter = iter(npu_json_data['data']) ops_bench_iter = iter(bench_json_data['data']) read_err_npu = True - read_err_bench = True while True: - if not read_err_npu or not read_err_bench: + if not read_err_npu: break try: op_name_npu = next(ops_npu_iter) @@ -860,10 +859,8 @@ def compare_process(file_handles, stack_mode, fuzzy_match, summary_compare=False npu_ops_queue.append(merge_tensor(npu_op_parsed_list, summary_compare, md5_compare)) except StopIteration: read_err_npu = False - continue try: op_name_bench = next(ops_bench_iter) - read_err_bench = True bench_op_data = bench_json_data['data'][op_name_bench] bench_op_parsed_list = read_op(bench_op_data, op_name_bench) @@ -875,11 +872,12 @@ def compare_process(file_handles, stack_mode, fuzzy_match, summary_compare=False bench_ops_queue.append(merge_tensor(bench_op_parsed_list, summary_compare, md5_compare)) except StopIteration: - read_err_bench = False - continue + pass - if len(npu_ops_queue) == 0 or len(bench_ops_queue) == 0: + if not npu_ops_queue: break + if not bench_ops_queue: + continue n_match_point, b_match_point = match_op(npu_ops_queue, bench_ops_queue, fuzzy_match) if n_match_point == -1 and b_match_point == -1: