未验证 提交 0471476a 编写于 作者: Y Yi Liu 提交者: GitHub

fix nccl comm double free bug (#23344)

As nccl comm is not created by CUDADeviceContext, it should be destroyed by the creator as the best practice of RAII.
上级 84738545
......@@ -287,11 +287,6 @@ CUDADeviceContext::~CUDADeviceContext() {
SetDeviceId(place_.device);
Wait();
WaitStreamCallback();
#if defined(PADDLE_WITH_NCCL)
if (nccl_comm_) {
PADDLE_ENFORCE_CUDA_SUCCESS(dynload::ncclCommDestroy(nccl_comm_));
}
#endif
}
Place CUDADeviceContext::GetPlace() const { return place_; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册