|
|
|
@ -59,7 +59,10 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
|
|
|
|
|
task_queue_.Pop(task_info);
|
|
|
|
|
GELOGD("[Executor: %d] Got task, stage = %d, iteration = %ld", id_, task_info.stage, task_info.iteration);
|
|
|
|
|
if (task_info.iteration >= pipe_config_->iteration_end) {
|
|
|
|
|
GELOGE(INTERNAL_ERROR, "[Executor: %d] Unexpected iteration: %d", id_, task_info.iteration);
|
|
|
|
|
GELOGE(INTERNAL_ERROR, "[Check][Range][Executor: %d] Unexpected iteration: %d when StageExecutor %s.",
|
|
|
|
|
id_, task_info.iteration, __FUNCTION__);
|
|
|
|
|
REPORT_INNER_ERROR("E19999", "[Executor: %d] Unexpected iteration: %d when StageExecutor %s.",
|
|
|
|
|
id_, task_info.iteration, __FUNCTION__);
|
|
|
|
|
return INTERNAL_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -75,7 +78,8 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
|
|
|
|
|
|
|
|
|
|
if (task_info.stage == 0) {
|
|
|
|
|
GELOGD("[Executor: %d] To ResetExecutionContext", id_);
|
|
|
|
|
GE_CHK_STATUS_RET(ResetExecutionContext(context_), "[Executor: %d] Failed to reset context", id_);
|
|
|
|
|
GE_CHK_STATUS_RET(ResetExecutionContext(context_),
|
|
|
|
|
"[Invoke][ResetExecutionContext][Executor: %d] Failed to reset context", id_);
|
|
|
|
|
context_.iteration = task_info.iteration;
|
|
|
|
|
GE_CHK_STATUS_RET_NOLOG(SetInputs(inputs, input_desc));
|
|
|
|
|
}
|
|
|
|
@ -92,8 +96,11 @@ Status StageExecutor::Start(const std::vector<TensorValue> &inputs, const std::v
|
|
|
|
|
|
|
|
|
|
auto sync_result = Synchronize();
|
|
|
|
|
if (sync_result != SUCCESS) {
|
|
|
|
|
GELOGE(sync_result, "[Executor: %d] Failed to sync result. iteration = %d", id_, task_info.iteration);
|
|
|
|
|
|
|
|
|
|
GELOGE(sync_result,
|
|
|
|
|
"[Invoke][Synchronize][Executor: %d] Failed to sync result when StageExecutor %s. iteration = %d",
|
|
|
|
|
id_, __FUNCTION__, task_info.iteration);
|
|
|
|
|
REPORT_CALL_ERROR("E19999", "[Executor: %d] Failed to sync result when StageExecutor %s. iteration = %d",
|
|
|
|
|
id_, __FUNCTION__, task_info.iteration);
|
|
|
|
|
context_.profiler->Dump(std::cout);
|
|
|
|
|
context_.callback_manager->Destroy();
|
|
|
|
|
RuntimeInferenceContext::DestroyContext(std::to_string(context_.context_id));
|
|
|
|
@ -242,7 +249,10 @@ Status HybridModelPipelineExecutor::Execute(HybridModelExecutor::ExecuteArgs &ar
|
|
|
|
|
GELOGD("Start to sync result of executor[%zu]", i);
|
|
|
|
|
auto ret = futures[i].get();
|
|
|
|
|
if (ret != SUCCESS) {
|
|
|
|
|
GELOGE(ret, "[Executor: %zu] Failed to schedule tasks.", i);
|
|
|
|
|
GELOGE(ret, "[Check][Result][Executor: %zu] Failed to schedule tasks when HybridModelPipelineExecutor %s.",
|
|
|
|
|
i, __FUNCTION__);
|
|
|
|
|
REPORT_INNER_ERROR("E19999", "[Executor: %zu] Failed to schedule tasks when HybridModelPipelineExecutor %s.",
|
|
|
|
|
i, __FUNCTION__);
|
|
|
|
|
has_error = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
@ -250,7 +260,10 @@ Status HybridModelPipelineExecutor::Execute(HybridModelExecutor::ExecuteArgs &ar
|
|
|
|
|
ret = stage_executors_[i]->Synchronize();
|
|
|
|
|
|
|
|
|
|
if (ret != SUCCESS) {
|
|
|
|
|
GELOGE(ret, "[Executor: %zu] Failed to synchronize result.", i);
|
|
|
|
|
GELOGE(ret, "[Invoke][Synchronize] failed for [Executor: %zu] when HybridModelPipelineExecutor %s.",
|
|
|
|
|
i, __FUNCTION__);
|
|
|
|
|
REPORT_CALL_ERROR("E19999", "[Executor: %zu] failed to Synchronize result when HybridModelPipelineExecutor %s.",
|
|
|
|
|
i, __FUNCTION__);
|
|
|
|
|
has_error = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
@ -266,13 +279,14 @@ Status HybridModelPipelineExecutor::Execute(HybridModelExecutor::ExecuteArgs &ar
|
|
|
|
|
iteration_ = config_.iteration_end;
|
|
|
|
|
|
|
|
|
|
if (has_error) {
|
|
|
|
|
GELOGE(FAILED, "Error occurred while execution");
|
|
|
|
|
GELOGE(FAILED, "[Check][Error]Error occurred while execution when HybridModelPipelineExecutor %s.", __FUNCTION__);
|
|
|
|
|
REPORT_INNER_ERROR("E19999", "Error occurred while execution when HybridModelPipelineExecutor %s.", __FUNCTION__);
|
|
|
|
|
return FAILED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto last_iter_executor_idx = loop_count % stage_executors_.size();
|
|
|
|
|
GE_CHK_STATUS_RET(stage_executors_[last_iter_executor_idx]->GetOutputs(args.outputs, args.output_desc),
|
|
|
|
|
"Failed to get output from executor[%zu]", last_iter_executor_idx);
|
|
|
|
|
"[Get][Outputs]Failed from executor[%zu]", last_iter_executor_idx);
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|