MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / synchronize_between_processes

Method synchronize_between_processes

utils.py:222–233  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

220 self.total += value * n
221
222 def synchronize_between_processes(self):
223 """
224 Warning: does not synchronize the deque!
225 """
226 if not is_dist_avail_and_initialized():
227 return
228 t = torch.tensor([self.count, self.total], dtype=torch.float64, device='cuda')
229 dist.barrier()
230 dist.all_reduce(t)
231 t = t.tolist()
232 self.count = int(t[0])
233 self.total = t[1]
234
235 @property
236 def median(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected