Browse Source

!4842 reset iter num

Merge pull request !4842 from laiyongqiang/reset_iter_num
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
2512f70988
4 changed files with 11 additions and 0 deletions
  1. +4
    -0
      mindspore/ccsrc/pipeline/jit/pipeline.cc
  2. +3
    -0
      mindspore/ccsrc/pipeline/pynative/pynative_execute.cc
  3. +2
    -0
      mindspore/ccsrc/utils/config_manager.cc
  4. +2
    -0
      mindspore/ccsrc/utils/config_manager.h

+ 4
- 0
mindspore/ccsrc/pipeline/jit/pipeline.cc View File

@@ -257,6 +257,8 @@ py::dict ExecutorPy::GetAllreduceFusion(const std::string &phase) {
void ExecutorPy::DelNetRes(const std::string &id) { void ExecutorPy::DelNetRes(const std::string &id) {
#ifdef ENABLE_GE #ifdef ENABLE_GE
FinalizeBackend(); FinalizeBackend();
#else
ConfigManager::GetInstance().ResetIterNum();
#endif #endif
if (executor_ != nullptr) { if (executor_ != nullptr) {
bool flag = false; bool flag = false;
@@ -1043,6 +1045,8 @@ void ClearResAtexit() {
#ifdef ENABLE_GE #ifdef ENABLE_GE
transform::DfGraphManager::GetInstance().ClearGraph(); transform::DfGraphManager::GetInstance().ClearGraph();
transform::OpAdapterMap::get().clear(); transform::OpAdapterMap::get().clear();
#else
ConfigManager::GetInstance().ResetIterNum();
#endif #endif
ReleaseGeTsd(); ReleaseGeTsd();
parse::python_adapter::ResetPythonScope(); parse::python_adapter::ResetPythonScope();


+ 3
- 0
mindspore/ccsrc/pipeline/pynative/pynative_execute.cc View File

@@ -29,6 +29,7 @@
#include "utils/utils.h" #include "utils/utils.h"
#include "utils/ms_context.h" #include "utils/ms_context.h"
#include "utils/context/context_extends.h" #include "utils/context/context_extends.h"
#include "utils/config_manager.h"
#include "frontend/operator/ops.h" #include "frontend/operator/ops.h"
#include "frontend/operator/composite/composite.h" #include "frontend/operator/composite/composite.h"
#include "frontend/operator/composite/do_signature.h" #include "frontend/operator/composite/do_signature.h"
@@ -1260,6 +1261,7 @@ void PynativeExecutor::Clear(const std::string &flag) {
if (ms_context != nullptr) { if (ms_context != nullptr) {
ms_context->set_enable_pynative_infer(false); ms_context->set_enable_pynative_infer(false);
} }
ConfigManager::GetInstance().ResetIterNum();
return; return;
} }


@@ -1272,6 +1274,7 @@ void PynativeExecutor::Clear(const std::string &flag) {
op_id_map_.clear(); op_id_map_.clear();
// node_abs_map_.clear(); // node_abs_map_.clear();
std::stack<FuncGraphPtr>().swap(graph_p_); std::stack<FuncGraphPtr>().swap(graph_p_);
ConfigManager::GetInstance().ResetIterNum();
} }


void PynativeExecutor::Clean() { void PynativeExecutor::Clean() {


+ 2
- 0
mindspore/ccsrc/utils/config_manager.cc View File

@@ -43,4 +43,6 @@ void ConfigManager::ResetConfig() noexcept {
iter_num_ = 1; iter_num_ = 1;
} }


void ConfigManager::ResetIterNum() noexcept { iter_num_ = 1; }

} // namespace mindspore } // namespace mindspore

+ 2
- 0
mindspore/ccsrc/utils/config_manager.h View File

@@ -102,6 +102,8 @@ class ConfigManager {


void ResetConfig() noexcept; void ResetConfig() noexcept;


void ResetIterNum() noexcept;

std::map<std::string, std::string> ge_initialize_options_; std::map<std::string, std::string> ge_initialize_options_;


private: private:


Loading…
Cancel
Save