本文主要介绍昇腾训练/推理,双机直连组网环境准备和检查,不包括具体训练和推理过程。
组网要求
参数面:
同编号的 NPU 双机光纤直连。
要求:
1. 配置的 200 Gbps 光模块,由设备出厂自带,配套对应的光纤。
2. 建议双机放在同一机柜。
3. 建议光纤长度 10 米之内。
网卡配置:
-
IP 按照上图所示,两个直连NPU需要配置为同一个网段,不感知其它的 NPU 网段(最好所有 IP 都配置为同一个网段) 。
-
直连场景只有两个NPU能够互通,不需要配置网关。
-
每张卡的侦测IP 配置为对端直连的NPU IP(需要非常关注,跟传统通过交换机组网的方式不同)。
链路状态检查
完成组网配置后,首先检查服务器链路状态,确保链路都是up
#检查链路up/down
for i in {0..7};do hccn_tool -i $i -link -g;done
#检查npu网卡直连的交换机端口
for i in {0..7};do hccn_tool -i $i -lldp -g|grep Ifname;done
配置服务器IP地址
分别配置两个服务器的NPU网卡ip地址
A服务器
#配置ip地址
for i in {0..7};do
hccn_tool -i $i -ip -s address 192.168.1.$((i+2)) netmask 255.255.255.0;
done
#检查ip地址配置
for i in {0..7};
do hccn_tool -i $i -ip -g;
done
B服务器
#配置ip地址
for i in {0..7};do
hccn_tool -i $i -ip -s address 192.168.1.$((i+12)) netmask 255.255.255.0;
done
#检查ip地址配置
for i in {0..7};
do hccn_tool -i $i -ip -g;
done
配置检测对象ip
分别配置两个服务器的NPU网卡链路健康检查ip地址
A服务器
#配置检测对象ip
for i in {0..7};do
hccn_tool -i $i -netdetect -s address 192.168.1.$((i+12));
done
#检查检测对象配置
for i in {0..7};do
hccn_tool -i $i -netdetect -g;
done
#检测链路健康状态
for i in {0..7};do
hccn_tool -i $i -net_health -g;
done
B服务器
#配置检测对象ip
for i in {0..7};do
hccn_tool -i $i -netdetect -s address 192.168.1.$((i+2));
done
#检查检测对象配置
for i in {0..7};do
hccn_tool -i $i -netdetect -g;
done
#检测链路健康状态
for i in {0..7};do
hccn_tool -i $i -net_health -g;
done
直连多口连通性检测
完成以上配置后,再做两个服务器直连接口的连通性检查
A服务器
#ping对端地址,检测连通性
for i in {0..7};do
hccn_tool -i $i -ping -g address 192.168.1.$((i+12));
done
B服务器
#ping对端地址,检测连通性
for i in {0..7};do
hccn_tool -i $i -ping -g address 192.168.1.$((i+2));
done
使用HCCL TEST性能测试工具检查
HCCL TEST工具,主要是应用在分布式训练推理场景下,开发者可以通过此工具测试HCCL(Huawei Collective Communication Library)集合通信的功能正确性以及性能。可测试单机多卡,也可测试多机多卡场景。
以上网络配置步骤完成后,就可以通过HCCL TEST工具来对环境验证,HCCL TEST测试通过,说明环境可以用于具体的训练/推理任务。
具体使用方法请参考:
工具介绍-HCCL性能测试工具-训练&推理开发-CANN商用版8.0.0开发文档-昇腾社区
【昇腾】HCCL性能测试工具:HCCL TEST使用_怎么查看hccl进程-CSDN博客