提交 419b7f8a 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!389 Modify the time unit of aicpu profiling data

Merge pull request !389 from 治愈系潇洒哥/master
...@@ -35,8 +35,9 @@ class DataPreProcessParser: ...@@ -35,8 +35,9 @@ class DataPreProcessParser:
_source_file_target = 'DATA_PREPROCESS.dev.AICPU.' _source_file_target = 'DATA_PREPROCESS.dev.AICPU.'
_dst_file_title = 'title:DATA_PREPROCESS AICPU' _dst_file_title = 'title:DATA_PREPROCESS AICPU'
_dst_file_column_title = ['serial_number', 'node_type_name', 'total_time(us)', _dst_file_column_title = ['serial_number', 'node_type_name', 'total_time(ms)',
'dispatch_time(us)', 'run_start', 'run_end'] 'dispatch_time(ms)', 'run_start', 'run_end']
_ms_unit = 1000
def __init__(self, input_path, output_filename): def __init__(self, input_path, output_filename):
self._input_path = input_path self._input_path = input_path
...@@ -71,8 +72,8 @@ class DataPreProcessParser: ...@@ -71,8 +72,8 @@ class DataPreProcessParser:
run_start = node_list[1].split(':')[-1].split(' ')[0] run_start = node_list[1].split(':')[-1].split(' ')[0]
run_end = node_list[run_end_index].split(':')[-1].split(' ')[0] run_end = node_list[run_end_index].split(':')[-1].split(' ')[0]
total_time = thread_list[-1].split('=')[-1].split()[0] total_time = float(thread_list[-1].split('=')[-1].split()[0]) / self._ms_unit
dispatch_time = thread_list[-2].split('=')[-1].split()[0] dispatch_time = float(thread_list[-2].split('=')[-1].split()[0]) / self._ms_unit
return [number, node_type_name, total_time, dispatch_time, return [number, node_type_name, total_time, dispatch_time,
run_start, run_end] run_start, run_end]
...@@ -112,7 +113,7 @@ class DataPreProcessParser: ...@@ -112,7 +113,7 @@ class DataPreProcessParser:
result_list.append(result) result_list.append(result)
# Calculate the total time. # Calculate the total time.
total_time = result[2] total_time = result[2]
ai_cpu_total_time_summary += int(total_time) ai_cpu_total_time_summary += total_time
# Increase node serial number. # Increase node serial number.
serial_number += 1 serial_number += 1
elif "Node" in node_line and "Thread" not in thread_line: elif "Node" in node_line and "Thread" not in thread_line:
...@@ -120,7 +121,8 @@ class DataPreProcessParser: ...@@ -120,7 +121,8 @@ class DataPreProcessParser:
logger.warning("The node type:%s cannot find thread data", node_type_name) logger.warning("The node type:%s cannot find thread data", node_type_name)
if result_list: if result_list:
result_list.append(["AI CPU Total Time(us):", ai_cpu_total_time_summary]) ai_cpu_total_time = format(ai_cpu_total_time_summary, '.6f')
result_list.append(["AI CPU Total Time(ms):", ai_cpu_total_time])
fwrite_format(self._output_filename, data_source=self._dst_file_title, is_print=True, fwrite_format(self._output_filename, data_source=self._dst_file_title, is_print=True,
is_start=True) is_start=True)
fwrite_format(self._output_filename, fwrite_format(self._output_filename,
......
serial_number node_type_name total_time(us) dispatch_time(us) run_start run_end serial_number node_type_name total_time(ms) dispatch_time(ms) run_start run_end
---------------------- ---------------- ---------------- ------------------- ----------- ---------- ---------------------- ---------------- ---------------- ------------------- ----------- ----------
1 InitData 1567 100 2298200409 2298200538 1 InitData 1.567 0.1 2298200409 2298200538
2 GetNext 989 87 2302769932 2302769980 2 GetNext 0.989 0.087 2302769932 2302769980
3 TruncatedNormal 1566 105 4098200409 4098200538 3 TruncatedNormal 1.566 0.105 4098200409 4098200538
AI CPU Total Time(us): 4122 AI CPU Total Time(ms): 4.122000
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册