首页 > 其他分享 >deepspeed 训练多机多卡报错 ncclSystemError Last error

deepspeed 训练多机多卡报错 ncclSystemError Last error

时间:2024-04-18 21:45:18浏览次数:27  
标签:NCCL deepspeed xinyuuliu Last -- 10.255 报错 export True

 

最近在搞分布式训练大模型,踩了两个晚上的坑今天终于爬出来了

我们使用 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,爽歪歪

 

 

 

 

标签:NCCL,deepspeed,xinyuuliu,Last,--,10.255,报错,export,True
From: https://www.cnblogs.com/LiuXinyu12378/p/18144455

相关文章

  • redis 设置了 bind 后开机自启动报错
    redis设置了bind后开机自启动报错‍虚拟机中安装的redis​,在配置文件中设置了bind​,开机自启动时遇到:[root@localhost~]#tail-f/var/log/redis/redis.log849:C18Apr202407:18:49.475#oO0OoO0OoO0OoRedisisstartingoO0OoO0OoO0Oo849:C18Apr202407:18:......
  • json反序列化 JsonConvert.DeserializeObject 报错 One or more errors occurred. (U
    接口返回的字符串肉眼看起来正常,也是标准json,反序列化时候报错,字符串添加了UTF8-BOM头(windows记事本默认编码),可以通过以下代码移除标头//模拟json字符串对象varjsonStr="{}";byte[]buffer=Encoding.UTF8.GetBytes(jsonStr);varsResult=Encoding.UTF8.GetString......
  • ElasticSearch
    分布式搜索技术倒排索引ElasticSearch采用倒排索引1、文档(document):每条数据就是一个文档2、词条(term):文档按照语义分成的词语。不可重复MySQL擅长事务类型操作,可以确保数据的安全和一致性。ElasticSearch擅长海量数据的搜索、分析、计算。单机安装dockernetwor......
  • net8 linux docker sqlserver报错error: 31 - Encryption(ssl/tls) handshake failed)
    asp.netcore升级到8.0后遇到数据库不能连接问题?_已解决_博问_博客园(cnblogs.com) 中文提示:连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,错误信息:Aconnectionwassuccessfullyestablishedwiththeserver,butthenanerroroccurredduringthep......
  • SpringCloud(七.4)ES(elasticsearch)-- DSL查询语法
    DSL查询语法 1、查询所有以下是简写和全写 总结:  2、全文检索查询(match)全文检索查询,会对用户输入内容分词,常用于搜索框搜索: 回顾在 SpringCloud(七.3)ES(elasticsearch)--RestClient操作 中创建索引时添加的all字段,以及字段拷贝copy_to。这里all字段就派上了用......
  • Unity Android 打包报错解决方案记录
    1.安卓版本过低报错提示PickedupJAVA_TOOL_OPTIONS:-Dfile.encoding=UTF-8D:\Develop\Unity\HRVTest\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164:错误:找不到符号......
  • react 使用effect 的报错
    1、像这种,根据someId值的改变,每次调用一次useEffect的。如果在useEffect加上async则会出现报错 正确的做法,则是去掉useEffect上的async useEffect(()=>{asyncfunctionfetchData(){try{//在这里进行异步操作constresponse=awaitMyAPI.g......
  • jdk 21降为 1.8 报错(idea中)
    1、检测环境变量配置win+r =>cmd 检测jdk版本 java-version查看环境变量中jdk路径  echo%JAVA_HOME%2、打开IDEA的设置或首选项对话框File→Settings→ Build,Execution,Deployment”→“Compiler”,在“JavaCompiler”部分,将“Targetby......
  • 运行MongoDB 报错GLIBC_2.14 not found
    Linux环境下安装完mongodb,运行./mongod报错如下#./mongod./mongod:/lib64/libc.so.6:version`GLIBC_2.14'notfound(requiredby./mongod)使用rpm-qa|grep glibc查看系统当前的glibc版本为2.12使用如下命令查看系统glibc最高支持的版本为2.12#strings/lib64/libc.s......
  • vscode remote-x11 ssh 连接时Another All configured authentication methods failed
    错误remote-x11-ssh插件使用ssh2扩展出现以下错误https://github.com/joelspadin/vscode-remote-x11/issues/75Error:Allconfiguredauthenticationmethodsfailed原因https://github.com/mscdex/ssh2/issues/989解决换成ed25519并修改配置......