MCPcopy Create free account
hub / github.com/coperception/star / synchronize_between_processes

Method synchronize_between_processes

star/utils/misc.py:42–53  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected