forked from mindspore-Ecosystem/mindspore
!21652 fix bugs: DestroyHccl must be called before FreeDeviceMemory
Merge pull request !21652 from jjfeing/r1.4
This commit is contained in:
commit
6efa88c486
|
@ -249,6 +249,8 @@ void AscendKernelRuntime::ReleaseDeviceRes() {
|
||||||
MS_EXCEPTION_IF_NULL(context_ptr);
|
MS_EXCEPTION_IF_NULL(context_ptr);
|
||||||
uint32_t device_id = context_ptr->get_param<uint32_t>(MS_CTX_DEVICE_ID);
|
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) {
|
if (mem_manager_ != nullptr) {
|
||||||
mem_manager_->FreeDeviceMemory();
|
mem_manager_->FreeDeviceMemory();
|
||||||
}
|
}
|
||||||
|
@ -258,7 +260,6 @@ void AscendKernelRuntime::ReleaseDeviceRes() {
|
||||||
MS_LOG(EXCEPTION) << "Reg SetTaskFailCallback failed, error: " << rt_ret;
|
MS_LOG(EXCEPTION) << "Reg SetTaskFailCallback failed, error: " << rt_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)DestroyHccl();
|
|
||||||
(void)ResetDevice(device_id);
|
(void)ResetDevice(device_id);
|
||||||
(void)ProfilingManager::GetInstance().StopProfiling();
|
(void)ProfilingManager::GetInstance().StopProfiling();
|
||||||
current_graph_ = nullptr;
|
current_graph_ = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue