MCPcopy Create free account
hub / github.com/Kitware/COAT / synchronize_between_processes

Method synchronize_between_processes

utils/utils.py:43–54  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

41 self.total += value * n
42
43 def synchronize_between_processes(self):
44 """
45 Warning: does not synchronize the deque!
46 """
47 if not is_dist_avail_and_initialized():
48 return
49 t = torch.tensor([self.count, self.total], dtype=torch.float64, device="cuda")
50 dist.barrier()
51 dist.all_reduce(t)
52 t = t.tolist()
53 self.count = int(t[0])
54 self.total = t[1]
55
56 @property
57 def median(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected