Browse Source

Save graph before remove nop nodes

tags/v1.1.0
wangyue01 5 years ago
parent
commit
0c16b866fe
2 changed files with 13 additions and 0 deletions
  1. +8
    -0
      mindspore/ccsrc/backend/session/ascend_session.cc
  2. +5
    -0
      mindspore/ccsrc/backend/session/gpu_session.cc

+ 8
- 0
mindspore/ccsrc/backend/session/ascend_session.cc View File

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


+ 5
- 0
mindspore/ccsrc/backend/session/gpu_session.cc View File

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