Browse Source

!1631 dts: modify profiling report data flag in dynamic shape

From: @zhengyuanhua
Reviewed-by: @ji_chen
Signed-off-by: @ji_chen
tags/v1.3.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
67af37e321
4 changed files with 10 additions and 3 deletions
  1. +2
    -0
      ge/common/profiling/profiling_manager.h
  2. +1
    -1
      ge/hybrid/executor/worker/execution_engine.cc
  3. +2
    -2
      ge/hybrid/node_executor/task_context.cc
  4. +5
    -0
      tests/ut/ge/hybrid/executor/worker/execution_engine_unittest.cc

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

@@ -81,7 +81,9 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager {
Status ProfModelUnsubscribe(void *model);
void StopProfiling();
bool ProfilingTrainingTraceOn() const { return is_training_trace_; }
// report model load profiling data flag, data contain task desc info, step info, model load fusion op info
bool ProfilingModelLoadOn() const { return is_load_profiling_; }
// report model execute profiling data flag, data contain model execute time info
bool ProfilingModelExecuteOn() const;
// is_execute_profiling_ only used by ge option and env
bool ProfilingOn() const { return is_load_profiling_ && is_execute_profiling_; }


+ 1
- 1
ge/hybrid/executor/worker/execution_engine.cc View File

@@ -300,7 +300,7 @@ Status NodeDoneCallback::OnNodeDone() {
GE_CHK_STATUS_RET(SaveDumpOpInfo(), "[Save][DumpOpInfo] Failed to dump op info.");
}

if (ProfilingManager::Instance().ProfilingModelExecuteOn()) {
if (ProfilingManager::Instance().ProfilingModelLoadOn()) {
GE_CHK_STATUS_RET(ProfilingReport(), "[Report][Profiling] of node[%s] failed.", node_item.NodeName().c_str());
}



+ 2
- 2
ge/hybrid/node_executor/task_context.cc View File

@@ -563,7 +563,7 @@ const DumpProperties &TaskContext::GetDumpProperties() const {

bool TaskContext::NeedCallback() {
return node_item_->has_observer || IsDumpEnabled() || GraphExecutionContext::profiling_level > 0 ||
!execution_context_->model->IsSingleOp();
!execution_context_->model->IsSingleOp() || ProfilingManager::Instance().ProfilingModelLoadOn();
}

Status TaskContext::Synchronize() {
@@ -572,7 +572,7 @@ Status TaskContext::Synchronize() {

Status TaskContext::SaveProfilingTaskDescInfo(uint32_t task_id, uint32_t stream_id,
const std::string &task_type, uint32_t block_dim) {
if (ProfilingManager::Instance().ProfilingModelExecuteOn()) {
if (ProfilingManager::Instance().ProfilingModelLoadOn()) {
const NodeItem &node_item = GetNodeItem();
auto op_desc = node_item.GetOpDesc();
GE_CHECK_NOTNULL(op_desc);


+ 5
- 0
tests/ut/ge/hybrid/executor/worker/execution_engine_unittest.cc View File

@@ -120,6 +120,11 @@ TEST_F(UtestExecutionEngine, ExecuteAsync_without_callback_and_kernel_task) {

NodeState node_state(*node_item, &subgraph_context);
auto task_context = TaskContext::Create(&node_state, &execution_context, &subgraph_context);
uint32_t task_id = 0;
uint32_t stream_id = 1;
std::string task_type = "rts";
uint32_t block_dim = 0;
task_context->SaveProfilingTaskDescInfo(task_id, stream_id, task_type, block_dim);
auto shared_task_context = std::shared_ptr<TaskContext>(task_context.release());
node_state.SetTaskContext(shared_task_context);



Loading…
Cancel
Save