分布式训练的流程,参考这个github:https://github.com/tczhangzhi/pytorch-distributed。
例如在对Swin Transformer进行分布式训练的时候,使用CUDA_VISIBLE_DEVICES来控制使用的GPU。
复现方法见:
源码 https://github.com/microsoft/Swin-Transformer/blob/main/get_started.md
https://www.jianshu.com/p/d50c1855e583
服务器安装APEX的问题
CUDA_VISIBLE_DEVICES=1 python -m torch.distributed