How to Use Reduction Compute APIs

Reduction instructions simplify the dataset to a single value or a smaller set. Based on the data ranges of the reduction operations, the reduction instructions are classified into the following types, as shown in Figure 1.

Figure 1 Reduction instruction diagram

Like other basic APIs, the high-dimensional tensor sharding compute API is also provided for the reduction instructions. This API can fully utilize hardware advantages and enable you to flexibly control the repeat execution of instructions and address stride of operands. However, the units and restrictions of its specific parameters are slightly different from those of basic APIs, which is described in the following: