| @@ -64,6 +64,7 @@ | |||||
| #endif | #endif | ||||
| #ifdef ENABLE_DUMP_IR | #ifdef ENABLE_DUMP_IR | ||||
| #include "debug/rdr/running_data_recorder.h" | #include "debug/rdr/running_data_recorder.h" | ||||
| #include "debug/rdr/recorder_manager.h" | |||||
| #endif | #endif | ||||
| namespace mindspore { | namespace mindspore { | ||||
| @@ -723,19 +724,21 @@ void Pipeline::Run() { | |||||
| MS_LOG(EXCEPTION) << "Pipeline running to end, failed in step:" << action.first; | MS_LOG(EXCEPTION) << "Pipeline running to end, failed in step:" << action.first; | ||||
| } | } | ||||
| #ifdef ENABLE_DUMP_IR | #ifdef ENABLE_DUMP_IR | ||||
| MS_LOG(INFO) << "Clone func_graph."; | |||||
| std::string tag = GetBaseNameForIR(i, action.first); | |||||
| if (resource_->func_graph() != nullptr) { | |||||
| auto graph_clone = BasicClone(resource_->func_graph()); | |||||
| if (graph_clone != nullptr) { | |||||
| mindspore::RDR::RecordAnfGraph(SUBMODULE_ID, tag, graph_clone, false, ".ir"); | |||||
| if (mindspore::RecorderManager::Instance().RdrEnable()) { | |||||
| MS_LOG(INFO) << "Recording FuncGraph in pipeline using RDR."; | |||||
| std::string tag = GetBaseNameForIR(i, action.first); | |||||
| if (resource_->func_graph() != nullptr) { | |||||
| auto graph_clone = BasicClone(resource_->func_graph()); | |||||
| if (graph_clone != nullptr) { | |||||
| mindspore::RDR::RecordAnfGraph(SUBMODULE_ID, tag, graph_clone, false, ".ir"); | |||||
| } else { | |||||
| MS_LOG(WARNING) << "Clone FuncGraph failed in pipeline, no FuncGraph recording in RDR."; | |||||
| } | |||||
| } else { | } else { | ||||
| MS_LOG(WARNING) << "Clone func_graph failed in pipeline, no func_graph recording in RDR."; | |||||
| MS_LOG(WARNING) << "Pipeline Resource has no FuncGraph, no FuncGraph recording in RDR"; | |||||
| } | } | ||||
| } else { | |||||
| MS_LOG(WARNING) << "Resource's func_graph is empty in pipeline, no func_graph recording in RDR"; | |||||
| MS_LOG(INFO) << "Recording FuncGraph in pipeline end."; | |||||
| } | } | ||||
| MS_LOG(INFO) << "Clone func_graph end."; | |||||
| #endif | #endif | ||||
| if (MsContext::GetInstance()->get_param<bool>(MS_CTX_SAVE_GRAPHS_FLAG) && resource_->func_graph() != nullptr) { | if (MsContext::GetInstance()->get_param<bool>(MS_CTX_SAVE_GRAPHS_FLAG) && resource_->func_graph() != nullptr) { | ||||
| auto graph = resource_->func_graph(); | auto graph = resource_->func_graph(); | ||||