高性能网络
High Performance Network

网络基础

ifconfig

ethtool

hostname -f

以太网

10G-EPON指万兆以太网无源光网络(万兆光纤) 10G-EPON标准支持下列两种配置:

容器网络 CNI

RDMA

快手DHPS:国内首个实现基于RDMA 通信的可负载均衡高性能服务架构 Kimi:mooncake rdma transport engine https://libfeng.com/posts/rapid-transfer/

三种网络协议

RDMA概念

Memory Region Protection Domain 将QP和MR做绑定 gid qpn QP number RDMA 通信基于三条队列 SQ(Send Queue),RQ(Receive Queue)和 CQ(Completion Queue)组成的集合。 每一个应用程序可以有很多QP和CQ 每一个QP包括一个SQ和RQ 每一个CQ可以跟多个SQ或者RQ相关联 发送队列(SQ)和接收队列(RQ)负责调度工作,他们总是成对被创建,称之为队列对 QP(Queue Pair) QP状态: INIT, RTR, RTS 当放置在工作队列上的指令被完成的时候,完成队列(CQ)用来发送通知。 工作队列元素 WQE(Work Queue Element) 完成队列元素 CQE(Completion Queue Element)

verbs api

RDMA有三种协议IB/iWARP/RoCE,设计Verbs API通过统一接口,让同一份RDMA程序程序可以无视底层的硬件和链路差异运行在不同的环境中。

rdma 相关命令

ibv_devinfo 命令 query RDMA devices Failed to get IB devices list: Unknown error -38

ibstat 命令

ofed_info 命令

show_gids 命令

ibdev2netdev 命令 ls: cannot access /sys/class/infiniband/: No such file or directory

mst命令

mlxlink 命令

mstconfig 命令 set or query non-volatile configurable options for Mellanox HCAs

systemctl start rdma 命令 需要吗??

ethtool命令 ethtool -i eth0

GDR - GPUDirect RDMA

GDR通过使RDMA网卡直接读写GPU显存,消除了CPU拷贝开销. GDRCopy是基于NVIDIA GPUDirect RDMA实现的低延迟GPU内存拷贝库。它支持GPU与CPU间数据传输(D2H/H2D),由CPU驱动

IBGDA - InfiniBand GPUDirect Async

IBGDA(InfiniBand GPU Direct Async)和GDR(GPU Direct RDMA)是两种基于InfiniBand的高性能GPU通信技术,核心区别在于‌控制路径的实现方式。IBGDA解决了在GDR模式下,CPU仍需介入控制路径所成为的瓶颈

IBGDA was introduced in NVSHMEM 2.6.0 and significantly improved upon in NVSHMEM 2.7.0 and 2.8.0. It enables the GPU to bypass the CPU when issuing internode NVSHMEM communication without any changes to existing applications.

When using IBGDA, GPU and NIC directly exchange information necessary for communication. The WQ and DBR buffers are also moved to the GPU memory to improve efficiency when accessed by the SM, while preserving access by the NIC through GPUDirect RDMA.

Improving Network Performance of HPC Systems Using NVIDIA Magnum IO NVSHMEM and GPUDirect Async

IBRC - InfiniBand Reliable Connection

NVSHMEM IBRC transport, which uses a proxy thread to manage communication

Collective Communication

广播(broadcast)、规约(reduction)、散播(scatter)和聚集(gather)

集合通信相对P2P通信来讲,它的1对多或者多对多通信。 集合通信最为典型的用例就是深度学习模型分布式训练时的梯度同步,就是用allreduce实现的。

*****
Written by Lu.dev on 30 September 2025