API Reference#
torchfoo#
Seed all random number generators for reproducibility. |
|
Return the current device. |
torchfoo.distributed#
Check if distributed mode is initialized |
|
Get number of distributed processes |
|
Get rank of the current distributed process |
|
Decorator that ensures a function only executes on rank 0. |
|
Initialize a distributed process group. |
|
Destroy the distributed process group if one is initialized. |
|
Decorator that parallelizes a function across multiple devices with distributed setup. |
|
Perform an in-place differentiable "all reduce" operation |
|
Perform an in-place differentiable "all reduce sum" operation |
|
Check if x is the same on all GPUs |
|
Concatenate a Tensor with varying dim 0 from multiple GPUs |
|
Concatenate a Tensor distributed on multiple GPUs. |
torchfoo.ddp#
Wrap a module with DDP and convert BatchNorm to SyncBatchNorm. |