diff --git a/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc b/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc index b043f91a35..b0442884d4 100644 --- a/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc +++ b/mindspore/ccsrc/device/ascend/ascend_kernel_runtime.cc @@ -65,13 +65,13 @@ void AscendKernelRuntime::ClearGraphModelMap() { } void AscendKernelRuntime::ClearGraphRuntimeResource(uint32_t graph_id) { - MS_LOG(INFO) << "clear graph:" << graph_id << " runtime resource"; + MS_LOG(DEBUG) << "clear graph:" << graph_id << " runtime resource"; auto iter = graph_model_map_.find(graph_id); if (iter == graph_model_map_.end()) { - MS_LOG(WARNING) << "GraphId:" << graph_id << " not found"; + MS_LOG(DEBUG) << "GraphId:" << graph_id << " not found"; return; } - MS_LOG(INFO) << "Ge UnloadModel " << iter->first; + MS_LOG(DEBUG) << "Ge UnloadModel " << iter->first; auto ret = ge::model_runner::ModelRunner::Instance().UnloadModel(iter->first); if (!ret) { MS_LOG(ERROR) << "UnloadModel failed"; diff --git a/mindspore/ccsrc/session/kernel_graph.cc b/mindspore/ccsrc/session/kernel_graph.cc index d5c0036ed3..99d53a7f27 100644 --- a/mindspore/ccsrc/session/kernel_graph.cc +++ b/mindspore/ccsrc/session/kernel_graph.cc @@ -757,14 +757,6 @@ void KernelGraph::PrintGraphExecuteOrder() const { std::string KernelGraph::ToString() const { return std::string("kernel_graph_").append(std::to_string(graph_id_)); } -KernelGraph::~KernelGraph() { - auto context = MsContext::GetInstance(); - if (!context) { - return; - } - if (context->execution_mode() == kGraphMode) { - device::KernelRuntimeManager::Instance().ClearGraphResource(graph_id_); - } -} +KernelGraph::~KernelGraph() { device::KernelRuntimeManager::Instance().ClearGraphResource(graph_id_); } } // namespace session } // namespace mindspore