diff --git a/profiler/compare_tools/comparator/op_comparator.py b/profiler/compare_tools/comparator/op_comparator.py index f299463fe55660fb3334f6de792d887c44837e29..4b552ac25816c2d8c3aa8037bc600a4f7955da28 100644 --- a/profiler/compare_tools/comparator/op_comparator.py +++ b/profiler/compare_tools/comparator/op_comparator.py @@ -127,3 +127,5 @@ class OpComparator: match_list.reverse() for data in match_list: op_deque.append(data) + + return drill_down_result diff --git a/profiler/compare_tools/performance_compare.py b/profiler/compare_tools/performance_compare.py index 46f7160341d0f44df078490516f6aeda87f58672..3a7f3913097a18924f7275fa58a28e79ef63df33 100644 --- a/profiler/compare_tools/performance_compare.py +++ b/profiler/compare_tools/performance_compare.py @@ -19,9 +19,9 @@ def performance_compare(args): if ArgsManager().base_profiling_type == Constant.NPU: npu_path = ArgsManager().base_profiling.file_path elif ArgsManager().base_profiling_type == Constant.GPU: - npu_path = ArgsManager().base_profiling.file_path + gpu_path = ArgsManager().base_profiling.file_path if ArgsManager().comparison_profiling_type == Constant.NPU: - gpu_path = ArgsManager().comparison_profiling.file_path + npu_path = ArgsManager().comparison_profiling.file_path elif ArgsManager().comparison_profiling_type == Constant.GPU: gpu_path = ArgsManager().comparison_profiling.file_path prof_main(npu_path, gpu_path) @@ -49,9 +49,13 @@ def main(): args = parser.parse_args() ArgsManager().init(args) - performance_compare(args) + try: + performance_compare(args) + except Exception: + print("profiling analyze failed.") dir_path = args.output_path if args.output_path else "./" - file_name = "performance_comparison_result_{}.xlsx".format(time.strftime("%Y%m%d%H%M%S", time.localtime(time.time()))) + file_name = "performance_comparison_result_{}.xlsx".format( + time.strftime("%Y%m%d%H%M%S", time.localtime(time.time()))) result_file_path = os.path.join(dir_path, file_name) ComparisonGenerator(args).create_excel(result_file_path) diff --git a/profiler/performance_analyse/npu_parser.py b/profiler/performance_analyse/npu_parser.py index 333d8a2682b05846e294e1112af92a91acfb6a5c..375dd85680ac07c6c537490395ec62ac4488aae0 100644 --- a/profiler/performance_analyse/npu_parser.py +++ b/profiler/performance_analyse/npu_parser.py @@ -48,7 +48,7 @@ class NpuProfilingParser: ai_core_res = defaultdict(float) for dic in data: self.get_ts_by_task_type(dic, event_wait_sqe, ai_core_dict, event_wait_sqe_res, ai_core_res) - if ('name' in dic) and (dic.get('name') == 'compute_time'): + if ('name' in dic) and (dic.get('name') == 'Compute'): ts_flag = True ts = dic.get('ts') dur = dic.get('dur') diff --git a/profiler/performance_analyse/profiling_parse.py b/profiler/performance_analyse/profiling_parse.py index 6c69af674f5d2035d1dc667c0b0a5c3c83a4dc97..c45c73e9e27b6b4b4c9aae222499404b3ad3eac4 100644 --- a/profiler/performance_analyse/profiling_parse.py +++ b/profiler/performance_analyse/profiling_parse.py @@ -44,7 +44,7 @@ def show_table(gpu_profiling_info, npu_profiling_info): f'{gpu_profiling_info.compute_time:.3f}s', f'{gpu_profiling_info.communication_not_overlapped: .3f}s', f'{gpu_profiling_info.scheduling_time:.3f}', f'{gpu_profiling_info.scheduling_ratio:.2%}', f'{gpu_profiling_info.memory_used:.2f}G', f'{gpu_profiling_info.e2e_time:.3f}s']) - table.add_row(['当前现状', f'{npu_profiling_info.cube_time:.3f}s', f'{npu_profiling_info.vector_time:.3f}s', + table.add_row(['NPU现状', f'{npu_profiling_info.cube_time:.3f}s', f'{npu_profiling_info.vector_time:.3f}s', f'{npu_profiling_info.compute_time:.3f}s', f'{npu_profiling_info.communication_not_overlapped: .3f}s', f'{npu_profiling_info.scheduling_time:.3f}', f'{npu_profiling_info.scheduling_ratio:.2%}', f'{npu_profiling_info.memory_used:.2f}G', f'{npu_profiling_info.e2e_time:.3f}s'])