MCPcopy Index your code
hub / github.com/OpenMeshLab/MeshXL / synchronize_between_processes

Method synchronize_between_processes

utils/misc.py:58–69  ·  view source on GitHub ↗

Warning: does not synchronize the deque!

(self)

Source from the content-addressed store, hash-verified

56 self.total += value * n
57
58 def synchronize_between_processes(self):
59 """
60 Warning: does not synchronize the deque!
61 """
62 if not is_distributed():
63 return
64 t = torch.tensor([self.count, self.total], dtype=torch.float64, device="cuda")
65 barrier()
66 all_reduce_sum(t)
67 t = t.tolist()
68 self.count = int(t[0])
69 self.total = t[1]
70
71 @property
72 def median(self):

Callers

nothing calls this directly

Calls 3

is_distributedFunction · 0.90
barrierFunction · 0.90
all_reduce_sumFunction · 0.90

Tested by

no test coverage detected