From a96e4dc56c1aa22a21c6dabfdc64f74429d619cb Mon Sep 17 00:00:00 2001 From: lichun Date: Mon, 25 Jan 2021 15:54:46 +0800 Subject: [PATCH] Bugfix: fix the error in singleop scene --- ge/generator/ge_generator.cc | 2 +- ge/graph/partition/dynamic_shape_partition.cc | 7 +++++++ ge/graph/passes/dynamic_single_op_reset_shape_pass.cc | 4 ++-- ge/graph/preprocess/graph_preprocess.cc | 2 +- metadef | 2 +- parser | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ge/generator/ge_generator.cc b/ge/generator/ge_generator.cc index d032965b..fe7ea3bf 100644 --- a/ge/generator/ge_generator.cc +++ b/ge/generator/ge_generator.cc @@ -670,7 +670,7 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector &in const string &model_file_name, OpEngineType engine_type, ModelBufferData &model_buff, bool is_offline) { if (!is_offline) { - (void)AttrUtils::SetBool(op_desc, ATTR_DYNAMIC_SHAPE_SINGLE_AICPU, true); + (void)AttrUtils::SetBool(op_desc, ATTR_SINGLE_OP_SCENE, true); } if (CheckForSingleOp(op_desc, inputs, outputs) != SUCCESS) { diff --git a/ge/graph/partition/dynamic_shape_partition.cc b/ge/graph/partition/dynamic_shape_partition.cc index 1c82eaf3..2a60765f 100755 --- a/ge/graph/partition/dynamic_shape_partition.cc +++ b/ge/graph/partition/dynamic_shape_partition.cc @@ -51,6 +51,13 @@ using ClusterPtr = std::shared_ptr; static bool IsInExperimentalMode(const ComputeGraphPtr &root_graph) { for (const auto &node : root_graph->GetAllNodes()) { GE_CHECK_NOTNULL(node->GetOpDesc()); + // not do partition in single op scene. + bool is_singleop = false; + (void)AttrUtils::GetBool(node->GetOpDesc(), ATTR_SINGLE_OP_SCENE, is_singleop); + if (is_singleop) { + return false; + } + for (const auto &input_desc : node->GetOpDesc()->GetAllInputsDesc()) { auto type = input_desc.GetDataType(); if (type == DT_STRING || type == DT_RESOURCE || type == DT_STRING_REF) { diff --git a/ge/graph/passes/dynamic_single_op_reset_shape_pass.cc b/ge/graph/passes/dynamic_single_op_reset_shape_pass.cc index 6fa63642..293fd132 100644 --- a/ge/graph/passes/dynamic_single_op_reset_shape_pass.cc +++ b/ge/graph/passes/dynamic_single_op_reset_shape_pass.cc @@ -58,9 +58,9 @@ Status DynamicSingleOpResetShapePass::Run(ComputeGraphPtr graph) { continue; } - // pass node without attr: ATTR_DYNAMIC_SHAPE_SINGLE_AICPU + // pass node without attr: ATTR_SINGLE_OP_SCENE bool single_aicpu_unknown = false; - if (!AttrUtils::GetBool(node->GetOpDesc(), ATTR_DYNAMIC_SHAPE_SINGLE_AICPU, single_aicpu_unknown) || + if (!AttrUtils::GetBool(node->GetOpDesc(), ATTR_SINGLE_OP_SCENE, single_aicpu_unknown) || !single_aicpu_unknown) { continue; } diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index c6179095..63f1b131 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -1925,7 +1925,7 @@ void GraphPrepare::TypeConversionOfConstant() { for (ge::NodePtr &n : compute_graph_->GetAllNodes()) { // This can ensure that n is not a null pointer // No Conversion when called by aclOpCompile - (void)AttrUtils::GetBool(n->GetOpDesc(), ATTR_DYNAMIC_SHAPE_SINGLE_AICPU, is_acl_compile); + (void)AttrUtils::GetBool(n->GetOpDesc(), ATTR_SINGLE_OP_SCENE, is_acl_compile); if (is_acl_compile) { return; } diff --git a/metadef b/metadef index 8397bb01..8ab60be2 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 8397bb015c9b8641451936fab1e1bc64c4536def +Subproject commit 8ab60be2870b80b1ec952bb21c7f05ae2a624984 diff --git a/parser b/parser index 018f2116..98f17f4a 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit 018f2116db7ce522d4a8ac3016351b5b6484cb66 +Subproject commit 98f17f4a2a37f283797858eabefa9dba1d06a66b