forked from mindspore-Ecosystem/mindspore
!30286 [MS][RDR] Export running data after graph compiled
Merge pull request !30286 from louie5/master
This commit is contained in:
commit
a068b7da19
|
@ -27,7 +27,6 @@ void RecorderManager::UpdateRdrEnable() {
|
|||
auto &config_parser = mindspore::EnvConfigParser::GetInstance();
|
||||
rdr_enable_ = config_parser.RdrEnabled();
|
||||
rdr_mode_ = config_parser.RdrMode();
|
||||
rdr_mode_dup_ = rdr_mode_;
|
||||
if (config_parser.HasRdrSetting()) {
|
||||
#ifdef __linux__
|
||||
if (!rdr_enable_) {
|
||||
|
@ -107,22 +106,20 @@ void RecorderManager::TriggerAll() {
|
|||
if (!trigger) {
|
||||
MS_LOG(WARNING) << "There is no recorder to export.";
|
||||
} else {
|
||||
// Prevent duplicate data export by ClearResAtexit() in exceptional scenario.
|
||||
rdr_mode_ = Exceptional;
|
||||
MS_LOG(INFO) << "RDR exports all recorders.";
|
||||
if (rdr_mode_ != Normal) {
|
||||
MS_LOG(INFO) << "RDR exports all recorders in abnormal end scenario.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RecorderManager::Snapshot() {
|
||||
if (rdr_mode_ != Normal) {
|
||||
// Restore RDR mode value from early backup.
|
||||
rdr_mode_ = rdr_mode_dup_;
|
||||
if (!rdr_enable_ || rdr_mode_ != Normal) {
|
||||
return;
|
||||
}
|
||||
RecorderManager::TriggerAll();
|
||||
if (rdr_enable_) {
|
||||
MS_LOG(INFO) << "RDR exports all recorders in normal end scenario.";
|
||||
}
|
||||
// Prevent duplicate data export by ClearResAtexit() in exceptional scenario.
|
||||
ClearAll();
|
||||
}
|
||||
|
||||
void RecorderManager::ClearAll() {
|
||||
|
|
|
@ -78,7 +78,6 @@ class RecorderManager {
|
|||
|
||||
bool rdr_enable_{false};
|
||||
int rdr_mode_{Exceptional};
|
||||
int rdr_mode_dup_{Exceptional};
|
||||
bool rdr_has_record_mem_{false};
|
||||
|
||||
mutable std::mutex mtx_;
|
||||
|
|
|
@ -826,7 +826,9 @@ bool GraphExecutorPy::CompileInner(const py::object &source_obj, const py::tuple
|
|||
|
||||
// Save the compiled graph to MsPipeLine.
|
||||
SaveCompiledGraph(phase);
|
||||
|
||||
#ifdef ENABLE_DUMP_IR
|
||||
(void)mindspore::RDR::Snapshot();
|
||||
#endif
|
||||
opt::python_pass::PyPassManager::GetInstance()->ClearPipelineRes();
|
||||
abstract::AnalysisContext::ClearContext();
|
||||
// Reclaim all resource used by optimizer.
|
||||
|
|
Loading…
Reference in New Issue