From: @hwjiaorui Reviewed-by: @jjfeing,@kisnwang Signed-off-by: @jjfeingtags/v1.1.0
| @@ -121,9 +121,6 @@ GraphId AscendSession::CompileGraphImpl(const AnfNodePtrList &lst, const AnfNode | |||||
| MS_LOG(INFO) << "Start"; | MS_LOG(INFO) << "Start"; | ||||
| // construct graph, if successfully, graph_sum_ + 1 | // construct graph, if successfully, graph_sum_ + 1 | ||||
| auto graph = ConstructKernelGraph(lst, outputs); | auto graph = ConstructKernelGraph(lst, outputs); | ||||
| // Update Graph Dynamic Shape Attr | |||||
| UpdateGraphDynamicShapeAttr(NOT_NULL(graph)); | |||||
| graph->UpdateGraphDynamicAttr(); | |||||
| auto graph_id = graph->graph_id(); | auto graph_id = graph->graph_id(); | ||||
| MS_LOG(INFO) << "Compile graph " << graph_id << " success"; | MS_LOG(INFO) << "Compile graph " << graph_id << " success"; | ||||
| return graph_id; | return graph_id; | ||||
| @@ -851,6 +851,10 @@ KernelGraphPtr SessionBasic::ConstructKernelGraph(const AnfNodePtrList &lst, con | |||||
| if (ExistSummaryNode(graph.get())) { | if (ExistSummaryNode(graph.get())) { | ||||
| graph->set_summary_node_exist(true); | graph->set_summary_node_exist(true); | ||||
| } | } | ||||
| // Update Graph Dynamic Shape Attr | |||||
| UpdateGraphDynamicShapeAttr(NOT_NULL(graph)); | |||||
| opt::BackendCommonOptimization(graph); | opt::BackendCommonOptimization(graph); | ||||
| graph->SetInputNodes(); | graph->SetInputNodes(); | ||||
| graph->SetOptimizerFlag(); | 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(); | MS_LOG(INFO) << "Set Input Dynamic Shape Attr to Node:" << cnode->fullname_with_scope(); | ||||
| } | } | ||||
| } | } | ||||
| root_graph->UpdateGraphDynamicAttr(); | |||||
| } | } | ||||
| #if (ENABLE_CPU && (ENABLE_D || ENABLE_GPU)) | #if (ENABLE_CPU && (ENABLE_D || ENABLE_GPU)) | ||||
| @@ -376,8 +376,7 @@ bool AscendKernelRuntime::GenTask(const session::KernelGraph *graph) { | |||||
| InnerSetContext(); | InnerSetContext(); | ||||
| if (graph->is_dynamic_shape()) { | if (graph->is_dynamic_shape()) { | ||||
| if (ConfigManager::GetInstance().dataset_mode() == DS_SINK_MODE) { | 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()) { | if (DumpJsonParser::GetInstance().async_dump_enabled()) { | ||||
| MS_LOG(EXCEPTION) << "Dynamic shape is not supported with asyn dump. Please use other debugging methods."; | MS_LOG(EXCEPTION) << "Dynamic shape is not supported with asyn dump. Please use other debugging methods."; | ||||