【PyTorch distributed】多卡训练原理简析与RuntimeError: Expected to mark a variable ready only once.报错分析
引言单机多卡使用torch.distributed训练模型时碰上了报错,于是趁机研究了一下这个torch.distributed的使用逻辑。报错信息如下展示,本文仅记录报错信息,复现报错,并简单讨论其背后的成因,为此也要简要的讨论torch.distributed是如何完成多卡训练的操作。如果对你有帮助,点赞让我知道!嘿嘿报错信息RuntimeError:Expectedtomarkavariab