使用MindCluster Ascend Deployer配置
为实现后续分布式训练时各训练节点上模型的参数同步,需要为每台训练节点的NPU网口配置参数面网络。本章节仅提供批量配置训练节点NPU网口网络信息的方法。
对应的交换机配置和参数面网络介绍请参见《Ascend Training Solution 24.0.0 组网指南(Atlas A2训练产品)》中的“参数面网络配置示例”>“配置示例(选择对应的产品)”>“配置Leaf交换机”(可在Ascend Training Solution选择您使用的服务器类型相关文档进行查看)。
前提条件
- MindCluster Ascend Deployer执行机上已存在MindCluster Ascend Deployer执行下载操作后的resources/pylibs目录。
- 所有节点已配置免密登录。
配置策略说明
针对不同训练产品,NPU网口的IP网段配置策略有所不同。
产品型号 |
配置策略说明 |
---|---|
Atlas 800T A2 训练服务器 Atlas 900 A2 PoD 集群基础单元 |
|
Atlas 800 训练服务器(型号:9000) Atlas 800 训练服务器(型号:9010) Atlas 900 PoD(型号:9000) Atlas 900T PoD Lite |
|
操作步骤
- 进入ascend-deployer/ascend_deployer,修改inventory_file文件的hccn变量配置区域并保存。示例如下。
1 2 3 4 5 6 7 8 9 10
[hccn] xx.xx.xx.xx ansible_ssh_user="root" deviceip=xx.xx.xx.xx,xx.xx.xx.xx detectip=xx.xx.xx.xx,xx.xx.xx.xx //此处依次填写训练节点业务IP地址、远程登录用户账号、NPU网口IP地址,每台节点配置一行 xx.xx.xx.xx ansible_ssh_user="root" deviceip=xx.xx.xx.xx,xx.xx.xx.xx detectip=xx.xx.xx.xx,xx.xx.xx.xx [hccn:vars] gateways="xx.xx.xx.xx" netmask="255.255.255.0" roce_port=4791 bitmap="0,0,0,1,0,0,0,0" dscp_tc="xx:x," common_network=""
以下为配置参数中涉及的概念解释:
- PFC (Priority-based Flow Control):是以太网协议的一种基于优先级的流控机制,当某个端口的接收缓存出现拥塞时,会向对端发送反压报文,对端暂停发送对应优先级队列的报文。
- DSCP (Differentiated Services Code Point):IP报文头部用来划分服务类型和服务优先级的一个域,取值范围是0~63。
- 优先级队列:交换机和网卡内部实现的QoS队列,包含0~7的8个优先级队列。
- TC (Traffic Class):网络设备将报文区分为不同的服务类别,采用对应的调度策略。一般交换机将报文分成0~7的8个TC,与优先级队列一一对应。NPU参数面网口将报文分成0~3的4个TC。
- 当产品为Atlas 800T A2 训练服务器、Atlas 900 A2 PoD 集群基础单元、Atlas 200T A2 Box16 异构子框时示例如下。
以下以2台训练节点(每台节点8个NPU网口IP同网段)接入两台交换机(每台交换机接两台节点),每台交换机使用一个网段(对应两个网关地址),PFC优先级队列为3,DSCP25映射到TC2为例展示配置示例:
- IPv4:
1 2 3 4 5 6 7 8 9 10
[hccn] 192.168.10.2 ansible_ssh_user="root" deviceip=10.20.0.2,10.20.0.3,10.20.0.4,10.20.0.5,10.20.0.6,10.20.0.7,10.20.0.8,10.20.0.9 detectip=10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1 192.168.10.3 ansible_ssh_user="root" deviceip=10.20.0.10,10.20.0.11,10.20.0.12,10.20.0.13,10.20.0.14,10.20.0.15,10.20.0.16,10.20.0.17 detectip=10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1,10.20.0.1 [hccn:vars] gateways="10.20.0.1,10.20.1.1" netmask="255.255.255.0" roce_port= bitmap="0,0,0,1,0,0,0,0" dscp_tc="25:2," common_network=""
- IPv6
1 2 3 4 5 6 7 8 9 10 11 12 13
[hccn] 3fff:0050:4400::222 ansible_ssh_user="root" deviceip=2001:0db8:85a3::8a2e:0370:7330,2001:0db8:85a3::8a2e:0370:7331,2001:0db8:85a3::8a2e:0370:7332,2001:0db8:85a3::8a2e:0374:7333,2001:0db8:85a3::8a2e:0370:7334,2001:0db8:85a3::8a2e:0370:7335,2001:0db8:85a3::8a2e:0370:7336,2001:0db8:85a3::8a2e:0370:7337 detectip=2001:0db8:85a3::8a2e:0370:7340,2001:0db8:85a3::8a2e:0370:7341,2001:0db8:85a3::8a2e:0370:7342,2001:0db8:85a3::8a2e:0374:7343,2001:0db8:85a3::8a2e:0370:7344,2001:0db8:85a3::8a2e:0370:7345,2001:0db8:85a3::8a2e:0370:7346,2001:0db8:85a3::8a2e:0370:7347 3fff:0050:4400::220 ansible_ssh_user="root" deviceip=2001:0db8:85a3::8a2e:0370:7340,2001:0db8:85a3::8a2e:0370:7341,2001:0db8:85a3::8a2e:0370:7342,2001:0db8:85a3::8a2e:0374:7343,2001:0db8:85a3::8a2e:0370:7344,2001:0db8:85a3::8a2e:0370:7345,2001:0db8:85a3::8a2e:0370:7346,2001:0db8:85a3::8a2e:0370:7347 detectip=2001:0db8:85a3::8a2e:0370:7330,2001:0db8:85a3::8a2e:0370:7331,2001:0db8:85a3::8a2e:0370:7332,2001:0db8:85a3::8a2e:0374:7333,2001:0db8:85a3::8a2e:0370:7334,2001:0db8:85a3::8a2e:0370:7335,2001:0db8:85a3::8a2e:0370:7336,2001:0db8:85a3::8a2e:0370:7337 [hccn:vars] gateways="2001:0db8:85a3::8a2e:0370:1" netmask="64" roce_port=4791 bitmap="" dscp_tc="" common_network="" [other_build_image] [all:vars] SCALE="false"
- IPv4:
- 当产品为Atlas 800 训练服务器(型号:9000)、Atlas 800 训练服务器(型号:9010)、Atlas 900 PoD、Atlas 900T PoD Lite时示例如下。
以下以2台训练节点,每台节点NPU网口IP地址为4个网段(对应4个网关地址),PFC优先级队列为3,DSCP25映射到TC2为例展示配置示例:
1 2 3 4 5 6 7 8 9 10
[hccn] 192.168.10.2 ansible_ssh_user="root" deviceip=10.20.1.2,10.20.2.3,10.20.3.4,10.20.4.5,10.20.1.6,10.20.2.7,10.20.3.8,10.20.4.9 detectip=10.20.1.1,10.20.2.1,10.20.3.1,10.20.4.1,10.20.1.1,10.20.2.1,10.20.3.1,10.20.4.1 192.168.10.3 ansible_ssh_user="root" deviceip=10.20.1.10,10.20.2.11,10.20.3.12,10.20.4.13,10.20.1.14,10.20.2.15,10.20.3.16,10.20.4.17 detectip=10.20.1.1,10.20.2.1,10.20.3.1,10.20.4.1,10.20.1.1,10.20.2.1,10.20.3.1,10.20.4.1 [hccn:vars] gateways="10.20.1.1,10.20.2.1,10.20.3.1,10.20.4.1" netmask="255.255.255.0" roce_port= bitmap="0,0,0,1,0,0,0,0" dscp_tc="25:2," common_network="0.0.0.0/0"
- 执行脚本对inventory_file进行检测。
方式一:执行ascend-deployer.py文件,进行检测。
1
ascend-deployer --hccn --check
方式二:通过bash执行检测命令。1
bash install.sh --hccn --check
- 执行脚本完成配置。执行脚本时会默认在当前环境上安装ansible,若已安装ansible,则会跳过安装。
- 方式一:执行ascend-deployer.py文件,调用hccn参数。
1
ascend-deployer --hccn
- 方式二:执行hccn脚本。
1
bash install.sh --hccn
- 方式一:执行ascend-deployer.py文件,调用hccn参数。
父主题: 配置参数面网络