如何将FairSeq Interactive与多个GPU使用?

发布于 2025-02-13 10:38:03 字数 157 浏览 1 评论 0原文

我正在尝试为模型生成新的预测,但是我发现使用FairSeq并不是直观的。我发现FairSeq-Interactive可以帮助生成良好的batch_size设置,但是,似乎一次将使用1 GPU,我想知道是否可以使用多个GPU?希望有人可以帮忙!

非常感谢:)

I am trying to generate new prediction for the model, but I found it is not that intuitive to use fairseq. I found fairseq-interactive could help to generate with a good settings of batch_size, however, it seems that it will use 1 GPU at a time, I wonder if it is possible to use multiple GPU? Hope someone can kindly help!

Many thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一世旳自豪 2025-02-20 10:38:03

您不能在Fairseq中本地进行此操作。最好的方法是将您的数据分片并在后台的每个碎片上运行FairSeq Interactive。确保为每个碎片设置cuda_visible_devices,以便将每个碎片的生成放在其他GPU上。该建议还适用于FairSeq-Generate(对于大型推理工作而言,这将更快)。

You cannot do this natively within fairseq. The best way to do this is to shard your data and run fairseq-interactive on each shard in the background. Be sure to set CUDA_VISIBLE_DEVICES for each shard so you put each shard's generation on a different GPU. This advice also applies to fairseq-generate (which will be significantly faster for large inference jobs).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文