From a76ce8c0b4f320c11893c3a3f99a457a9c9f27fa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jan 2021 21:48:59 +0800 Subject: [PATCH] multi_task for single_op. --- ge/hybrid/node_executor/task_context.cc | 2 +- ge/single_op/single_op.cc | 1 + ge/single_op/single_op_model.cc | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ge/hybrid/node_executor/task_context.cc b/ge/hybrid/node_executor/task_context.cc index 039effa2..489eaa87 100644 --- a/ge/hybrid/node_executor/task_context.cc +++ b/ge/hybrid/node_executor/task_context.cc @@ -252,7 +252,7 @@ Status TaskContext::AllocateOutput(int index, } if (outputs_start_[index].GetSize() > 0) { - reMemset(output_start_[index].MutableData(), outputs_start_[index].GetSize(), 0, outputs_start_[index].GetSize()); + reMemset(outputs_start_[index].MutableData(), outputs_start_[index].GetSize(), 0, outputs_start_[index].GetSize()); } if (execution_context_->trace_enabled) { diff --git a/ge/single_op/single_op.cc b/ge/single_op/single_op.cc index ee4c84ae..168ca2c5 100755 --- a/ge/single_op/single_op.cc +++ b/ge/single_op/single_op.cc @@ -277,6 +277,7 @@ Status DynamicSingleOp::ExecuteAsync(const vector &input_desc, std::lock_guard lk(*stream_mutex_); GE_CHECK_NOTNULL(op_task_); + GE_CHK_STATUS_RET_NOLOG(op_task_->LaunchKernel(input_desc, input_buffers, output_desc, output_buffers, stream_)); GE_CHK_STATUS_RET_NOLOG(ProfilingTaskInfo(op_task_.get(), kShapeTypeDynamic)); return SUCCESS; diff --git a/ge/single_op/single_op_model.cc b/ge/single_op/single_op_model.cc index d84963dc..8858aa6c 100755 --- a/ge/single_op/single_op_model.cc +++ b/ge/single_op/single_op_model.cc @@ -44,8 +44,8 @@ namespace ge { namespace { const size_t kDataOutputNum = 1; } // namespace -static Status IfInferDepend(HeModelPtr &ge_model, bool &flag) { - auto comp_graph = GraphUtils::GetComputeGraph(ge_model->GetGraph); +static Status IfInferDepend(GeModelPtr &ge_model, bool &flag) { + auto comp_graph = GraphUtils::GetComputeGraph(ge_model->GetGraph()); for (const auto &node : comp_graph->GetAllNodes()) { auto op_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(op_desc); @@ -502,6 +502,10 @@ Status SingleOpModel::BuildDynamicOp(StreamResource &resource, DynamicSingleOp & if (ge_model->GetModelTaskDefPtr()->task_size() > 1 || infer_depend_flag) { GELOGD("Build single op HybridModel."); GE_CHK_STATUS_RET_NOLOG(hybrid::NodeExecutorManager::GetInstance().EnsureInitialized()); + auto root_model = model_helper_.GetGeRootModel(); + GE_CHECK_NOTNULL(root_model); + root_model->SetRootGraph(GraphUtils::GetComputeGraph(ge_model->GetGraph())); + root_model->SetSubgraphInstanceNameToModel(ge_model->GetGraph()->GetName(), ge_model); single_op.hybrid_model_.reset(new (std::nothrow)hybrid::HybridModel(model_helper_.GetGeRootModel())); GE_CHECK_NOTNULL(single_op.hybrid_model_); GE_CHK_STATUS_RET(single_op.hybrid_model_->Init(true), "Failed to init hybrid model");