|
|
|
@@ -234,7 +234,7 @@ Status AicpuNodeTaskBase::ExecuteAsync(TaskContext &context, std::function<void( |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
Status AicpuTfNodeTask::InitForDependComputeTask() { |
|
|
|
Status AicpuTfNodeTask::InitForDependComputeTask() override { |
|
|
|
if ((unknown_type_ != DEPEND_COMPUTE) || (node_item_->num_outputs == 0)) { |
|
|
|
GELOGD("Node[%s] type[%s] unknown_type is %d, output num is %d.", |
|
|
|
node_name_.c_str(), node_item_->node_type.c_str(), unknown_type_, node_item_->num_outputs); |
|
|
|
@@ -652,31 +652,10 @@ Status AicpuTfNodeTask::LaunchTask(TaskContext &context) { |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
Status AicpuTfNodeTask::TaskCallback(TaskContext &context) { |
|
|
|
GELOGD("Node[%s] task callback start. is_dynamic=%s, unknown_type=%d.", |
|
|
|
node_name_.c_str(), node_item_->is_dynamic ? "true" : "false", unknown_type_); |
|
|
|
Status callback_ret = SUCCESS; |
|
|
|
if (node_item_->is_dynamic) { |
|
|
|
// check need update shape, call update shape. |
|
|
|
if (unknown_type_ == DEPEND_SHAPE_RANGE) { |
|
|
|
// check result |
|
|
|
callback_ret = UpdateOutputShapeFromExtInfo(context); |
|
|
|
} else if (unknown_type_ == DEPEND_COMPUTE) { |
|
|
|
callback_ret = UpdateShapeAndDataByResultSummary(context); |
|
|
|
} |
|
|
|
} |
|
|
|
GELOGD("Node[%s] task callback end.", node_name_.c_str()); |
|
|
|
return callback_ret; |
|
|
|
} |
|
|
|
|
|
|
|
Status AicpuNodeTask::Init(const HybridModel &model) { |
|
|
|
auto node_name = node_name_; |
|
|
|
GELOGD("Node[%s] init start.", node_name.c_str()); |
|
|
|
|
|
|
|
GE_CHK_BOOL_RET_STATUS(unknown_type_ != DEPEND_COMPUTE, FAILED, |
|
|
|
"[Check][Type]Node[%s] unknown type[%d] is depend compute, it's not supported now.", |
|
|
|
node_name.c_str(), unknown_type_); |
|
|
|
|
|
|
|
GE_CHK_BOOL_RET_STATUS(task_def_.has_kernel(), FAILED, |
|
|
|
"[Check][task_def_]Node[%s] task def does not has kernel.", node_name.c_str()); |
|
|
|
auto &kernel_def = task_def_.kernel(); |
|
|
|
@@ -765,6 +744,8 @@ Status AicpuNodeTask::Init(const HybridModel &model) { |
|
|
|
uint64_t ext_session_id = model.GetSessionId(); |
|
|
|
GE_CHK_STATUS_RET(InitExtInfo(kernel_ext_info, ext_session_id), |
|
|
|
"[Init][ExtInfo] failed for Node[%s].", node_name.c_str()); |
|
|
|
GE_CHK_STATUS_RET(InitForDependComputeTask(), |
|
|
|
"[Init][DependComputeTask] failed for Node[%s].", node_name_.c_str()); |
|
|
|
|
|
|
|
if (ext_info_addr_dev_ == nullptr) { |
|
|
|
aicpu_param_head->extInfoLength = 0; |
|
|
|
@@ -833,15 +814,19 @@ Status AicpuNodeTask::LaunchTask(TaskContext &context) { |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
Status AicpuNodeTask::TaskCallback(TaskContext &context) { |
|
|
|
Status AicpuNodeTaskBase::TaskCallback(TaskContext &context) { |
|
|
|
GELOGD("Node[%s] task callback start, is_dynamic = %s, unknown_type=%d.", |
|
|
|
node_name_.c_str(), node_item_->is_dynamic ? "true" : "false", unknown_type_); |
|
|
|
Status callback_ret = SUCCESS; |
|
|
|
|
|
|
|
// check need update shape, call update shape. |
|
|
|
if (node_item_->is_dynamic && unknown_type_ == DEPEND_SHAPE_RANGE) { |
|
|
|
// check result |
|
|
|
callback_ret = UpdateOutputShapeFromExtInfo(context); |
|
|
|
if (node_item_->is_dynamic) { |
|
|
|
if (unknown_type_ == DEPEND_SHAPE_RANGE) { |
|
|
|
// check result |
|
|
|
callback_ret = UpdateOutputShapeFromExtInfo(context); |
|
|
|
} else if (unknown_type_ == DEPEND_COMPUTE) { |
|
|
|
callback_ret = UpdateShapeAndDataByResultSummary(context); |
|
|
|
} |
|
|
|
} else { |
|
|
|
GELOGD("Node[%s] unknown shape type is %d no need update output shape.", |
|
|
|
node_name_.c_str(), unknown_type_); |
|
|
|
|