ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

RuntimeError: NCCL error in:/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:1248, unhandled system

2022-08-06 14:01:26  阅读:14  来源: 互联网

标签:NCCL ProcessGroupNCCL -- py distributed error main


在NGC集群使用https://github.com/pytorch/examples/blob/main/imagenet/main.py跑ImageNet分布式训练,运行命令是

python main.py --dist-url 'tcp://127.0.0.1:8888' --dist-backend 'nccl' --multiprocessing-distributed --world-size 1 --rank 0 --data /mount/imagenet/ImageNet2012/ImageNet2012 --epochs 200 -a resnet50

但是报错,信息如下

File "/code/hyperbox_app/hyperbox_app/distributed/finetune_masks/finetune_imagenet.py", line 188, in main_worker
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[args.gpu])
File "/opt/conda/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 639, in __init__
dist._verify_params_across_processes(self.process_group, parameters)
RuntimeError: NCCL error in: /opt/pytorch/pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp:1248, unhandled system error, NCCL version 2.12.10
ncclSystemError: System call (e.g. socket, malloc) or external library call failed or device error. It can be also caused by unexpected exit of a remote peer, you can check NCCL warnings for failure reason and see if there is connection closure by a peer.

最后实测,在运行命令前面加上如下命令后就可以正常跑了

export NCCL_IB_DISABLE=1; export NCCL_P2P_DISABLE=1; NCCL_DEBUG=INFO python main.py ...


MARSGGBO♥原创


如有意合作,欢迎私戳

邮箱:[email protected]


2019-12-24 14:29:11



标签:NCCL,ProcessGroupNCCL,--,py,distributed,error,main
来源: https://www.cnblogs.com/marsggbo/p/16556963.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有