超节点P2P带宽测试
测试项功能
超节点P2P带宽测试主要用于测试节点之间的网络传输速率和总耗时。
测试流程
现已支持使用MPI方式或超节点配置共享目录两种方式测试带宽,优先推荐使用MPI方式。
- 使用超节点需要通过共享目录来传递共享地址和进程ID。以在Device A、Device B上进行超节点P2P带宽测试为例,测试流程如下:
- 请准备挂载共享目录的超节点环境,确保待测节点能够访问同一共享目录;
- 已完成CANN、MindCluster ToolBox的安装,并配置环境变量;
- Device A启动Ascend DMI,参数指定为超节点带宽测试,并指定Device B的IP地址;
- Device B启动Ascend DMI,参数指定为超节点带宽测试,并指定Device A地址;
- 打印测试结果。
- 若使用MPI方式测试超节点P2P带宽,请参考《CANN HCCL性能测试工具用户指南》的“MPI安装与配置”章节提前在环境上安装配置MPI,并参考《CANN HCCL性能测试工具用户指南》的“工具编译”章节配置其环境变量,推荐使用Open MPI-4.1.5版本或MPICH 4.3.0版本。
- 在上述流程中,Device A和Device B启动Ascend DMI工具进行超节点带宽测试时,时间间隔不能超过10s。
- 请确认参数填写的IP地址有效。
测试项特定参数查询
用户可任选以下指令之一查看带宽测试命令的可用参数。
ascend-dmi --bw -h
ascend-dmi --bw --help
命令各参数解释如表1所示,表格内仅展示测试项特定参数,其余公共参数请参见公共参数说明。
参数 |
说明 |
约束 |
是否必填 |
|---|---|---|---|
[-bw, --bw, --bandwidth] |
使用该参数测试芯片的带宽。支持-bw,但建议使用--bw或--bandwidth。 |
- |
是 |
[-t, --type] |
指测试数据流向的分类。 |
当前仅支持带宽类型为p2p的指定。 |
是 |
[-sp, --sp, --super-pod] |
指定超节点测试。 该参数取值为0/1/2,0表示该节点优先测试单向带宽(源节点),1表示测试对方节点(目标节点),2表示使用MPI方式测试超节点。 |
|
是 |
[-ip, --ip, --peer-ip] |
用于指定超节点测试时对方节点的IP地址。 必须与[-hip, --hip, --host-ip]、[-sp, --sp, --super-pod]参数同时指定。 |
|
是 |
[-hip, --hip, --host-ip] |
指定本端Host IP。 必须与[-ip, --ip, --peer-ip]、[-sp, --sp, --super-pod]参数同时指定。 |
|
是 |
[-spp, --spp, --super-pod-path] |
指定节点间可访问的同一共享目录路径。 |
指定路径需符合安全要求,且不支持包含通配符“*”。 |
是 |
[-ds, --ds, --device-src] |
指定P2P测试的源头Device的ID号。必须与[-dd, --dd, --device-dst]参数成对指定。 |
使用[-ds, --ds, --device-src]、[-dd, --dd, --device-dst]指定后,不可再指定[-d, --device]参数。 |
否 |
[-dd, --dd, --device-dst] |
指定P2P测试的目标Device的ID号。必须与[-ds, --ds, --device-src]参数成对指定。 |
使用[-ds, --ds, --device-src]、[-dd, --dd, --device-dst]指定后,不可再指定[-d, --device]参数。 |
否 |
[-m, --mode] |
指定带宽测试模式,执行卡粒度或芯片粒度的带宽测试。 不指定该参数时默认测试device粒度的带宽测试。
|
仅支持Atlas 900 A3 SuperPoD 超节点、Atlas 9000 A3 SuperPoD 集群算力系统、A200T A3 Box8 超节点场景下,使用此参数。 |
否 |
[-d, --device] |
指定待测节点的Device ID,默认值为0。
|
使用[-d, --device]指定后,不可再指定[-ds, --ds, --device-src]、[-dd, --dd, --device-dst]参数。 |
否 |
[-s, --size] |
指传输数据大小并指定测试结果显示方式。
|
|
否 |
[-et, --et, --execute-times] |
指迭代次数,即内存拷贝次数。 |
|
否 |
注: 临时文件名分别为flag、procInfo和procInfoBi(会在--spp参数指定的目录下生成一个ascend_check目录,ascend_check目录下会生成一个以--hip参数指定的IP为名称的目录,临时文件会放在该目录下)。 |
|||
使用实例
实例一:使用MPI方式测试超节点P2P带宽示例
使用mpirun -host xx.xx.xx.x2(源节点IP):1,xx.xx.xx.x3(对方节点IP):1 -n 2 ascend-dmi --bw -t p2p --sp 2 --dd 0 --ds 0 -q进行超节点P2P带宽测试,如下图所示。
- 使用OpenMPI需要增加--allow-run-as-root参数:允许以root用户身份运行MPI程序。
- -mca btl_tcp_if_include参数:指定MPI通信协议和通信端口。
[****@node-97-52 xxx]# mpirun -host xx.xx.xx.x2:1,xx.xx.xx.x3:1 -n 2 ascend-dmi --bw -t p2p --sp 2 --dd 0 --ds 0 -q Unidirectional Peer to Peer Test Pod: rank 0 device id: 0 to Pod: rank 1 device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 164.500657 3263.64 ---------------------------------------------------------------- Bidirectional Peer to Peer Test Pod: rank 0 device id: 0 and Pod: rank 1 device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 290.117374 3701.06 ---------------------------------------------------------------- Unidirectional Peer to Peer Test Pod: rank 1 device id: 0 to Pod: rank 0 device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 164.447246 3264.70 ---------------------------------------------------------------- Bidirectional Peer to Peer Test Pod: rank 1 device id: 0 and Pod: rank 0 device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 290.197348 3700.04 ----------------------------------------------------------------
实例二:使用OpenMPI方式测试超节点P2P带宽示例
使用mpirun --allow-run-as-root -mca btl_tcp_if_include ip/port -host xx.xx.xx.x2(源节点IP):1,xx.xx.xx.x3(对方节点IP):1 -n 2 ascend-dmi --bw -t p2p --sp 2 --dd 0 --ds 1 -q进行超节点P2P带宽测试,如下图所示。
- --allow-run-as-root参数:允许以root用户身份运行MPI程序。
- -mca btl_tcp_if_include参数:指定MPI通信协议和通信端口。
[****@node-97-52 xxx]# mpirun --allow-run-as-root -mca btl_tcp_if_include ip/port -host xx.xx.xx.x2:1,xx.xx.xx.x3:1 -n 2 ascend-dmi --bw -t p2p --sp 2 --dd 0 --ds 1 -q Unidirectional Peer to Peer Test Pod: rank 1 device id: 0 to Pod: rank 0 device id: 1 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 328.939824 3264.25 ---------------------------------------------------------------- Bidirectional Peer to Peer Test Pod: rank 1 device id: 0 and Pod: rank 0 device id: 1 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 580.671140 3698.28 ---------------------------------------------------------------- Unidirectional Peer to Peer Test Pod: rank 0 device id: 1 to Pod: rank 1 device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 328.874329 3264.90 ---------------------------------------------------------------- Bidirectional Peer to Peer Test Pod: rank 0 device id: 1 and Pod: rank 1 device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 583.744108 3678.81 ----------------------------------------------------------------
实例三:以不指定超节点P2P带宽测试的Device ID为例(共享目录方式)
命令如下所示(请将下文中的xx.xx.xx.xx替换为优先测试单向带宽的节点IP,请将下文中的yy.yy.yy.yy替换为对方节点的IP)。
优先测试单向带宽的节点(源节点)上执行:
ascend-dmi --bw -t p2p --sp 0 --ip yy.yy.yy.yy --spp /xxx/xxx/xxx --hip xx.xx.xx.xx
对方节点(目标节点)上执行:
ascend-dmi --bw -t p2p --sp 1 --ip xx.xx.xx.xx --spp /xxx/xxx/xxx --hip yy.yy.yy.yy
[root@*****~]# ascend-dmi --bw -t p2p -sp 1 -ip xx.xx.xx.xx -q --spp /xxx/xxx/xxx --hip yy.yy.yy.yy Unidirectional Peer to Peer Test Pod: yy.yy.yy.yy device id: 0 to Pod: xx.xx.xx.xx device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 164.336497 3266.90 ---------------------------------------------------------------- Bidirectional Peer to Peer Test Pod: yy.yy.yy.yy device id: 0 and Pod: xx.xx.xx.xx device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 290.613631 3694.74 ----------------------------------------------------------------
[root@*****~]# ascend-dmi --bw -t p2p -sp 0 -ip yy.yy.yy.yy -q --spp /xxx/xxx/xxx --hip xx.xx.xx.xx Unidirectional Peer to Peer Test Pod: xx.xx.xx.xx device id: 0 to Pod: yy.yy.yy.yy device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 164.336497 3266.90 ---------------------------------------------------------------- Bidirectional Peer to Peer Test Pod: xx.xx.xx.xx device id: 0 and Pod: yy.yy.yy.yy device id: 0 ---------------------------------------------------------------- Size(Bytes) Execute Times Bandwidth(GB/s) Elapsed Time(us) ---------------------------------------------------------------- 536870912 40 290.613631 3694.74 ----------------------------------------------------------------
实例四:以测试2个节点Device 1之间的带宽为例(共享目录方式)
优先测试单向带宽的节点上执行:
ascend-dmi --bw -t p2p --sp 0 --ip yy.yy.yy.yy -d 1 --spp /xxx/xxx/xxx --hip xx.xx.xx.xx
对方节点上执行:
ascend-dmi --bw -t p2p --sp 1 --ip xx.xx.xx.xx -d 1 --spp /xxx/xxx/xxx --hip yy.yy.yy.yy实例五:以测试2个节点Card 1之间的带宽为例(共享目录方式)
优先测试单向带宽的节点(源节点)上执行:
ascend-dmi --bw -t p2p --sp 0 --ip yy.yy.yy.yy -d 1 --spp /xxx/xxx/xxx --hip xx.xx.xx.xx -m card
对方节点(目标节点)上执行:
ascend-dmi --bw -t p2p --sp 1 --ip xx.xx.xx.xx -d 1 --spp /xxx/xxx/xxx --hip yy.yy.yy.yy -m card参数 |
说明 |
|---|---|
Unidirectional Peer to Peer Test |
单向P2P。 |
Bidirectional Peer to Peer Test |
双向P2P。 |
Pod: yy.yy.yy.yy device/card: 0 to Pod: xx.xx.xx.xx device/card: 0 |
根据mode参数,呈现device/card。 前一个Pod代表优先测试单向带宽的节点;yy.yy.yy.yy为优先测试单向带宽的节点IP;device为优先测试单向带宽的Device ID。 后者为对方节点;对方节点IP;对方节点Device ID。 |
Size(Bytes) |
传输数据大小,单位为字节。 |
Execute Times |
迭代次数。 |
Bandwidth(GB/s) |
芯片的带宽,单位为GB。 |
Elapsed Time(us) |
总执行时长。 |