Browse Source

!10634 Fix the bug of step trace write file which exist

From: @gzhcv
Reviewed-by: @wangyue01,@lilongfei15
Signed-off-by: @lilongfei15
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
13a69af59d
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      mindspore/profiler/parser/step_trace_parser.py

+ 4
- 2
mindspore/profiler/parser/step_trace_parser.py View File

@@ -380,7 +380,8 @@ class GpuStepTraceParser(BaseStepTraceParser):
points = {
'fp_start': fp_start_name,
}

if os.path.exists(output_path):
return points
try:
with open(output_path, 'w') as json_file:
json.dump(points, json_file)
@@ -486,7 +487,8 @@ class AscendStepTraceParser(BaseStepTraceParser):
points = {
'fp_start': point_info.get(self._fp_tag, ''),
}

if os.path.exists(output_path):
return points
try:
with open(output_path, 'w') as json_file:
json.dump(points, json_file)


Loading…
Cancel
Save