!20537 clear thread resource after ps

Merge pull request !20537 from kisnwang/first-clear-thread-resource
This commit is contained in:
i-robot 2021-07-20 11:05:15 +00:00 committed by Gitee
commit 31a4c3116e
1 changed files with 4 additions and 4 deletions

View File

@ -1285,10 +1285,6 @@ void FinalizeBackend() {
void ClearResAtexit() {
MS_LOG(DEBUG) << "Pipeline clear all resource";
session::ExecutorManager::Instance().Clear();
device::KernelRuntimeManager::Instance().ClearRuntimeResource();
runtime::GraphScheduler::GetInstance().Clear();
device::DeviceContextManager::GetInstance().ClearDeviceContexts();
#if ((defined ENABLE_CPU) && (!defined _WIN32))
if (ps::PSContext::instance()->is_ps_mode() && ps::PSContext::instance()->is_worker()) {
if (ps::PsDataPrefetch::GetInstance().cache_enable()) {
@ -1303,6 +1299,10 @@ void ClearResAtexit() {
}
}
#endif
session::ExecutorManager::Instance().Clear();
device::KernelRuntimeManager::Instance().ClearRuntimeResource();
runtime::GraphScheduler::GetInstance().Clear();
device::DeviceContextManager::GetInstance().ClearDeviceContexts();
ad::g_k_prims.clear();
ad::ClearKPynativeCellStaticRes();
PrimBpropOptimizer::GetPrimBpropOptimizerInst().Clear();