摘要: 腾讯开源人脸识别训练代码TFace 中关于all_gather层的实现如下。接下来解释为什么backward要进行reduce相加操作。 https://github.com/Tencent/TFace class AllGatherFunc(Function): """ AllGather op 阅读全文
posted @ 2021-10-02 22:08 星辰大海,绿色星球 阅读(291) 评论(0) 推荐(0) 编辑
摘要: pytorch中 all_gather 操作是不进行梯度回传的。在计算图构建中如果需要经过all_gather操作后,仍需要将梯度回传给各个进程中的allgather前的对应变量,则需要重新继承torch.autograd.Function https://pytorch.org/docs/stab 阅读全文
posted @ 2021-10-02 17:27 星辰大海,绿色星球 阅读(1095) 评论(0) 推荐(0) 编辑