!1254 Fix variable fusion when variables occurr only in subgraphs

From: @xchu42
Reviewed-by: @ji_chen,@wqtshg
Signed-off-by: @ji_chen
pull/1254/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 41cc6f2046

@ -3874,7 +3874,7 @@ Status DavinciModel::TransAllVarData(ComputeGraphPtr &graph, uint32_t graph_id)
}
std::vector<NodePtr> variable_node_list;
for (ge::NodePtr &node : graph->GetDirectNode()) {
for (ge::NodePtr &node : graph->GetAllNodes()) {
if (node == nullptr) {
continue;
}

@ -119,8 +119,9 @@ Status VariableOpPass::Run(ge::ComputeGraphPtr graph) {
return INTERNAL_ERROR;
}
auto graph_id = GraphUtils::FindRootGraph(graph)->GetGraphID();
GELOGD("Begin to run variable op pass on graph %s, session %lu, graph id %u", graph->GetName().c_str(),
GetContext().SessionId(), graph->GetGraphID());
GetContext().SessionId(), graph_id);
if (var_accelerate_ctrl_ == nullptr) {
GELOGE(INTERNAL_ERROR, "Failed to run var op pass, the variable accelerate control is null");
@ -176,7 +177,7 @@ Status VariableOpPass::Run(ge::ComputeGraphPtr graph) {
GELOGE(INTERNAL_ERROR, "Failed to update the format fusion road for var %s", node->GetName().c_str());
return INTERNAL_ERROR;
}
ret = VarManager::Instance(graph->GetSessionID())->SetChangedGraphId(node->GetName(), graph->GetGraphID());
ret = VarManager::Instance(graph->GetSessionID())->SetChangedGraphId(node->GetName(), graph_id);
if (ret != SUCCESS) {
GELOGE(INTERNAL_ERROR, "Failed to update the graph id for var %s", node->GetName().c_str());
return INTERNAL_ERROR;

Loading…
Cancel
Save