Browse Source

!350 Fix minddata device_queue_op time info error.

Merge pull request !350 from yuximiao/r0.5
tags/v0.5.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
65f37e3373
2 changed files with 6 additions and 3 deletions
  1. +2
    -2
      mindinsight/profiler/analyser/minddata_analyser.py
  2. +4
    -1
      mindinsight/profiler/common/util.py

+ 2
- 2
mindinsight/profiler/analyser/minddata_analyser.py View File

@@ -116,13 +116,13 @@ class MinddataAnalyser(BaseAnalyser):
# op_info: 2: step num 3: cost time
if op_info[1] == "0":
get_time_list.append([int(op_info[2]), float(op_info[3])])
total_cost += float(op_info[3])
total_get += float(op_info[3])
elif op_info[1] == "1":
push_time_list.append([int(op_info[2]), float(op_info[3])])
total_push += float(op_info[3])
elif op_info[1] == "2":
total_time_list.append([int(op_info[2]), float(op_info[3])])
total_get += float(op_info[3])
total_cost += float(op_info[3])
elif op_info and op_info[0] == "1" and info_type in ["all", "queue"]:
queue_size_list.append([int(op_info[2]), int(op_info[3])])
if op_info[1] == op_info[3]:


+ 4
- 1
mindinsight/profiler/common/util.py View File

@@ -118,7 +118,10 @@ def get_summary_for_step_trace(average_info, header):
def calculate_percent(partial, total):
"""Calculate percent value."""
percent = round(partial / total * 100, 2)
if total:
percent = round(partial / total * 100, 2)
else:
percent = 0
return f'{percent}%'


Loading…
Cancel
Save