MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / synchronize_between_processes

Method synchronize_between_processes

util/misc.py:67–80  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

65 self.total += value * n
66
67 def synchronize_between_processes(self):
68 """
69 Warning: does not synchronize the deque!
70 """
71 if not is_dist_avail_and_initialized():
72 return
73 t = torch.tensor([self.count, self.total],
74 dtype=torch.float64,
75 device='cuda')
76 dist.barrier()
77 dist.all_reduce(t)
78 t = t.tolist()
79 self.count = int(t[0])
80 self.total = t[1]
81
82 @property
83 def median(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected