设置拥抱脸部dataloader_num_workers进行多GPU培训

发布于 2025-02-06 20:12:56 字数 730 浏览 1 评论 0 原文

Huggingface变形金刚是每个GPU设置的参数吗?还是整个GPU?并且此答案是否会根据培训是否在

例如,如果我有一台具有4个GPU和48个CPU的计算机(仅运行此培训任务),设置DataLoader_Num_workers是否有任何期望值大于 12 < / code>(48/4)?还是他们都会开始争夺相同的资源?

据我了解,在DDP模式下运行(使用 torch.distributed.launch 或类似)时,一个培训过程会管理每个设备,但是在默认的DP模式下,一个领导过程可以管理所有设备。因此,也许答案是DDP的 12 ,但DP的 〜47

Should the HuggingFace transformers TrainingArguments dataloader_num_workers argument be set per GPU? Or total across GPUs? And does this answer change depending whether the training is running in DataParallel or DistributedDataParallel mode?

For example if I have a machine with 4 GPUs and 48 CPUs (running only this training task), would there be any expected value in setting dataloader_num_workers greater than 12 (48 / 4)? Or would they all start contending over the same resources?

As I understand when running in DDP mode (with torch.distributed.launch or similar), one training process manages each device, but in the default DP mode one lead process manages everything. So maybe the answer to this is 12 for DDP but ~47 for DP?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文