MCPcopy Create free account
hub / github.com/csuhan/OneLLM / synchronize_between_processes

Method synchronize_between_processes

util/misc.py:57–68  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

55 self.total += value * n
56
57 def synchronize_between_processes(self):
58 """
59 Warning: does not synchronize the deque!
60 """
61 if not is_dist_avail_and_initialized():
62 return
63 t = torch.tensor([self.count, self.total], dtype=torch.float64, device='cuda')
64 dist.barrier()
65 dist.all_reduce(t)
66 t = t.tolist()
67 self.count = int(t[0])
68 self.total = t[1]
69
70 @property
71 def median(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected