MCPcopy Create free account
hub / github.com/bic-L/MaxFormer / synchronize_between_processes

Method synchronize_between_processes

event/utils.py:29–40  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

27 self.total += value * n
28
29 def synchronize_between_processes(self):
30 """
31 Warning: does not synchronize the deque!
32 """
33 if not is_dist_avail_and_initialized():
34 return
35 t = torch.tensor([self.count, self.total], dtype=torch.float64, device='cuda')
36 dist.barrier()
37 dist.all_reduce(t)
38 t = t.tolist()
39 self.count = int(t[0])
40 self.total = t[1]
41
42 @property
43 def median(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected