multi_task for single_op.

pull/1044/head
unknown 4 years ago
parent cfc60a67c6
commit a76ce8c0b4

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

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

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