Collective Communication Algorithms

The same communication operator may use different communication algorithms according to different network topologies, communication data sizes, hardware resources, and more to maximize cluster communication performance. HCCL provides topology algorithms such as Mesh, Ring, Recursive Halving-Doubling (RHD), Pipeline, and Pairwise for intra-server and inter-server collective communication.

Intra-Server Communication Algorithms

Within a server in the HCCL communicator, the supported algorithms are Mesh, Ring, Double-Ring, and Star. They are automatically selected based on the hardware topology, and cannot be configured by users.

Inter-Server Communication Algorithms

Between servers in the HCCL communicator, the following algorithms can be adaptively selected based on the product form, data size, and number of servers. By default, they do not need to be configured by users.
  • Ring algorithm: This is a communication algorithm based on the ring topology. It features a large number of communication steps (linear complexity) and relatively high latency. However, it has a simple communication relationship and is less affected by network congestion. This algorithm applies to scenarios where there are only a few servers in the communicator, small-sized communication data, and obvious network congestion and the pipeline algorithm is not applicable.
  • RHD (Recursive Halving-Doubling) algorithm: This algorithm features a small number of communication steps (logarithmic complexity) and relatively low latency. However, it introduces extra communication traffic when the number of servers is not the power of 2. This algorithm applies to scenarios where the number of servers in the communicator is an integral power of 2 and the pipeline algorithm is not applicable, or the number of servers is not an integral power of 2 but the communication data size is small.
  • NHR (Nonuniform Hierarchical Ring) algorithm: This algorithm features a small number of communication steps (logarithmic complexity) and relatively low latency. It applies to scenarios where there are lots of servers in the communicator and the pipeline algorithm is not applicable.
  • Nonuniform Bruck (NB) algorithm: This algorithm features a small number of communication steps (logarithmic complexity) and relatively low latency. It applies to scenarios where there are lots of servers in the communicator and the pipeline algorithm is not applicable.
  • Currently, the open algorithms in the cann-hccl repository include Mesh, Ring, RHD, PairWise, and Star. You can visit Gitee-cann-hccl to learn about the implementation.
  • You can use the environment variable HCCL_ALGO to specify the inter-server collective communication algorithm. Note that if the inter-server communication algorithm is specified using the environment variable HCCL_ALGO, the adaptive selection of this algorithm does not take effect and the actual algorithm is specified by the user.