使用torch+mindspeed训练时,可能出现类似“wait socket establish timeout, role[0] rank[1] timeout[120]”的报错,plog日志内容如下:
上图中给出以下信息:
1,本端device id(5)、本端rank(1)、对端rank(2)。本端rank和对端rank表示的是在通信域内的rank编号,如果是子通信域,需要注意device id和rank id无法对应;
2,若为节点间建链,device ip是nic ip,若为节点内建链,device ip是vnic ip,可根据通信域的信息和两端的rank号确认节点间/内场景。
另外还给出了7个排查策略,下面分别介绍。
1. the connection between this device and the target device is abnormal
需要检查每个server上的防火墙是否关闭,执行下面的命令:
systemctl status firewalld
如果状态时“Active: active(running)”,就需要关闭防火墙:
systemctl stop firewalld
2. an exception occurred at the target devices.
根据对端的user_rank找到对端的日志,若对端存在其他报错,需要先排查对端的报错原因。
3.the time difference between the execution of hcom on this device and the target device exceeds the timeout threshold. make sure this by keyworld [Entry-]
需要检查每个节点上下发的算子个数是否一致或者下发的时间间隔是否超过超时时间。具体做法是开启环境变量 export HCCL_ENTRY_LOG_ENABLE=1
,重新执行用例,在每个rank的日志中grep -r "Entry-"
查看算子的下发记录,检查是否有未下发或者下发超时的rank:
grep -r ERROR | grep transport_manager | grep tag
找到报错的算子tag;grep -r {tag} |grep ranks
根据tag查询该通信域下的总rank数;grep -rn Entry- | grep {tag}
根据查找到的tag在每个rank上查询该算子的下发。若下发数与总rank数不一致,或者存在下发时间间隔超过了超时时间,需要检查上面的框架层分析下发慢的原因。
4. the behavior of executing the calculation graph on this device and the target device is inconsistent.
需要检查本端和对端的计算图执行流程是否一致。
- 检查两端的配置是否一致,在run目录下检查环境变量配置
grep -r "externalinput.cc" run/
,两端需保持一致; - 检查两端的hccs使能是否一致:
npu-smi info -t topo
如果有节点之间不是hccs,则会有建链超时报错。
5. The TLS switch is inconsistent, or the TLS certificate expires.
各rank的TLS(安全增强)设置不一致时也会导致建链失败。
- 日志中排查TLS打印。在每个环境上的
/root/ascend/log/run
目录下检查TLS SWITCH打印:grep -r "TLS SWITCH" /root/ascend/log/run/device*
。若存在不一致,即有的是0有的是1,则需要将全部rank配置成一致; - 检查环境上的TLS:
for i in {0..7}; do hccn_tool -i $i -tls -g ; done | grep switch
。如果各个rank上的tls switch值不同,也会导致失败。建议统一保持TLS关闭:for i in {0..7}; do hccn_tool -i $i -tls -s enable 0; done
。
6. If src and dst IP address can be pinged, check whether the device IP address conflicts.
需要检查本端和对端的device网口之间是否联通。
找到日志中超时的两个rank,先通过hccn_tool命令查看对应的ip:
hccn_tool -i {node} -ip -g
也可使用如下命令直接查询当前节点的全部device ip/link信息:
for i in {0..7}; do hccn_tool -i $i -ip -g ; done
for i in {0..7}; do hccn_tool -i $i -link -g ; done
接着使用hccl_tool命令在其中一个节点ping另外一个节点的device ip,查看超时的两个link之间能否ping通:
hccn_tool -i {node} -ping -g address {对端ip}
若两个rank之间ping不通或者有网口是down的,需要联系实验室管理员配置设备的网卡ip。
G8600(16卡)可能会遇到这种情况,可以通过配置环境变量 export HCCL_INTRA_ROCE_ENABLE=1 来解决。