Browse Source

gpu_timeline(python code)

update mindspore/profiler/parser/integrator.py.

update mindspore/profiler/profiling.py.
tags/v1.1.0
gzhcv 5 years ago
parent
commit
f0f4ee985b
2 changed files with 4 additions and 1 deletions
  1. +3
    -1
      mindspore/ccsrc/profiler/device/gpu/gpu_profiling.cc
  2. +1
    -0
      mindspore/ccsrc/profiler/device/gpu/gpu_profiling.h

+ 3
- 1
mindspore/ccsrc/profiler/device/gpu/gpu_profiling.cc View File

@@ -406,8 +406,10 @@ void GPUProfiler::OpDataProducerBegin(const std::string op_name, void *stream) {
CHECK_CUDA_RET_WITH_ERROR(cudaEventRecord(op_event_start_, (CUstream)stream_), CHECK_CUDA_RET_WITH_ERROR(cudaEventRecord(op_event_start_, (CUstream)stream_),
"cudaEventRecord op event start failed"); "cudaEventRecord op event start failed");
op_host_time_start_ = GetHostTimeStamp(); op_host_time_start_ = GetHostTimeStamp();
op_cupti_time_start_ = GetCUPTITimeStamp();
} else { } else {
op_host_time_start_ = GetHostTimeStamp(); op_host_time_start_ = GetHostTimeStamp();
op_cupti_time_start_ = GetCUPTITimeStamp();
} }
SetRunTimeData(op_name, stream); SetRunTimeData(op_name, stream);
} }
@@ -431,7 +433,7 @@ void GPUProfiler::OpDataProducerEnd() {
} }
MS_LOG(DEBUG) << "Host Time Elapsed(us)," << op_name_ << "," << op_time_elapsed; MS_LOG(DEBUG) << "Host Time Elapsed(us)," << op_name_ << "," << op_time_elapsed;
SetRunTimeData(op_name_, op_time_elapsed); SetRunTimeData(op_name_, op_time_elapsed);
SetRunTimeData(op_name_, op_host_time_start_, op_time_elapsed);
SetRunTimeData(op_name_, op_cupti_time_start_, op_time_elapsed);
} }


void GPUProfiler::StopCUPTI() { void GPUProfiler::StopCUPTI() {


+ 1
- 0
mindspore/ccsrc/profiler/device/gpu/gpu_profiling.h View File

@@ -170,6 +170,7 @@ class GPUProfiler {
cudaEvent_t op_event_stop_; cudaEvent_t op_event_stop_;
uint64_t op_host_time_start_; uint64_t op_host_time_start_;
uint64_t op_host_time_stop_; uint64_t op_host_time_stop_;
uint64_t op_cupti_time_start_;
std::string profile_data_path_; std::string profile_data_path_;
}; };
} // namespace gpu } // namespace gpu


Loading…
Cancel
Save