From ba391b8a9aff0d6f4fcabe8f2caea0db9a76fba5 Mon Sep 17 00:00:00 2001 From: menff Date: Tue, 11 Jul 2023 20:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug/tools/profiling_analyse/npu_parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debug/tools/profiling_analyse/npu_parser.py b/debug/tools/profiling_analyse/npu_parser.py index bd8d8350f27..d5ba0fc2272 100644 --- a/debug/tools/profiling_analyse/npu_parser.py +++ b/debug/tools/profiling_analyse/npu_parser.py @@ -46,6 +46,9 @@ class NpuProfilingParser: elif len(ai_core_dict) == 2: # 2个ai_core,存在并行流(当前最多2条算子计算流) compute_stream = list(event_wait_sqe.keys() & ai_core_dict.keys()) parallel_stream = list(ai_core_dict.keys() - set(compute_stream)) + else: + print('Npu trace json file lack of Stream info') + return cs_event_wait_sqe_list = event_wait_sqe[compute_stream[0]] if parallel_stream: cs_ai_core_list = ai_core_dict[parallel_stream[0]] @@ -53,7 +56,7 @@ class NpuProfilingParser: sorted(cs_ai_core_list, key=lambda x: (x[0])) self.parallel_time = self.interval_intersection(cs_event_wait_sqe_list, cs_ai_core_list) self.profiling_info.compute_time = compute_time / 10 ** 6 - self.profiling_info.e2e_time = (max_ts - min_ts) / 1000 ** 6 if ts_flag else 0 + self.profiling_info.e2e_time = (max_ts - min_ts) / 10 ** 6 if ts_flag else 0 self.profiling_info.communication_not_overlapped = (event_wait_sqe_res[compute_stream[0]] - self.parallel_time) / 10 ** 6 time_required = (self.profiling_info.cube_time + self.profiling_info.vector_time) + \ -- Gitee