-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
提高负样本的方法 #28
Comments
目前我能想到最简单直接的方法就是使用 FSDP,把模型的权重,优化器和梯度的状态分配给不同的机器,从而增加 batch_size。 稍微复杂一点的就是把最终的结果汇聚到一张卡上,计算 loss 后再广播给所有的节点,但我没写过这部分的代码,所以不确定容不容易实现,理论上应该挺容易的。 |
我写了个简单的实现,在我自己的机器上能够跑,后面我也看看这样做的效果。
初始化EmbedderForPairAllNegTrain时候传入一下accelerator就可以了 |
microsoft/unilm#1120 (comment) |
1. 关于如何增加 batch_size?
你现在做的方向其实也是 m3e 想要优化的方向,如果有任何进展,欢迎交流~ |
突然想起来,简单地update下: |
收到 |
目前负样本的数量还是受限于单卡的显存,即最多为batch size per gpu。
是否有这种操作:把GPU2的样本作为GPU1样本的负样本呢?
The text was updated successfully, but these errors were encountered: