Merge pull request !4842 from laiyongqiang/reset_iter_numtags/v0.7.0-beta
| @@ -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(); | ||||
| @@ -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() { | ||||
| @@ -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 | ||||
| @@ -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: | ||||