MCPcopy Create free account
hub / github.com/NVlabs/edm / ddp_sync

Function ddp_sync

torch_utils/misc.py:169–175  ·  view source on GitHub ↗
(module, sync)

Source from the content-addressed store, hash-verified

167
168@contextlib.contextmanager
169def ddp_sync(module, sync):
170 assert isinstance(module, torch.nn.Module)
171 if sync or not isinstance(module, torch.nn.parallel.DistributedDataParallel):
172 yield
173 else:
174 with module.no_sync():
175 yield
176
177#----------------------------------------------------------------------------
178# Check DistributedDataParallel consistency across processes.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected