deepspeed 训练多机多卡报错 ncclSystemError Last error
最近在搞分布式训练大模型,踩了两个晚上的坑今天终于爬出来了
我们使用 2台 8*H100
遇到过
错误1
10.255.19.85: ncclSystemError: System call (e.g. socket, malloc) or external library call failed or device error.
10.255.19.85: Last error:
10.255.19.85: socketStartConnect: Connect to 127.0.0.1<34273> failed : Software caused connection abort
错误2
10.255.19.82: torch.distributed.DistBackendError: [7] is setting up NCCL communicator and retrieving ncclUniqueId from [0] via c10d key-value store by key '0', but store->get('0') got error: Connection reset by
错误3
10.255.19.85: ncclInternalError: Internal check failed.
10.255.19.85: Last error:
10.255.19.85: Bootstrap : no socket interface found
其实这三个错误都是一个问题导致的,就是网卡配置的问题
这是之前的配置
hostfile
10.255.19.82 slots=8
10.255.19.85 slots=8
fine-tune.sh
hostfile="/data2/xinyuuliu/Baichuan2-main/fine-tune/hostfile" export NCCL_SOCKET_IFNAME=enp194s0f0
# export MASTER_ADDR=10.255.19.82 # 主节点的IP地址
# export MASTER_PORT=29500
# --include localhost:0,1,2,3,4,5,6,7
export NCCL_DEBUG=INFO
# export NCCL_IB_TIMEOUT=22
# export NCCL_IB_GID_INDEX=3
# export NCCL_IB_TC=128
# export NCCL_IB_DISABLE=1 deepspeed --master_addr 10.255.19.82 --master_port 29500 --hostfile=$hostfile fine-tune.py \
--report_to "none" \
--data_path "/data2/xinyuuliu/Baichuan2-main/fine-tune/data/全网评价总结训练数据.json" \
--model_name_or_path "/data1/xinyuuliu/Baichuan2-13B-Chat" \
--output_dir "output_lora_summary" \
--model_max_length 10000\
--num_train_epochs 10 \
--per_device_train_batch_size 4 \
--gradient_accumulation_steps 1 \
--save_strategy epoch \
--learning_rate 2e-4 \
--lr_scheduler_type constant \
--adam_beta1 0.9 \
--adam_beta2 0.98 \
--adam_epsilon 1e-8 \
--max_grad_norm 1.0 \
--weight_decay 1e-4 \
--warmup_ratio 0.0 \
--logging_steps 1 \
--gradient_checkpointing True \
--deepspeed ds_config.json \
--bf16 True \
--tf32 True \
--use_lora True \
# --load_lora_path /data2/xinyuuliu/Baichuan2-main/fine-tune/output_lora4_1_1/checkpoint-7516
# --use_NEFT True
# --use_frozen True #"/data2/xinyuuliu/baichuan2_7B"
修改后之后的配置
问题主要出现在 NCCL_SOCKET_IFNAME 这个环境变量,这个环境变量会被携带到其他机器上,但是网卡的名称是不一样的,尤其我的两台机器包含很多的网卡,因此,我们配置的时候需要把那些没用的虚拟网卡屏蔽掉,只留下需要的
解决方法,这个要根据实际情况来改,英伟达官方写法如下,屏蔽显卡用^开头
export NCCL_SOCKET_IFNAME=^br-c485a8390817,docker0,eno2,ens6f0,ens6f1,enx46a838614d5f,lo,veth23d7383,br-dcd3e4ec14e7,enp194s0f1,ens6f0,ens6f1,enxe278666d5a52,veth110d0b7,veth215ea4e,veth3203d6b,veth87c3cbf,vethec6fc79,virbr0

我的网卡太多了,之前一直以为环境变量在 /etc/profile 下配置各自的就行,
然后再source /etc/profile,结果发现不对,从机也都指向了主机的网卡,没办法建立socket


hostfile="/data2/xinyuuliu/Baichuan2-main/fine-tune/hostfile" export NCCL_SOCKET_IFNAME=^br-c485a8390817,docker0,eno2,ens6f0,ens6f1,enx46a838614d5f,lo,veth23d7383,br-dcd3e4ec14e7,enp194s0f1,ens6f0,ens6f1,enxe278666d5a52,veth110d0b7,veth215ea4e,veth3203d6b,veth87c3cbf,vethec6fc79,virbr0
# export NCCL_SOCKET_IFNAME=enp194s0f0
# export MASTER_ADDR=10.255.19.82 # 主节点的IP地址
# export MASTER_PORT=29500
# --include localhost:0,1,2,3,4,5,6,7
export NCCL_DEBUG=INFO
# export NCCL_IB_TIMEOUT=22
# export NCCL_IB_GID_INDEX=3
# export NCCL_IB_TC=128
# export NCCL_IB_DISABLE=1 deepspeed --master_addr 10.255.19.82 --master_port 29500 --hostfile=$hostfile fine-tune.py \
--report_to "none" \
--data_path "/data2/xinyuuliu/Baichuan2-main/fine-tune/data/全网评价总结训练数据.json" \
--model_name_or_path "/data1/xinyuuliu/Baichuan2-13B-Chat" \
--output_dir "output_lora_summary" \
--model_max_length 10000\
--num_train_epochs 10 \
--per_device_train_batch_size 4 \
--gradient_accumulation_steps 1 \
--save_strategy epoch \
--learning_rate 2e-4 \
--lr_scheduler_type constant \
--adam_beta1 0.9 \
--adam_beta2 0.98 \
--adam_epsilon 1e-8 \
--max_grad_norm 1.0 \
--weight_decay 1e-4 \
--warmup_ratio 0.0 \
--logging_steps 1 \
--gradient_checkpointing True \
--deepspeed ds_config.json \
--bf16 True \
--tf32 True \
--use_lora True \
# --load_lora_path /data2/xinyuuliu/Baichuan2-main/fine-tune/output_lora4_1_1/checkpoint-7516
# --use_NEFT True
# --use_frozen True #"/data2/xinyuuliu/baichuan2_7B"
修改后成功跑起16*H100,爽歪歪


deepspeed 训练多机多卡报错 ncclSystemError Last error的更多相关文章
- cordova-ios 升级到4.4.0 无法真机跑iOS8 报错: dyld`dyld_fatal_error: -> 0x120085088 <+0>: brk #0x3
项目进入测试阶段,马上要上线了,同事拿了自己的iOS8系统5s跑真机,无缘无故报错,之前跑她的手机完全没有问题的.Xcode 8.x中最低部署版本是iOS8.0,按理说完全能够跑真机的. 但是报了一个 ...
- http报错之return error code:401 unauthorized
http报错之return error code:401 unauthorized 依据HTTP返回码所表示的意思应该是未授权,没有输入账号和password,因此解决方法就直接在HTTP包里面 ...
- 支付宝 报错 rsa_private read error : private key is NULL解决方法
原因: 真机调试IOS支付宝功能GDB出现 rsa_private read error : private key is NULL提示 调试iOS 支付宝SDK的时候,执行demo.把 Partn ...
- 配置MySQL主从复制报错Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work
配置MySQL主从复制报错 ``` Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave ha ...
- VS经常报错的link error 2019
VS经常报错的link error 2019 原因如下: 可能是找得到头文件,但是相关的dll或者lib找不到,需要在配置里面添加相应的库文件. project=>configuration.. ...
- 解决FPDF报错:FPDF error: Not a JPEG file / FPDF error: Not a PNG file
最近有个项目需要用到FPDF,但是输出的时候报错: FPDF error: Not a JPEG file: http://***/data/attachment/forum/201603/19/10 ...
- Heka 编译安装后 运行报错 panic: runtime error: cgo argument has Go pointer to Go pointer
Heka 编译安装后 运行报错 panic: runtime error: cgo argument has Go pointer to Go pointer 解决办法: 1. Start heka ...
- PHP编译安装报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt
我是在CentOS6.5安装php5.5.28这个版本,PHP编译代码如下: ./configure --prefix=/usr/local/php --with-config-file-path=/ ...
- mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file
mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...
- xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files'
xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files' 1.使用xtrabackup备份MySQL时出现如下报错 ...
随机推荐
- 摆脱鼠标系列 - 浏览器操作 - Vimium C 插件 f 显示链接字母 jk上下移动
为什么 摆脱鼠标系列 - 浏览器操作 - Vimium C 插件 f 显示链接字母 jk上下移动 百度搜索资料的时候,争取少用鼠标 关闭当前页签 x 左边页签 J 右边页签 K 搜索 /关键字回车 n
- Python爬虫实战系列2:虎嗅网24小时热门新闻采集
一.分析页面 打开虎嗅网,点击[24小时] 本次采集,我们以这24小时的热门新闻为案例. 1.1.分析请求 F12打开开发者模式,然后点击Network后点击任意一个请求,Ctrl+F开启搜索,输入标 ...
- Mysql查询数据量大小
--按实例 SELECT CONCAT(round(sum(DATA_LENGTH/1024/1024/1024),2),"GB") as datazise FROM inform ...
- day03-2-应用线程02
JavaGUI-坦克大战03-2 7.线程的应用02 7.3.坦克大战4.0版 坦克大战4.0版 增加功能: 功能1.让敌人的坦克也能够发射子弹(可以有多个子弹) 功能2.当我方坦克集中敌人坦克时,敌 ...
- 业务开发做到零 bug 有多难?
大家好,我是树哥,好久不见啦. 作为一个工作了 10 多年的开发,写业务代码总是写了不少的.但你想过做到零 bug 吗?我可是想过的,毕竟我还是有点追求的.不然每天都是浑浑噩噩地过,多没意思啊. 大概 ...
- .Net依赖注入神器Scrutor(上)
前言 从.Net Core 开始,.Net 平台内置了一个轻量,易用的 IOC 的框架,供我们在应用程序中使用,社区内还有很多强大的第三方的依赖注入框架如: Autofac DryIOC Grace ...
- 【Jenkins】Jenkins 运行权限问题
yum安装的Jenkins 配置文件默认位置/etc/sysconfig/jenkins 默认jenkins服务以jenkins用户运行,这时在jenkins执行maven脚本时可能会发生没有权限操作 ...
- 【FastDFS】面试官:如何实现文件的大规模分布式存储?(全程实战)
写在前面 在<[FastDFS]小伙伴们说在CentOS 8服务器上搭建FastDFS环境总报错?>一文中,详细的介绍了如何在CentOS 8服务器行搭建FastDFS环境.在生产环境中, ...
- DevOps迈向标准化,平台工程让开发运维更轻松
在近一代人的时间里,DevOps 在软件开发和运维领域占据了主导地位.这是一套开发人员都离不开的技能和方法.Pearl Zhu 在 "The Digital Master" 一书中 ...
- Springboot Mybatis 全局变量使用
application.properties中配置 mybatis.configuration.variables.k1='v1' mybatis.configuration.variables.k2 ...