10 2021 档案

摘要:这里简要总结一下,人脸大规模分类的实现过程 (1)拆分分类权重:分类权重$W\in R^{n\times d}$拆分为K份,每个gpu存储其中一份分类权重 (2)求logit值:每个gpu上的特征feature,及其label,经过allgather操作汇聚并广播到每个GPU上,然后和当前gpu上的 阅读全文
posted @ 2021-10-05 09:22 星辰大海,绿色星球 阅读(94) 评论(0) 推荐(0)
摘要:腾讯开源人脸识别训练代码TFace 中关于all_gather层的实现如下。接下来解释为什么backward要进行reduce相加操作。 https://github.com/Tencent/TFace class AllGatherFunc(Function): """ AllGather op 阅读全文
posted @ 2021-10-02 22:08 星辰大海,绿色星球 阅读(390) 评论(0) 推荐(0)
摘要:pytorch中 all_gather 操作是不进行梯度回传的。在计算图构建中如果需要经过all_gather操作后,仍需要将梯度回传给各个进程中的allgather前的对应变量,则需要重新继承torch.autograd.Function https://pytorch.org/docs/stab 阅读全文
posted @ 2021-10-02 17:27 星辰大海,绿色星球 阅读(1374) 评论(0) 推荐(0)