From 8192c0034a495012683dc0d9fbce2864eb5e283b Mon Sep 17 00:00:00 2001 From: jjfeing Date: Wed, 11 Aug 2021 12:45:04 +0800 Subject: [PATCH] DestroyHccl must be called before FreeDeviceMemory --- mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc index 24ca626ff1d..ded84d5e5e0 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc @@ -249,6 +249,8 @@ void AscendKernelRuntime::ReleaseDeviceRes() { MS_EXCEPTION_IF_NULL(context_ptr); uint32_t device_id = context_ptr->get_param(MS_CTX_DEVICE_ID); + // DestroyHccl must be called before FreeDeviceMemory + (void)DestroyHccl(); if (mem_manager_ != nullptr) { mem_manager_->FreeDeviceMemory(); } @@ -258,7 +260,6 @@ void AscendKernelRuntime::ReleaseDeviceRes() { MS_LOG(EXCEPTION) << "Reg SetTaskFailCallback failed, error: " << rt_ret; } - (void)DestroyHccl(); (void)ResetDevice(device_id); (void)ProfilingManager::GetInstance().StopProfiling(); current_graph_ = nullptr;