| 84 | } |
| 85 | |
| 86 | void cleanup() |
| 87 | { |
| 88 | reset(); |
| 89 | if (reduce_buckets) { |
| 90 | reduce_buckets->clear(); |
| 91 | reduce_buckets.reset(); |
| 92 | } |
| 93 | param_registry.reset(); |
| 94 | |
| 95 | if (nccl_comm_initialized) { |
| 96 | ncclCommDestroy(nccl_comm); |
| 97 | nccl_comm = nullptr; |
| 98 | nccl_comm_initialized = false; |
| 99 | } |
| 100 | process_group = nullptr; |
| 101 | symm_mem = nullptr; |
| 102 | profile = false; |
| 103 | } |
| 104 | |
| 105 | at::Tensor reduce_grad(at::Tensor grad_tensor, long graph_id, long ds_id) |
| 106 | { |