Browse Source

!1478 Don't reset -2 when there is aicore op.

From: @zhao_zhixuan
Reviewed-by: @xchu42,@ji_chen
Signed-off-by: @lbisdaddy
tags/v1.2.0
mindspore-ci-bot Gitee 4 years ago
parent
commit
7f73eedb8a
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      ge/generator/ge_generator.cc

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

@@ -692,6 +692,22 @@ namespace {
}
return SUCCESS;
}

bool CheckNoAicore(const ComputeGraphPtr &graph) {
for (const auto &node : graph->GetDirectNode()) {
if (node == nullptr) {
continue;
}
auto op_desc = node->GetOpDesc();
if (op_desc == nullptr) {
continue;
}
if (op_desc->GetOpEngineName() == kAIcoreEngine) {
return false;
}
}
return true;
}
}

void GeGenerator::RemoveConst(const vector<GeTensor> &inputs, vector<GeTensor> &outputs) {
@@ -787,7 +803,7 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &in

bool all_shape = false;
(void)AttrUtils::GetBool(op_desc, kAicpuAllshape, all_shape);
if (all_shape) {
if (all_shape && CheckNoAicore(root_graph)) {
GELOGD("Get aicpu all_shape kernel!");
vector<GeTensor> inputs_dynamic;
vector<GeTensor> outputs_dynamic;


Loading…
Cancel
Save