scaffold.torch.distributed.ddp
Functions
|
Tests distributed setup with a manual calculation. |
|
Returns true if job is distributed. |
|
Checks for a tensor if it is the same across all workers. |
|
Converts a torch model into a distributed data parallel model. |
|
Returns true if job should be distributed. |
Module Contents
- scaffold.torch.distributed.ddp.check_distributed_setup() bool
Tests distributed setup with a manual calculation.
- scaffold.torch.distributed.ddp.is_distributed() bool
Returns true if job is distributed.
- scaffold.torch.distributed.ddp.is_same_accross_workers(local_tensor: torch.Tensor) bool
Checks for a tensor if it is the same across all workers. Needs to be able to execute on all nodes, since we call all_gather. Otherwise this leads to deadlocks.
- scaffold.torch.distributed.ddp.model_to_ddp(model: torch.nn.Module) torch.nn.parallel.DistributedDataParallel
Converts a torch model into a distributed data parallel model.
- scaffold.torch.distributed.ddp.should_distribute() bool
Returns true if job should be distributed.