mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
[c10d][ez] Add comments to CudaEventCache class (#134172)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134172 Approved by: https://github.com/d4l3k, https://github.com/kwen2501
This commit is contained in:
parent
b319fa3fd9
commit
e7929809f3
|
|
@ -763,6 +763,10 @@ void ProcessGroupNCCL::WorkNCCL::abort() {
|
|||
|
||||
ProcessGroupNCCL::CUDAEventCache::CUDAEventCache() {}
|
||||
|
||||
// CUDA event is used to record the start/end of one Work.
|
||||
// Instead of let the CUDA event gets destroyed, we now reuse it after the Work
|
||||
// has been erased from workMetaList_.
|
||||
// This is to avoid the potential deadlock caused by CudaEventDestroy.
|
||||
std::shared_ptr<at::cuda::CUDAEvent> ProcessGroupNCCL::CUDAEventCache::create(
|
||||
bool timing) {
|
||||
auto deleter = [this, timing](at::cuda::CUDAEvent* event) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user