当进行分布式训练时,需要通过配置device的网卡IP,用于多个device间通信以实现网络模型参数的同步更新。本章节介绍如何使用昇腾软件中的HCCN Tool工具或使用ascend-deployer工具提供的配置脚本(ascend-deployer/tools/DeviceIP-conf.sh)配置device的网卡IP。
针对HCCN Tool工具,本章节只提供配置网络的命令,如果用户需要使用HCCN Tool工具的其他功能(如检查网口Link状态),请参见《Ascend 910 HCCN Tool 接口参考(AI加速卡)》。
判定是SMP模式还是AMP模式,请登录BMC后台执行命令“ipmcget -d npuworkmode”进行查询。
hccn_tool -i 0 -ip -s address 192.168.100.101 netmask 255.255.255.0 hccn_tool -i 1 -ip -s address 192.168.101.101 netmask 255.255.255.0 hccn_tool -i 2 -ip -s address 192.168.102.101 netmask 255.255.255.0 hccn_tool -i 3 -ip -s address 192.168.103.101 netmask 255.255.255.0 hccn_tool -i 4 -ip -s address 192.168.100.100 netmask 255.255.255.0 hccn_tool -i 5 -ip -s address 192.168.101.100 netmask 255.255.255.0 hccn_tool -i 6 -ip -s address 192.168.102.100 netmask 255.255.255.0 hccn_tool -i 7 -ip -s address 192.168.103.100 netmask 255.255.255.0
Atlas 300T 训练卡每台服务器可以配置1或2张标卡,每张标卡对应1个Device OS,每张标卡需要配置1个地址,不同标卡配置相同网段IP地址即可。
以root用户登录到AI Server配置每个device的网卡IP。配置操作如下:
hccn_tool -i 1 -ip -s address 192.168.0.2 netmask 255.255.255.0 hccn_tool -i 4 -ip -s address 192.168.0.3 netmask 255.255.255.0
需要确认在服务器上安装有npu-smi工具。
ascend-deployer/tools/DeviceIP-conf.sh脚本可以修改NPU板卡IP地址,并利用ansible工具的批量部署能力实现批量配置,以下内容仅供有批量配置使用场景的用户参考使用。
以root用户登录到目标服务器,配置操作如下:
10.80.100.101~10.80.100.104
10.80.100.101 10.80.100.102 10.80.100.103 10.80.100.104
172.16.1.100~172.16.1.107/255.255.255.0/172.16.1.1 172.16.2.100~172.16.2.107/255.255.255.0/172.16.2.1 172.16.3.100~172.16.3.107/255.255.255.0/172.16.3.1 172.16.4.100~172.16.4.107/255.255.255.0/172.16.4.1
172.16.1.100/255.255.255.0/172.16.1.1 172.16.2.100/255.255.255.0/172.16.2.1 172.16.3.100/255.255.255.0/172.16.3.1 172.16.4.100/255.255.255.0/172.16.4.1
dos2unix OS_IP.txt
bash DeviceIP-conf.sh [设备类型] [NPU标卡数量] [NPU标卡IP配置] [工作模式] [OS IP地址文件] [Device IP地址文件]
以8个非标NPU板卡采用SMP模式的A800-9000为例,命令示例如下:
bash DeviceIP-conf.sh 1 0 0 SMP /root/uploadosip/OS_IP /root/uploaddeviceip/Device_IP