When the cluster network has hierarchical characteristics and bandwidth convergence exists between layers, collective communication faces two technical challenges: First, the performance of the traditional single-layer collective communication algorithm deteriorates due to bandwidth convergence between different regions. Second, the conventional hierarchical algorithm is no longer applicable because the number of compute units in different regions is different (that is, the number of devices is asymmetric). For example, in a cluster, a communicator may span two supernodes with different numbers of devices (for example, one supernode has 64 devices and the other has 128 devices). This poses great challenges to the performance of the collective communication algorithm.
The core idea of this algorithm is to regroup NPUs in a communicator and data on each NPU based on the topology. The high-speed network bandwidth is fully utilized within a group, and asymmetric combination based on logical devices with the same ID is implemented between groups. For details about the process, see the preceding figure. The implementation consists of the three steps:
The implementation algorithm of the intra-group and inter-group ReduceScatter, AllGather, and AllReduce operations can be any known algorithm, such as NB, NHR, and Ring. Currently, the AHC algorithm selects a stitching algorithm with better performance based on the scenario and policy.
When the NB algorithm is used for both intra-group and inter-group operations, the time required by the AllReduce operator is as follows.
|
Operation |
Time Required |
|---|---|
|
AllReduce |
In the formula, m indicates the minimum number of groups, m+d indicates the maximum number of groups, G indicates the number of groups, and C indicates the convergence ratio of the inter-group bandwidth to the intra-group bandwidth. |