trunk/a7f3aeed6fe187b385c48f0708ebe1ebac80e30b: [c10d] Make NCCL2 Work teardown lifetime-safe (#195485)
- PyTorch: 339 events in the last 90 days
- PyTorch: 336th Release in the last 90 days
- Previous: earlier the same day · ciflow/inductor/195410: Update
What happened
WorkNCCL event bundles returned CUDA events through a raw ProcessGroupNCCL pointer. Caller-owned async Work can remain alive after destroy_process_group drains and destroys the backend, so later Work destruction dereferenced freed memory and caused heap corruption or a hang. Move event-cache state into a separately owned object. Work event bundles keep a weak cache reference and return events only while the cache re…
Summary assembled by rule from the sources below