From c454e85e6a0cd1a89410bcef7dc7b532d184e77b Mon Sep 17 00:00:00 2001 From: jiangmianjiao Date: Fri, 5 May 2023 16:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E3=80=91=20=E5=B0=86Duration(us)=E3=80=81Start=20Time=E3=80=81?= =?UTF-8?q?Wait=20Time(us)=E3=80=81Block=20Dim=E7=AD=89=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E5=88=97=E6=8C=89=E7=85=A7=E6=96=87=E6=9C=AC=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=8C=89=E7=85=A7=E6=95=B0=E5=AD=97=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E6=8E=92=E5=BA=8F=20=E3=80=90=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=BA=E3=80=91=20jiangmianjiao=2030036454?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profiler/run_generator.py | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/run_generator.py b/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/run_generator.py index f8d54d678ec..23131a943c8 100644 --- a/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/run_generator.py +++ b/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/run_generator.py @@ -465,13 +465,23 @@ class RunGenerator(object): for idx, column in enumerate(datas[0]): if column == 'Name': self.name_idx = idx - elif column == 'Duration(us)': + if column == 'Duration(us)': self.duration_idx = idx - elif column == 'Accelerator Core': + if column == 'Accelerator Core': self.core_type_idx = idx + if column == 'Start Time': + self.start_time_idx = idx + if column == 'Wait Time(us)': + self.wait_time_idx = idx + if column == 'Block Dim': + self.block_dim = idx if column in display_columns: display_idxs.append(idx) + if column == 'Start Time' or column == 'Duration(us)' \ + or column == 'Wait Time(us)' or column == 'Block Dim': + table['columns'].append({'type': 'number', 'name': column}) + continue table['columns'].append({'type': 'string', 'name': column}) table['rows'] = [self._handle_kernel_table_rows(display_idxs, ls) for idx, ls in enumerate(datas) if idx != 0] @@ -519,7 +529,11 @@ class RunGenerator(object): def _handle_kernel_table_rows(self, ids, row): display_row = [] for idx in ids: - display_row.append(row[idx]) + if idx == self.start_time_idx or idx == self.duration_idx \ + or idx == self.wait_time_idx or idx == self.block_dim: + display_row.append(float(row[idx])) + else: + display_row.append(row[idx]) call_name = row[self.name_idx] call_duration = float(row[self.duration_idx]) call_type = row[self.core_type_idx] -- Gitee