Browse Source

Bugfix: fix the error in singleop scene

tags/v1.2.0
lichun 3 years ago
parent
commit
a96e4dc56c
6 changed files with 13 additions and 6 deletions
  1. +1
    -1
      ge/generator/ge_generator.cc
  2. +7
    -0
      ge/graph/partition/dynamic_shape_partition.cc
  3. +2
    -2
      ge/graph/passes/dynamic_single_op_reset_shape_pass.cc
  4. +1
    -1
      ge/graph/preprocess/graph_preprocess.cc
  5. +1
    -1
      metadef
  6. +1
    -1
      parser

+ 1
- 1
ge/generator/ge_generator.cc View File

@@ -670,7 +670,7 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &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) {


+ 7
- 0
ge/graph/partition/dynamic_shape_partition.cc View File

@@ -51,6 +51,13 @@ using ClusterPtr = std::shared_ptr<Cluster>;
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) {


+ 2
- 2
ge/graph/passes/dynamic_single_op_reset_shape_pass.cc View File

@@ -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;
}


+ 1
- 1
ge/graph/preprocess/graph_preprocess.cc View File

@@ -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;
}


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 8397bb015c9b8641451936fab1e1bc64c4536def
Subproject commit 8ab60be2870b80b1ec952bb21c7f05ae2a624984

+ 1
- 1
parser

@@ -1 +1 @@
Subproject commit 018f2116db7ce522d4a8ac3016351b5b6484cb66
Subproject commit 98f17f4a2a37f283797858eabefa9dba1d06a66b

Loading…
Cancel
Save