torch.distributed.elastic.multiprocessing.errors.ChildFailedError

问题

Traceback (most recent call last):
  File "/ssd1/miniconda3/envs/pytorch2.1.2/bin/torchrun", line 33, in <module>
    sys.exit(load_entry_point('torch==2.1.2', 'console_scripts', 'torchrun')())
  File "/ssd1/miniconda3/envs/pytorch2.1.2/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
    return f(*args, **kwargs)
  File "/ssd1/miniconda3/envs/pytorch2.1.2/lib/python3.8/site-packages/torch/distributed/run.py", line 806, in main
    run(args)
  File "/ssd1/miniconda3/envs/pytorch2.1.2/lib/python3.8/site-packages/torch/distributed/run.py", line 797, in run
    elastic_launch(
  File "/ssd1/miniconda3/envs/pytorch2.1.2/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 134, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/ssd1/miniconda3/envs/pytorch2.1.2/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
finetune.py FAILED
------------------------------------------------------------
Failures:
[1]:
  time      : 2024-01-17_14:12:08
  host      : aidev02
  rank      : 3 (local_rank: 3)
  exitcode  : 1 (pid: 65322)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[2]:
  time      : 2024-01-17_14:12:08
  host      : aidev02
  rank      : 4 (local_rank: 4)
  exitcode  : 1 (pid: 65323)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[3]:
  time      : 2024-01-17_14:12:08
  host      : aidev02
  rank      : 5 (local_rank: 5)
  exitcode  : 1 (pid: 65324)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[4]:
  time      : 2024-01-17_14:12:08
  host      : aidev02
  rank      : 6 (local_rank: 6)
  exitcode  : 1 (pid: 65325)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
[5]:
  time      : 2024-01-17_14:12:08
  host      : aidev02
  rank      : 7 (local_rank: 7)
  exitcode  : 1 (pid: 65326)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2024-01-17_14:12:08
  host      : aidev02
  rank      : 2 (local_rank: 2)
  exitcode  : 1 (pid: 65321)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================

解决

修改finetune_qlora_ds.sh,设置GPUS_PER_NODE与可使用GPU数相同

GPUS_PER_NODE=2

  • 11
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
### 回答1: "torch.distributed.elastic.multiprocessing.errors.childfailederror" 意思是在使用 torch.distributed.elastic 进行多进程训练时,子进程发生了错误。这可能是由于网络问题或其他原因导致的。建议检查代码和调试信息,以确定问题所在。 ### 回答2: torch.distributed.elastic.multiprocessing.errors.childfailederror 是 PyTorch 的分布式框架中的一个错误类型,通常会在使用分布式训练时出现。 出现这个错误的原因可能很多,具体取决于代码和环境。以下是一些常见的原因: 1. 程序出错:子进程可能会因为各种原因而崩溃,例如代码错误、内存不足、处理器负载等。如果子进程出错,则父进程将会抛出 torch.distributed.elastic.multiprocessing.errors.childfailederror 异常。 2. 子进程在运行时被杀死:操作系统可能会在一些情况下,如内存不足时,或运行时间过长时,将子进程强制杀死,这也可能导致此错误。 3. 端口占用:多个进程试图绑定到同一个端口时,可能会出现此错误。检查端口是否被占用并尝试更改端口。 4. Python 版本不兼容:确保使用的 Python 版本与所使用的 PyTorch 版本兼容。 5. 数据集或数据大小问题:如果出现数据集过大,内存不足等问题,也可能导致错误。 为了解决这个问题,可以尝试以下步骤: 1. 检查代码错误:检查代码是否存在问题,确保代码在单进程模式下正常运行。排除代码问题后,再观察分布式模式下的表现。 2. 增加内存:使用更高的内存配置,可以避免一些内存不足的可能性。 3. 重启环境: 有时候,重启环境也可以解决这个问题。 4. 增加节点数:为降低单节点的负载,可以在使用并行训练时,增加节点数,从而提高整体负载能力。 总之,要解决 torch.distributed.elastic.multiprocessing.errors.childfailederror 错误,需要对其进行彻底分析,确定错误的原因,并根据具体情况采用相应的解决方案。 ### 回答3: torch.distributed.elastic.multiprocessing.errors.childfailederror 是 PyTorch 分布式 Elastic 支持中的一个错误信息。当 Elastic 训练过程中,在一个 worker node 上运行的子进程(child process)发生错误时,就会抛出这个错误。这种错误通常由以下的一些原因引起: 1. 子进程的代码 Bug:子进程代码中可能存在错误,如语法错误、空指针异常、变量未定义等错误,这些错误会导致子进程运行失败。 2. 子进程内存溢出:如果子进程需要分配的内存超过了系统的可用内存大小,就会发生内存溢出错误,导致子进程运行失败。 3. 硬件故障:如果运行 Elastic 训练的 worker node(包括运行子进程的节点和其他节点)出现硬件故障,例如硬件损坏、电源故障等,也可能导致子进程运行失败。 当出现 torch.distributed.elastic.multiprocessing.errors.childfailederror 错误时,可以通过以下的方法进行排查和处理: 1. 检查子进程的代码,看是否存在语法错误、未定义变量等问题。 2. 检查系统的内存状态,是否存在内存不足的情况。 3. 检查系统的硬件状态,是否出现硬件故障,例如磁盘损坏等。 如果以上三种问题都不存在,仍然无法解决问题,可以考虑降低 Elastic 训练的规模、重新配置 worker node 等措施,以解决 torch.distributed.elastic.multiprocessing.errors.childfailederror 错误。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值