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.
revert-23830-2.0-beta
Yi Liu 5 years ago committed by GitHub
parent 8473854547
commit 0471476a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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_; }

Loading…
Cancel
Save