(self)
| 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 { |
no outgoing calls
no test coverage detected