Browse Source

!11857 Add RDR module compile switch

From: @louie5
Reviewed-by: @ouwenchang
Signed-off-by:
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
f0dd5563ea
4 changed files with 24 additions and 6 deletions
  1. +2
    -0
      mindspore/ccsrc/backend/optimizer/somas/somas.cc
  2. +10
    -5
      mindspore/ccsrc/debug/CMakeLists.txt
  3. +10
    -1
      mindspore/ccsrc/debug/rdr/graph_recorder.cc
  4. +2
    -0
      mindspore/ccsrc/runtime/device/memory_manager.cc

+ 2
- 0
mindspore/ccsrc/backend/optimizer/somas/somas.cc View File

@@ -34,7 +34,9 @@
#include "backend/optimizer/common/helper.h"
#include "utils/ms_context.h"
#include "debug/common.h"
#ifdef ENABLE_DUMP_IR
#include "debug/rdr/running_data_recorder.h"
#endif
#include "common/thread_pool.h"
#include "profiler/device/common/memory_profiling.h"



+ 10
- 5
mindspore/ccsrc/debug/CMakeLists.txt View File

@@ -6,13 +6,18 @@ set(_DEBUG_SRC_LIST
"${CMAKE_CURRENT_SOURCE_DIR}/trace.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/common.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/env_config_parser.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/graph_exec_order_recorder.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/graph_recorder.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/string_recorder.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/recorder_manager.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/running_data_recorder.cc"
)

if(ENABLE_DUMP_IR)
list(APPEND _DEBUG_SRC_LIST
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/graph_exec_order_recorder.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/graph_recorder.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/string_recorder.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/recorder_manager.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/rdr/running_data_recorder.cc"
)
endif()

if(ENABLE_DEBUGGER)
list(APPEND _DEBUG_SRC_LIST
"${CMAKE_CURRENT_SOURCE_DIR}/debugger/debugger.cc"


+ 10
- 1
mindspore/ccsrc/debug/rdr/graph_recorder.cc View File

@@ -78,8 +78,17 @@ void DumpIRProto(const FuncGraphPtr &, const std::string &) {
void GraphRecorder::Export() {
bool save_flag = false;
if (filename_.empty()) {
filename_ = directory_ + module_ + "_" + tag_ + "_" + timestamp_;
filename_ = module_ + "_" + tag_ + "_" + timestamp_;
}
if (filename_.length() > 255) { // 255: filename maximum length
filename_ = filename_.substr(0, 255);
}
filename_ = directory_ + filename_;
if (filename_.size() + 3 > PATH_MAX) { // 3: file format length
MS_LOG(ERROR) << "File path " << filename_ << " is too long.";
return;
}

if (graph_type_.find(".dat") != std::string::npos) {
save_flag = true;
AnfExporter exporter(std::to_string(id_));


+ 2
- 0
mindspore/ccsrc/runtime/device/memory_manager.cc View File

@@ -17,7 +17,9 @@
#include "runtime/device/memory_manager.h"
#include <string>
#include "backend/session/anf_runtime_algorithm.h"
#ifdef ENABLE_DUMP_IR
#include "debug/rdr/running_data_recorder.h"
#endif
#include "utils/ms_context.h"

using mindspore::memreuse::BestFitMemReuse;


Loading…
Cancel
Save