move dynamic shape mark before backend common optimization

format
pull/8460/head
hwjiaorui 4 years ago
parent d760cee90f
commit c1a57c83b5

@ -121,9 +121,6 @@ GraphId AscendSession::CompileGraphImpl(const AnfNodePtrList &lst, const AnfNode
MS_LOG(INFO) << "Start";
// construct graph, if successfully, graph_sum_ + 1
auto graph = ConstructKernelGraph(lst, outputs);
// Update Graph Dynamic Shape Attr
UpdateGraphDynamicShapeAttr(NOT_NULL(graph));
graph->UpdateGraphDynamicAttr();
auto graph_id = graph->graph_id();
MS_LOG(INFO) << "Compile graph " << graph_id << " success";
return graph_id;

@ -851,6 +851,10 @@ KernelGraphPtr SessionBasic::ConstructKernelGraph(const AnfNodePtrList &lst, con
if (ExistSummaryNode(graph.get())) {
graph->set_summary_node_exist(true);
}
// Update Graph Dynamic Shape Attr
UpdateGraphDynamicShapeAttr(NOT_NULL(graph));
opt::BackendCommonOptimization(graph);
graph->SetInputNodes();
graph->SetOptimizerFlag();
@ -1493,6 +1497,7 @@ void SessionBasic::UpdateGraphDynamicShapeAttr(const NotNull<KernelGraphPtr> &ro
MS_LOG(INFO) << "Set Input Dynamic Shape Attr to Node:" << cnode->fullname_with_scope();
}
}
root_graph->UpdateGraphDynamicAttr();
}
#if (ENABLE_CPU && (ENABLE_D || ENABLE_GPU))

@ -376,8 +376,7 @@ bool AscendKernelRuntime::GenTask(const session::KernelGraph *graph) {
InnerSetContext();
if (graph->is_dynamic_shape()) {
if (ConfigManager::GetInstance().dataset_mode() == DS_SINK_MODE) {
MS_LOG(EXCEPTION)
<< "Dynamic shape is not supported with dataset_sink_mode=True. Please set dataset_sink_mode=False";
MS_LOG(EXCEPTION) << "Dynamic shape is not supported with sink mode.";
}
if (DumpJsonParser::GetInstance().async_dump_enabled()) {
MS_LOG(EXCEPTION) << "Dynamic shape is not supported with asyn dump. Please use other debugging methods.";

Loading…
Cancel
Save