MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / sync_epoch

Method sync_epoch

utils/dataset.py:1393–1400  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1391 # to know the epoch, so we synchronize the epoch so the processes that don't use the dataloader
1392 # know the current epoch.
1393 def sync_epoch(self):
1394 process_group = dist.get_world_group()
1395 result = [None] * dist.get_world_size(process_group)
1396 torch.distributed.all_gather_object(result, self.epoch, group=process_group)
1397 max_epoch = -1
1398 for epoch in result:
1399 max_epoch = max(epoch, max_epoch)
1400 self.epoch = max_epoch
1401
1402 def state_dict(self):
1403 return {

Callers 2

evaluate_singleFunction · 0.80
train.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected