From ab07dbdff2ee27cbef68a23eab67f06a4125ac46 Mon Sep 17 00:00:00 2001 From: caifubi Date: Wed, 6 Jan 2021 19:31:06 +0800 Subject: [PATCH] Change profiling reporter tag --- .../runtime/device/ascend/profiling/profiling_utils.cc | 6 +++--- mindspore/profiler/parser/framework_parser.py | 8 ++++---- ...lice_0 => Framework.host.vm_graph_desc_info.0.slice_0} | 0 ...e => Framework.host.vm_graph_desc_info.0.slice_0.done} | 0 ...slice_0 => Framework.host.vm_task_desc_info.0.slice_0} | 0 ...lice_0 => Framework.host.vm_graph_desc_info.0.slice_0} | 0 ....point.0.slice_0 => Framework.host.vm_point.0.slice_0} | 0 ...slice_0 => Framework.host.vm_task_desc_info.0.slice_0} | 0 ...0 => Framework.host.vm_graph_desc_info.0.JOB2.slice_0} | 0 ..._0 => Framework.host.vm_task_desc_info.0.JOB2.slice_0} | 0 10 files changed, 7 insertions(+), 7 deletions(-) rename tests/ut/data/profiler_data/JOB1/{Framework.host.vm.graph_desc_info.0.slice_0 => Framework.host.vm_graph_desc_info.0.slice_0} (100%) rename tests/ut/data/profiler_data/JOB1/{Framework.host.vm.graph_desc_info.0.slice_0.done => Framework.host.vm_graph_desc_info.0.slice_0.done} (100%) rename tests/ut/data/profiler_data/JOB1/{Framework.host.vm.task_desc_info.0.slice_0 => Framework.host.vm_task_desc_info.0.slice_0} (100%) rename tests/ut/data/profiler_data/JOB4/data/{Framework.host.vm.graph_desc_info.0.slice_0 => Framework.host.vm_graph_desc_info.0.slice_0} (100%) rename tests/ut/data/profiler_data/JOB4/data/{Framework.host.vm.point.0.slice_0 => Framework.host.vm_point.0.slice_0} (100%) rename tests/ut/data/profiler_data/JOB4/data/{Framework.host.vm.task_desc_info.0.slice_0 => Framework.host.vm_task_desc_info.0.slice_0} (100%) rename tests/ut/data/profiler_data/container/0/data/{Framework.host.vm.graph_desc_info.0.JOB2.slice_0 => Framework.host.vm_graph_desc_info.0.JOB2.slice_0} (100%) rename tests/ut/data/profiler_data/container/0/data/{Framework.host.vm.task_desc_info.0.JOB2.slice_0 => Framework.host.vm_task_desc_info.0.JOB2.slice_0} (100%) diff --git a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc index 23602716a3..fd5185a993 100644 --- a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc +++ b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc @@ -374,12 +374,12 @@ void ProfilingUtils::ReportProfilingData(const std::vector &task_ids, auto context = MsContext::GetInstance(); MS_EXCEPTION_IF_NULL(context); - TaskDescReporter task_reporter(context->get_param(MS_CTX_DEVICE_ID), "vm.task_desc_info", ret->second); + TaskDescReporter task_reporter(context->get_param(MS_CTX_DEVICE_ID), "vm_task_desc_info", ret->second); task_reporter.set_task_ids(task_ids); task_reporter.set_stream_ids(stream_ids); task_reporter.ReportData(); - GraphDescReporter graph_reporter(context->get_param(MS_CTX_DEVICE_ID), "vm.graph_desc_info", ret->second); + GraphDescReporter graph_reporter(context->get_param(MS_CTX_DEVICE_ID), "vm_graph_desc_info", ret->second); graph_profiling_cnode_.erase(ret); graph_reporter.ReportData(); @@ -389,7 +389,7 @@ void ProfilingUtils::ReportProfilingData(const std::vector &task_ids, MS_LOG(ERROR) << "Graph id not found in graph_point"; return; } - PointReporter point_reporter(context->get_param(MS_CTX_DEVICE_ID), "vm.point"); + PointReporter point_reporter(context->get_param(MS_CTX_DEVICE_ID), "vm_point"); for (const auto &point : point_iter->second) { point_reporter.AddReportData(point); } diff --git a/mindspore/profiler/parser/framework_parser.py b/mindspore/profiler/parser/framework_parser.py index 33b9ee6e89..a99d82653b 100644 --- a/mindspore/profiler/parser/framework_parser.py +++ b/mindspore/profiler/parser/framework_parser.py @@ -340,11 +340,11 @@ class FrameworkParser: data_type = attrs.get('data_type') data_type = data_type.replace("host.", "") - if data_type.startswith('vm.'): + if data_type.startswith('vm_'): if self._backend_type and self._backend_type != 'vm': raise ProfilerRawFileException('Backend type is inconsistent.') self._backend_type = 'vm' - data_type = data_type.split('.')[1] + _, data_type = data_type.split('_', 1) else: if self._backend_type and self._backend_type != 'ge': raise ProfilerRawFileException('Backend type is inconsistent.') @@ -398,11 +398,11 @@ class FrameworkParser: data_type = attrs.get('data_type') data_type = data_type.replace("host.", "") - if data_type.startswith('vm.'): + if data_type.startswith('vm_'): if self._backend_type and self._backend_type != 'vm': raise ProfilerRawFileException('Backend type is inconsistent.') self._backend_type = 'vm' - data_type = data_type.split('.')[1] + _, data_type = data_type.split('_', 1) else: if self._backend_type and self._backend_type != 'ge': raise ProfilerRawFileException('Backend type is inconsistent.') diff --git a/tests/ut/data/profiler_data/JOB1/Framework.host.vm.graph_desc_info.0.slice_0 b/tests/ut/data/profiler_data/JOB1/Framework.host.vm_graph_desc_info.0.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/JOB1/Framework.host.vm.graph_desc_info.0.slice_0 rename to tests/ut/data/profiler_data/JOB1/Framework.host.vm_graph_desc_info.0.slice_0 diff --git a/tests/ut/data/profiler_data/JOB1/Framework.host.vm.graph_desc_info.0.slice_0.done b/tests/ut/data/profiler_data/JOB1/Framework.host.vm_graph_desc_info.0.slice_0.done similarity index 100% rename from tests/ut/data/profiler_data/JOB1/Framework.host.vm.graph_desc_info.0.slice_0.done rename to tests/ut/data/profiler_data/JOB1/Framework.host.vm_graph_desc_info.0.slice_0.done diff --git a/tests/ut/data/profiler_data/JOB1/Framework.host.vm.task_desc_info.0.slice_0 b/tests/ut/data/profiler_data/JOB1/Framework.host.vm_task_desc_info.0.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/JOB1/Framework.host.vm.task_desc_info.0.slice_0 rename to tests/ut/data/profiler_data/JOB1/Framework.host.vm_task_desc_info.0.slice_0 diff --git a/tests/ut/data/profiler_data/JOB4/data/Framework.host.vm.graph_desc_info.0.slice_0 b/tests/ut/data/profiler_data/JOB4/data/Framework.host.vm_graph_desc_info.0.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/JOB4/data/Framework.host.vm.graph_desc_info.0.slice_0 rename to tests/ut/data/profiler_data/JOB4/data/Framework.host.vm_graph_desc_info.0.slice_0 diff --git a/tests/ut/data/profiler_data/JOB4/data/Framework.host.vm.point.0.slice_0 b/tests/ut/data/profiler_data/JOB4/data/Framework.host.vm_point.0.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/JOB4/data/Framework.host.vm.point.0.slice_0 rename to tests/ut/data/profiler_data/JOB4/data/Framework.host.vm_point.0.slice_0 diff --git a/tests/ut/data/profiler_data/JOB4/data/Framework.host.vm.task_desc_info.0.slice_0 b/tests/ut/data/profiler_data/JOB4/data/Framework.host.vm_task_desc_info.0.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/JOB4/data/Framework.host.vm.task_desc_info.0.slice_0 rename to tests/ut/data/profiler_data/JOB4/data/Framework.host.vm_task_desc_info.0.slice_0 diff --git a/tests/ut/data/profiler_data/container/0/data/Framework.host.vm.graph_desc_info.0.JOB2.slice_0 b/tests/ut/data/profiler_data/container/0/data/Framework.host.vm_graph_desc_info.0.JOB2.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/container/0/data/Framework.host.vm.graph_desc_info.0.JOB2.slice_0 rename to tests/ut/data/profiler_data/container/0/data/Framework.host.vm_graph_desc_info.0.JOB2.slice_0 diff --git a/tests/ut/data/profiler_data/container/0/data/Framework.host.vm.task_desc_info.0.JOB2.slice_0 b/tests/ut/data/profiler_data/container/0/data/Framework.host.vm_task_desc_info.0.JOB2.slice_0 similarity index 100% rename from tests/ut/data/profiler_data/container/0/data/Framework.host.vm.task_desc_info.0.JOB2.slice_0 rename to tests/ut/data/profiler_data/container/0/data/Framework.host.vm_task_desc_info.0.JOB2.slice_0