Browse Source

!1956 fix bug for step info

Merge pull request !1956 from zhupuxu/fix_bug_step_info
tags/v1.5.1
i-robot Gitee 3 years ago
parent
commit
b2a87b032f
4 changed files with 10 additions and 11 deletions
  1. +4
    -10
      ge/common/profiling/ge_profiling.cc
  2. +2
    -0
      ge/common/profiling/profiling_manager.cc
  3. +3
    -0
      ge/common/profiling/profiling_manager.h
  4. +1
    -1
      ge/single_op/single_op.cc

+ 4
- 10
ge/common/profiling/ge_profiling.cc View File

@@ -230,21 +230,15 @@ ge::Status ProfSetStepInfo(uint64_t index_id, uint16_t tag_id, rtStream_t stream
REPORT_CALL_ERROR("E19999", "Get logic device id failed, ret 0x%X", rt_ret); REPORT_CALL_ERROR("E19999", "Get logic device id failed, ret 0x%X", rt_ret);
return ge::FAILED; return ge::FAILED;
} }
auto &profiling_manager = ge::ProfilingManager::Instance();
profiling_manager.SetStepInfoIndex(index_id);
if (is_first_run && tag_id == kStepStart) { if (is_first_run && tag_id == kStepStart) {
GE_CHK_STATUS_RET_NOLOG(ge::ProfilingManager::Instance().ProfileStepInfo(index_id,
kModelId,
tag_id,
stream,
device_id));
GE_CHK_STATUS_RET_NOLOG(profiling_manager.ProfileStepInfo(index_id, kModelId, tag_id, stream, device_id));
is_first_run = false; is_first_run = false;
return ge::SUCCESS; return ge::SUCCESS;
} }
if (!is_first_run && tag_id == kStepEnd) { if (!is_first_run && tag_id == kStepEnd) {
GE_CHK_STATUS_RET_NOLOG(ge::ProfilingManager::Instance().ProfileStepInfo(index_id,
kModelId,
tag_id,
stream,
device_id));
GE_CHK_STATUS_RET_NOLOG(profiling_manager.ProfileStepInfo(index_id, kModelId, tag_id, stream, device_id));
is_first_run = true; is_first_run = true;
return ge::SUCCESS; return ge::SUCCESS;
} }


+ 2
- 0
ge/common/profiling/profiling_manager.cc View File

@@ -69,6 +69,7 @@ ProfilingManager::ProfilingManager()
: is_load_profiling_(false), is_execute_profiling_(false), is_training_trace_(false), subscribe_count_(0) { : is_load_profiling_(false), is_execute_profiling_(false), is_training_trace_(false), subscribe_count_(0) {
prof_cb_.msprofCtrlCallback = nullptr; prof_cb_.msprofCtrlCallback = nullptr;
prof_cb_.msprofReporterCallback = nullptr; prof_cb_.msprofReporterCallback = nullptr;
index_id_ = UINT64_MAX;
} }


ProfilingManager::~ProfilingManager() {} ProfilingManager::~ProfilingManager() {}
@@ -604,6 +605,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfFi
is_load_profiling_ = false; is_load_profiling_ = false;
is_training_trace_ = false; is_training_trace_ = false;
is_execute_profiling_ = false; is_execute_profiling_ = false;
index_id_ = UINT64_MAX;


// profiling plugin uninit // profiling plugin uninit
PluginUnInit(); PluginUnInit();


+ 3
- 0
ge/common/profiling/profiling_manager.h View File

@@ -101,6 +101,8 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager {
void GetOpInputOutputInfo(const OpDescPtr &op, TaskDescInfo &task_desc_info) const; void GetOpInputOutputInfo(const OpDescPtr &op, TaskDescInfo &task_desc_info) const;
void ReportData(const int32_t &device_id, const std::string &data, const std::string &tag_name); void ReportData(const int32_t &device_id, const std::string &data, const std::string &tag_name);
Status ProfileStepInfo(uint64_t index_id, uint64_t model_id, uint16_t tag_id, rtStream_t stream, int32_t device_id); Status ProfileStepInfo(uint64_t index_id, uint64_t model_id, uint16_t tag_id, rtStream_t stream, int32_t device_id);
void SetStepInfoIndex(uint64_t index_id) { index_id_ = index_id; }
uint64_t GetStepInfoIndex() { return index_id_; }
private: private:
Status InitFromOptions(const Options &options, MsprofGeOptions &prof_conf); Status InitFromOptions(const Options &options, MsprofGeOptions &prof_conf);
Status ParseOptions(const std::string &options); Status ParseOptions(const std::string &options);
@@ -127,6 +129,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager {
std::string fp_point_; std::string fp_point_;
std::string bp_point_; std::string bp_point_;
uint32_t reporter_max_len_ = 0; uint32_t reporter_max_len_ = 0;
uint64_t index_id_;
}; };
} // namespace ge } // namespace ge
#endif // GE_COMMON_PROFILING_PROFILING_MANAGER_H_ #endif // GE_COMMON_PROFILING_PROFILING_MANAGER_H_

+ 1
- 1
ge/single_op/single_op.cc View File

@@ -58,7 +58,7 @@ Status ProfilingTaskInfo(OpTask *op_task, const string &shape_type) {
tmp_task_desc_info.op_name.c_str(), tmp_task_desc_info.model_name.c_str()); tmp_task_desc_info.op_name.c_str(), tmp_task_desc_info.model_name.c_str());


tmp_task_desc_info.shape_type = shape_type; tmp_task_desc_info.shape_type = shape_type;
tmp_task_desc_info.cur_iter_num = 0;
tmp_task_desc_info.cur_iter_num = ProfilingManager::Instance().GetStepInfoIndex();
tmp_task_desc_info.task_type = op_task->GetTaskType(); tmp_task_desc_info.task_type = op_task->GetTaskType();


std::vector<TaskDescInfo> task_desc_info; std::vector<TaskDescInfo> task_desc_info;


Loading…
Cancel
Save