forked from mindspore-Ecosystem/mindspore
!4842 reset iter num
Merge pull request !4842 from laiyongqiang/reset_iter_num
This commit is contained in:
commit
2512f70988
|
@ -257,6 +257,8 @@ py::dict ExecutorPy::GetAllreduceFusion(const std::string &phase) {
|
|||
void ExecutorPy::DelNetRes(const std::string &id) {
|
||||
#ifdef ENABLE_GE
|
||||
FinalizeBackend();
|
||||
#else
|
||||
ConfigManager::GetInstance().ResetIterNum();
|
||||
#endif
|
||||
if (executor_ != nullptr) {
|
||||
bool flag = false;
|
||||
|
@ -1043,6 +1045,8 @@ void ClearResAtexit() {
|
|||
#ifdef ENABLE_GE
|
||||
transform::DfGraphManager::GetInstance().ClearGraph();
|
||||
transform::OpAdapterMap::get().clear();
|
||||
#else
|
||||
ConfigManager::GetInstance().ResetIterNum();
|
||||
#endif
|
||||
ReleaseGeTsd();
|
||||
parse::python_adapter::ResetPythonScope();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "utils/utils.h"
|
||||
#include "utils/ms_context.h"
|
||||
#include "utils/context/context_extends.h"
|
||||
#include "utils/config_manager.h"
|
||||
#include "frontend/operator/ops.h"
|
||||
#include "frontend/operator/composite/composite.h"
|
||||
#include "frontend/operator/composite/do_signature.h"
|
||||
|
@ -1260,6 +1261,7 @@ void PynativeExecutor::Clear(const std::string &flag) {
|
|||
if (ms_context != nullptr) {
|
||||
ms_context->set_enable_pynative_infer(false);
|
||||
}
|
||||
ConfigManager::GetInstance().ResetIterNum();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1272,6 +1274,7 @@ void PynativeExecutor::Clear(const std::string &flag) {
|
|||
op_id_map_.clear();
|
||||
// node_abs_map_.clear();
|
||||
std::stack<FuncGraphPtr>().swap(graph_p_);
|
||||
ConfigManager::GetInstance().ResetIterNum();
|
||||
}
|
||||
|
||||
void PynativeExecutor::Clean() {
|
||||
|
|
|
@ -43,4 +43,6 @@ void ConfigManager::ResetConfig() noexcept {
|
|||
iter_num_ = 1;
|
||||
}
|
||||
|
||||
void ConfigManager::ResetIterNum() noexcept { iter_num_ = 1; }
|
||||
|
||||
} // namespace mindspore
|
||||
|
|
|
@ -102,6 +102,8 @@ class ConfigManager {
|
|||
|
||||
void ResetConfig() noexcept;
|
||||
|
||||
void ResetIterNum() noexcept;
|
||||
|
||||
std::map<std::string, std::string> ge_initialize_options_;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue