!8182 Save graph before remove nop nodes

Merge pull request !8182 from wangyue/master
pull/8182/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit f458184442

@ -170,6 +170,14 @@ GraphId AscendSession::CompileGraphImpl(NotNull<FuncGraphPtr> func_graph) {
InsertMakeTupleForOutput(NOT_NULL(root_graph));
// root root_graph valiate,include genearte execute order and so on
RootGraphExecutorValidate(NOT_NULL(root_graph));
// dump graph before remove nop nodes
auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
bool save_graphs = context_ptr->get_param<bool>(MS_CTX_SAVE_GRAPHS_FLAG);
if (save_graphs) {
DumpIRProto(root_graph, "before_removeNop_" + std::to_string(graph_sum_));
}
// adjust kernel
AdjustKernel(root_graph);
#if ENABLE_CPU && ENABLE_D

@ -302,6 +302,11 @@ GraphId GPUSession::CompileGraphImpl(const AnfNodePtrList &lst, const AnfNodePtr
StartKernelRT();
// Assign CUDA streams
AssignStream(graph);
// Dump .pb graph before remove nop nodes
if (save_graphs) {
DumpIRProto(graph, "before_removeNop_" + std::to_string(graph_id));
}
// Hide NopOp from execution graph
opt::HideNopNode(graph.get());
// Build kernel if node is cnode

Loading…
Cancel
Save