提交 0d8808e5 编写于 作者: C chenchao99

update the display name of aicore detail execution time

上级 d037edbd
...@@ -71,6 +71,7 @@ def get_profile_op_info(): ...@@ -71,6 +71,7 @@ def get_profile_op_info():
validate_condition(search_condition) validate_condition(search_condition)
device_id = search_condition.get("device_id", "0") device_id = search_condition.get("device_id", "0")
to_int(device_id, 'device_id')
profiler_dir_abs = os.path.join(settings.SUMMARY_BASE_DIR, train_id, profiler_dir) profiler_dir_abs = os.path.join(settings.SUMMARY_BASE_DIR, train_id, profiler_dir)
try: try:
profiler_dir_abs = validate_and_normalize_path(profiler_dir_abs, "profiler") profiler_dir_abs = validate_and_normalize_path(profiler_dir_abs, "profiler")
...@@ -193,6 +194,7 @@ def get_queue_info(): ...@@ -193,6 +194,7 @@ def get_queue_info():
profile_dir = get_profiler_abs_dir(request) profile_dir = get_profiler_abs_dir(request)
device_id = unquote_args(request, "device_id") device_id = unquote_args(request, "device_id")
to_int(device_id, 'device_id')
queue_type = unquote_args(request, "type") queue_type = unquote_args(request, "type")
queue_info = {} queue_info = {}
...@@ -219,6 +221,7 @@ def get_time_info(): ...@@ -219,6 +221,7 @@ def get_time_info():
""" """
profile_dir = get_profiler_abs_dir(request) profile_dir = get_profiler_abs_dir(request)
device_id = unquote_args(request, "device_id") device_id = unquote_args(request, "device_id")
to_int(device_id, 'device_id')
op_type = unquote_args(request, "type") op_type = unquote_args(request, "type")
time_info = { time_info = {
...@@ -250,6 +253,7 @@ def get_process_summary(): ...@@ -250,6 +253,7 @@ def get_process_summary():
""" """
profile_dir = get_profiler_abs_dir(request) profile_dir = get_profiler_abs_dir(request)
device_id = unquote_args(request, "device_id") device_id = unquote_args(request, "device_id")
to_int(device_id, 'device_id')
minddata_analyser = AnalyserFactory.instance().get_analyser( minddata_analyser = AnalyserFactory.instance().get_analyser(
'minddata', profile_dir, device_id) 'minddata', profile_dir, device_id)
...@@ -304,6 +308,7 @@ def get_profile_summary_proposal(): ...@@ -304,6 +308,7 @@ def get_profile_summary_proposal():
device_id = get_device_id(request) device_id = get_device_id(request)
if not profiler_dir or not train_id: if not profiler_dir or not train_id:
raise ParamValueError("No profiler_dir or train_id.") raise ParamValueError("No profiler_dir or train_id.")
to_int(device_id, 'device_id')
profiler_dir_abs = os.path.join(settings.SUMMARY_BASE_DIR, train_id, profiler_dir) profiler_dir_abs = os.path.join(settings.SUMMARY_BASE_DIR, train_id, profiler_dir)
try: try:
...@@ -360,6 +365,7 @@ def get_minddata_pipeline_op_queue_info(): ...@@ -360,6 +365,7 @@ def get_minddata_pipeline_op_queue_info():
validate_minddata_pipeline_condition(condition) validate_minddata_pipeline_condition(condition)
device_id = condition.get("device_id", "0") device_id = condition.get("device_id", "0")
to_int(device_id, 'device_id')
analyser = AnalyserFactory.instance().get_analyser( analyser = AnalyserFactory.instance().get_analyser(
'minddata_pipeline', profiler_dir_abs, device_id 'minddata_pipeline', profiler_dir_abs, device_id
) )
...@@ -397,6 +403,7 @@ def get_minddata_pipeline_queue_info(): ...@@ -397,6 +403,7 @@ def get_minddata_pipeline_queue_info():
raise ParamValueError("Invalid profiler dir.") raise ParamValueError("Invalid profiler dir.")
device_id = request.args.get('device_id', default='0') device_id = request.args.get('device_id', default='0')
to_int(device_id, 'device_id')
op_id = request.args.get('op_id', type=int) op_id = request.args.get('op_id', type=int)
if op_id is None: if op_id is None:
raise ParamValueError("Invalid operator id or operator id does not exist.") raise ParamValueError("Invalid operator id or operator id does not exist.")
......
...@@ -99,7 +99,7 @@ class AicoreDetailAnalyser(BaseAnalyser): ...@@ -99,7 +99,7 @@ class AicoreDetailAnalyser(BaseAnalyser):
Raises: Raises:
ProfilerPathErrorException: If the profiling dir is invalid. ProfilerPathErrorException: If the profiling dir is invalid.
""" """
_col_names = ['op_name', 'op_type', 'execution_time', 'subgraph', _col_names = ['op_name', 'op_type', 'avg_execution_time', 'subgraph',
'full_op_name', 'op_info'] 'full_op_name', 'op_info']
_file_name_aicore_detail_time = 'aicore_intermediate_{}_detail.csv' _file_name_aicore_detail_time = 'aicore_intermediate_{}_detail.csv'
_file_name_framework_info = 'framework_raw_{}.csv' _file_name_framework_info = 'framework_raw_{}.csv'
......
...@@ -24,7 +24,7 @@ from mindinsight.profiler.common.exceptions.exceptions import ProfilerParamTypeE ...@@ -24,7 +24,7 @@ from mindinsight.profiler.common.exceptions.exceptions import ProfilerParamTypeE
from mindinsight.profiler.common.log import logger as log from mindinsight.profiler.common.log import logger as log
AICORE_TYPE_COL = ["op_type", "execution_time", "execution_frequency", "precent"] AICORE_TYPE_COL = ["op_type", "execution_time", "execution_frequency", "precent"]
AICORE_DETAIL_COL = ["op_name", "op_type", "execution_time", "subgraph", "full_op_name"] AICORE_DETAIL_COL = ["op_name", "op_type", "avg_execution_time", "subgraph", "full_op_name"]
AICPU_COL = ["serial_number", "op_type", "total_time", "dispatch_time", "run_start", AICPU_COL = ["serial_number", "op_type", "total_time", "dispatch_time", "run_start",
"run_end"] "run_end"]
MINDDATA_PIPELINE_COL = [ MINDDATA_PIPELINE_COL = [
......
...@@ -32,7 +32,7 @@ from tests.ut.profiler import RAW_DATA_BASE ...@@ -32,7 +32,7 @@ from tests.ut.profiler import RAW_DATA_BASE
OP_GATHER_V2_INFO = { OP_GATHER_V2_INFO = {
'col_name': [ 'col_name': [
'op_name', 'op_type', 'execution_time', 'subgraph', 'full_op_name', 'op_info' 'op_name', 'op_type', 'avg_execution_time', 'subgraph', 'full_op_name', 'op_info'
], ],
'object': [ 'object': [
[ [
...@@ -213,7 +213,7 @@ class TestOpAnalyser: ...@@ -213,7 +213,7 @@ class TestOpAnalyser:
} }
}, },
'sort_condition': { 'sort_condition': {
'name': 'execution_time', 'name': 'avg_execution_time',
'type': 'descending' 'type': 'descending'
}, },
'group_condition': { 'group_condition': {
......
...@@ -21,8 +21,8 @@ from unittest import TestCase ...@@ -21,8 +21,8 @@ from unittest import TestCase
from mindinsight.profiler.analyser.analyser_factory import AnalyserFactory from mindinsight.profiler.analyser.analyser_factory import AnalyserFactory
from tests.ut.profiler import PROFILER_DIR from tests.ut.profiler import PROFILER_DIR
COL_NAMES = ['op_name', 'op_type', 'execution_time', 'subgraph', 'full_op_name', COL_NAMES = ['op_name', 'op_type', 'avg_execution_time', 'subgraph',
'op_info'] 'full_op_name', 'op_info']
def get_detail_infos(indexes=None, sort_name=None, sort_type=True): def get_detail_infos(indexes=None, sort_name=None, sort_type=True):
...@@ -126,12 +126,12 @@ class TestAicoreDetailAnalyser(TestCase): ...@@ -126,12 +126,12 @@ class TestAicoreDetailAnalyser(TestCase):
"""Test the success of the querying function.""" """Test the success of the querying function."""
expect_result = { expect_result = {
'col_name': COL_NAMES, 'col_name': COL_NAMES,
'object': get_detail_infos(sort_name='execution_time', sort_type=True), 'object': get_detail_infos(sort_name='avg_execution_time', sort_type=True),
'size': 10 'size': 10
} }
condition = { condition = {
'sort_condition': { 'sort_condition': {
'name': 'execution_time', 'name': 'avg_execution_time',
'type': 'descending' 'type': 'descending'
} }
} }
...@@ -187,7 +187,7 @@ class TestAicoreDetailAnalyser(TestCase): ...@@ -187,7 +187,7 @@ class TestAicoreDetailAnalyser(TestCase):
expect_result = { expect_result = {
'col_name': COL_NAMES, 'col_name': COL_NAMES,
'object': get_detail_infos( 'object': get_detail_infos(
indexes=[1, 2], sort_name='execution_time', sort_type=True indexes=[1, 2], sort_name='avg_execution_time', sort_type=True
), ),
'size': 4 'size': 4
} }
...@@ -198,7 +198,7 @@ class TestAicoreDetailAnalyser(TestCase): ...@@ -198,7 +198,7 @@ class TestAicoreDetailAnalyser(TestCase):
} }
}, },
'sort_condition': { 'sort_condition': {
'name': 'execution_time' 'name': 'avg_execution_time'
}, },
'group_condition': { 'group_condition': {
'limit': 2, 'limit': 2,
...@@ -211,7 +211,7 @@ class TestAicoreDetailAnalyser(TestCase): ...@@ -211,7 +211,7 @@ class TestAicoreDetailAnalyser(TestCase):
expect_result = { expect_result = {
'col_name': COL_NAMES, 'col_name': COL_NAMES,
'object': get_detail_infos( 'object': get_detail_infos(
indexes=[0, 1, 2, 8], sort_name='execution_time', sort_type=True indexes=[0, 1, 2, 8], sort_name='avg_execution_time', sort_type=True
), ),
'size': 4 'size': 4
} }
...@@ -225,7 +225,7 @@ class TestAicoreDetailAnalyser(TestCase): ...@@ -225,7 +225,7 @@ class TestAicoreDetailAnalyser(TestCase):
} }
}, },
'sort_condition': { 'sort_condition': {
'name': 'execution_time' 'name': 'avg_execution_time'
} }
} }
result = self._analyser.query(condition) result = self._analyser.query(condition)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册