diff --git a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/plugin.py b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/plugin.py index fcfaf7860da0809bbeb730ace79aaf766cd6a386..d0c6dd86375894518b8c6c3a31bc2565e94ee302 100644 --- a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/plugin.py +++ b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/plugin.py @@ -151,6 +151,9 @@ class TorchProfilerPlugin(base_plugin.TBPlugin): view = request.args.get('view') self._validate(run=name, view=view) run = self._get_run(name) + # Required datas are in file 'trace_view.json' in Ascend. + if run.device_target == 'Ascend' and view == 'Overview': + view = 'Trace' return self.respond_as_json(run.get_workers(view)) @wrappers.Request.application diff --git a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/loader.py b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/loader.py index 32a7ce3230537682154bb004dc6ab1ae937ab97b..f1574b226e61c3a71cdb8dc28dc5e7528bf485b0 100644 --- a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/loader.py +++ b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/loader.py @@ -30,7 +30,8 @@ class RunLoader(object): spans_by_workers = defaultdict(list) if self.device_target == 'Ascend': for path in io.listdir(self.run_dir): - if io.isdir(io.join(self.run_dir, path)) and utils.is_worker_span_dir(path): + if io.isdir(io.join(self.run_dir, path)) and utils.is_worker_span_dir(path) and io.isdir( + io.join(self.run_dir, path, 'ASCEND_PROFILER_OUTPUT')): data_path = io.join(self.run_dir, path, 'ASCEND_PROFILER_OUTPUT') for file in io.listdir(data_path): if utils.is_npu_trace_path(file) or str(file) in ( diff --git a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/run_generator.py b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/run_generator.py index 09e38c03e590d66cac90aea9a691ea04a382d55c..f48495d50dd34b59378bc9800c17107788d099af 100644 --- a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/run_generator.py +++ b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/profiler/run_generator.py @@ -35,7 +35,6 @@ class RunGenerator(object): profile_run.has_communication = self.profile_data.has_communication profile_run.has_memcpy_or_memset = self.profile_data.has_memcpy_or_memset profile_run.profiler_start_ts = self.profile_data.profiler_start_ts - profile_run.overview = self._generate_overview() if self.device_target != 'Ascend': profile_run.views.append(consts.OVERALL_VIEW) diff --git a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/run.py b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/run.py index 7d4e23503f0f20bc50fe09a3b2cc5375150985f4..59dd82ecb73b29c0f3d5f94ca5c17294248679fc 100644 --- a/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/run.py +++ b/plugins/tensorboard-plugins/tb_plugin/torch_tb_profiler/run.py @@ -48,9 +48,9 @@ class Run(object): if v.display_name == view: worker_set.add(profile.worker) if not temp_span_view.get(profile.worker): - temp_span_view[profile.worker] = [profile.span] + temp_span_view[profile.worker] = [str(profile.span)] else: - temp_span_view[profile.worker].append(profile.span) + temp_span_view[profile.worker].append(str(profile.span)) break self.span_view = temp_span_view return sorted(list(worker_set))