【wandb bug 记录与解决】Filenotfounderror: error [2] no such file or directory: ‘/tmp/tmpde8ivzj0/por…
问题描述
在分布式训练使用 accelerate、deepspeed、以及 wandb 时,出现了一下报错
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpoztlkl_k/port-54xxx0.txtxxxxh9’
再仔细往上溯源,发现真正的错误其实是在
[rank0]: wandb.sdk.service.service.ServiceStartTimeoutError: Timed out waiting for wandb service to start after 30.0 seconds. Try increasing the timeout with the _service_wait setting.
说明问题应该就是 deepspeed 和 wandb 之间的网络通信出现了一定的问题,或者就是网速比较慢,需要更长的等待时间。
解决方案
由于本文的情况是在 accelerator 直接 log_with 中登录的 wandb,如下所示
accelerator = Accelerator(
gradient_accumulation_steps=args.gradient_accumulation_steps,
mixed_precision=args.mixed_precision,
log_with=args.report_to, # wandb
project_config=accelerator_project_config,
)
因此,只需在命令行中尝试增加等待时间即可。
export WANDB__SERVICE_WAIT=60 # 将等待时间设置为 60 秒
在 python 主程序中设置 wandb 的可以参考官方论坛中的方法: https://community.wandb.ai/t/how-to-increase-service-wait/5418

2639

被折叠的 条评论
为什么被折叠?



