forked from huawei/mindspore2022
!12893 [MS][RDR] Add FuncGraph Clone Switch
From: @louie5 Reviewed-by: @zh_qh,@ouwenchang Signed-off-by:
This commit is contained in:
commit
a744a5ea9e
|
|
@ -64,6 +64,7 @@
|
|||
#endif
|
||||
#ifdef ENABLE_DUMP_IR
|
||||
#include "debug/rdr/running_data_recorder.h"
|
||||
#include "debug/rdr/recorder_manager.h"
|
||||
#endif
|
||||
|
||||
namespace mindspore {
|
||||
|
|
@ -723,19 +724,21 @@ void Pipeline::Run() {
|
|||
MS_LOG(EXCEPTION) << "Pipeline running to end, failed in step:" << action.first;
|
||||
}
|
||||
#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 {
|
||||
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
|
||||
if (MsContext::GetInstance()->get_param<bool>(MS_CTX_SAVE_GRAPHS_FLAG) && resource_->func_graph() != nullptr) {
|
||||
auto graph = resource_->func_graph();
|
||||
|
|
|
|||
Loading…
Reference in New Issue