Mesh

Description

Mesh is a basic algorithm in the full-mesh topology. It is a full mesh between NPUs. Any two NPUs can directly send and receive data.

The following figure shows the process of implementing the AllReduce operator using the Mesh algorithm. Each NPU concurrently reads data from or writes data to the remote end through multiple HCCS links, so that the bidirectional bandwidth of the duplex interconnection link is used at the same time.

The time complexity of the Mesh algorithm is O(1).

Required Time Calculation

Table 1 Time required for each operation in the Mesh algorithm

Operation

Time Required

Scatter

Gather

Broadcast

The implementation is Scatter+AllGather, and the time required is as follows.

Reduce

The implementation is ReduceScatter+Gather, and the time required is as follows.

ReduceScatter

AllGather

AllReduce

The implementation is ReduceScatter+AllGather, and the time required is as follows.