Browse Source

multi_task for single_op.

tags/v1.2.0
unknown 3 years ago
parent
commit
a76ce8c0b4
3 changed files with 8 additions and 3 deletions
  1. +1
    -1
      ge/hybrid/node_executor/task_context.cc
  2. +1
    -0
      ge/single_op/single_op.cc
  3. +6
    -2
      ge/single_op/single_op_model.cc

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

@@ -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) {


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

@@ -277,6 +277,7 @@ Status DynamicSingleOp::ExecuteAsync(const vector<GeTensorDesc> &input_desc,

std::lock_guard<std::mutex> 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;


+ 6
- 2
ge/single_op/single_op_model.cc View File

@@ -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");


Loading…
Cancel
Save