DestroyHccl must be called before FreeDeviceMemory

This commit is contained in:
jjfeing 2021-08-11 12:45:04 +08:00
parent fb2b4f0617
commit 8192c0034a
1 changed files with 2 additions and 1 deletions

View File

@ -249,6 +249,8 @@ void AscendKernelRuntime::ReleaseDeviceRes() {
MS_EXCEPTION_IF_NULL(context_ptr);
uint32_t device_id = context_ptr->get_param<uint32_t>(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;