|
@@ -34,6 +34,15 @@ const char *const kEngineNameHccl = "ops_kernel_info_hccl"; |
|
|
const char *const kEngineNameRts = "DNN_VM_RTS_OP_STORE"; |
|
|
const char *const kEngineNameRts = "DNN_VM_RTS_OP_STORE"; |
|
|
const char *const kEngineNameHostCpu = "DNN_VM_HOST_CPU_OP_STORE"; |
|
|
const char *const kEngineNameHostCpu = "DNN_VM_HOST_CPU_OP_STORE"; |
|
|
const char *const kOwnerGraphIsUnknown = "OwnerGraphIsUnknown"; |
|
|
const char *const kOwnerGraphIsUnknown = "OwnerGraphIsUnknown"; |
|
|
|
|
|
|
|
|
|
|
|
bool IsGraphUnknown(ComputeGraph &graph) { |
|
|
|
|
|
for (const auto &node : graph.GetDirectNode()) { |
|
|
|
|
|
bool is_unknown_shape = false; |
|
|
|
|
|
(void)AttrUtils::GetBool(node->GetOpDesc(), kOwnerGraphIsUnknown, is_unknown_shape); |
|
|
|
|
|
return is_unknown_shape; |
|
|
|
|
|
} |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
Status NodeExecutor::PrepareTask(NodeTask &task, TaskContext &context) const { |
|
|
Status NodeExecutor::PrepareTask(NodeTask &task, TaskContext &context) const { |
|
|
GE_CHK_STATUS_RET_NOLOG(context.AllocateOutputs()); |
|
|
GE_CHK_STATUS_RET_NOLOG(context.AllocateOutputs()); |
|
@@ -82,17 +91,16 @@ NodeExecutorManager::ExecutorType NodeExecutorManager::ResolveExecutorType(Node |
|
|
auto op_type = node.GetType(); |
|
|
auto op_type = node.GetType(); |
|
|
if (op_type == PARTITIONEDCALL) { |
|
|
if (op_type == PARTITIONEDCALL) { |
|
|
const auto &subgraph = NodeUtils::GetSubgraph(node, 0); |
|
|
const auto &subgraph = NodeUtils::GetSubgraph(node, 0); |
|
|
if (subgraph != nullptr) { |
|
|
|
|
|
for (const auto &node : subgraph->GetDirectNode()) { |
|
|
|
|
|
bool is_unknown_shape = false; |
|
|
|
|
|
(void)AttrUtils::GetBool(node->GetOpDesc(), kOwnerGraphIsUnknown, is_unknown_shape); |
|
|
|
|
|
if (is_unknown_shape) { |
|
|
|
|
|
return ExecutorType::DYNAMIC_SUBGRAPH; |
|
|
|
|
|
} else { |
|
|
|
|
|
return ExecutorType::COMPILED_SUBGRAPH; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (subgraph != nullptr && IsGraphUnknown(*subgraph)) { |
|
|
|
|
|
GELOGD("node %s was marked as unknown shape in node executor.", node.GetName().c_str()); |
|
|
|
|
|
return ExecutorType::DYNAMIC_SUBGRAPH; |
|
|
|
|
|
} |
|
|
|
|
|
bool is_dynamic = false; |
|
|
|
|
|
(void) NodeUtils::GetNodeUnknownShapeStatus(node, is_dynamic); |
|
|
|
|
|
if (is_dynamic) { |
|
|
|
|
|
return ExecutorType::DYNAMIC_SUBGRAPH; |
|
|
} |
|
|
} |
|
|
|
|
|
return ExecutorType::COMPILED_SUBGRAPH; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// rts kernel store is assigned to NetOutput |
|
|
// rts kernel store is assigned to NetOutput |
|
|