pull/840/head
chuxing 4 years ago
parent 664634d070
commit 84cd741be4

@ -163,8 +163,9 @@ Status HybridModelAsyncExecutor::HandleResult(Status exec_ret,
GELOGD("Start to handle result. model id = %u, data index = %u, execution ret = %u", model_id_, data_id, exec_ret);
std::vector<ge::OutputTensorInfo> output_tensor_info_list;
if (args.is_eos) {
GELOGW("End of sequence, model id = %u", model_id_);
return OnComputeDone(data_id, END_OF_SEQUENCE, output_tensor_info_list);
GELOGI("End of sequence, model id = %u", model_id_);
GE_CHK_STATUS_RET_NOLOG(OnComputeDone(data_id, END_OF_SEQUENCE, output_tensor_info_list));
return SUCCESS;
}
if (exec_ret != SUCCESS) {

@ -211,31 +211,26 @@ Status SubgraphExecutor::PrepareNodes() {
GE_CHECK_NOTNULL(node_state);
auto p_node_state = node_state.get();
if (node_item.node_type == NETOUTPUT) {
// Wait for all inputs become valid
// after PrepareNodes returned. all output tensors and shapes are valid
GE_CHK_STATUS_RET_NOLOG(p_node_state->GetShapeInferenceState().AwaitShapesReady(*context_));
GE_CHK_STATUS_RET_NOLOG(p_node_state->AwaitInputTensors(*context_));
continue;
}
// only do shape inference and compilation for nodes with dynamic shapes.
if (node_item.is_dynamic) {
auto prepare_future = pre_run_pool_.commit([this, p_node_state]() -> Status {
GetContext().SetSessionId(context_->session_id);
GE_CHK_STATUS_RET_NOLOG(InferShape(shape_inference_engine_.get(), *p_node_state));
return PrepareForExecution(context_, *p_node_state);
});
p_node_state->SetPrepareFuture(std::move(prepare_future));
} else {
GELOGD("[%s] Skipping shape inference and compilation for node with static shape.", node_item.NodeName().c_str());
if (node_item.kernel_task == nullptr) {
GELOGW("[%s] Node of static shape got no task.", node_item.NodeName().c_str());
GE_CHK_STATUS_RET(TaskCompileEngine::Compile(*p_node_state, context_),
"[%s] Failed to create task.", p_node_state->GetName().c_str());
if (node_item.node_type != NETOUTPUT) {
// only do shape inference and compilation for nodes with dynamic shapes.
if (node_item.is_dynamic) {
auto prepare_future = pre_run_pool_.commit([this, p_node_state]() -> Status {
GetContext().SetSessionId(context_->session_id);
GE_CHK_STATUS_RET_NOLOG(InferShape(shape_inference_engine_.get(), *p_node_state));
return PrepareForExecution(context_, *p_node_state);
});
p_node_state->SetPrepareFuture(std::move(prepare_future));
} else {
node_state->SetKernelTask(node_item.kernel_task);
GELOGD("[%s] Skipping shape inference and compilation for node with static shape.",
node_item.NodeName().c_str());
if (node_item.kernel_task == nullptr) {
GELOGW("[%s] Node of static shape got no task.", node_item.NodeName().c_str());
GE_CHK_STATUS_RET(TaskCompileEngine::Compile(*p_node_state, context_),
"[%s] Failed to create task.", p_node_state->GetName().c_str());
} else {
node_state->SetKernelTask(node_item.kernel_task);
}
}
}
@ -288,6 +283,15 @@ Status SubgraphExecutor::LaunchTasks() {
return SUCCESS;
}
if (node_state->GetType() == NETOUTPUT) {
// Wait for all inputs become valid
// after PrepareNodes returned. all output tensors and shapes are valid
GE_CHK_STATUS_RET_NOLOG(node_state->GetShapeInferenceState().AwaitShapesReady(*context_));
GE_CHK_STATUS_RET_NOLOG(node_state->AwaitInputTensors(*context_));
GELOGD("[%s] Done executing node successfully.", node_state->GetName().c_str());
continue;
}
GE_CHK_STATUS_RET_NOLOG(node_state->WaitForPrepareDone());
GELOGD("[%s] Start to execute.", node_state->GetName().c_str());

Loading…
Cancel
Save