This API will be deprecated in later versions. Do not use this API.
Description: Implements the multi-rank parallel AllReduce function based on grouped matrix multiplication, supporting non-uniform matrix dimension sizes across multiple groups. The following four scenarios are supported based on the tensor count of , , and :
- The number of tensors for
[object Object],[object Object], and[object Object]equals the group count. That is, the tensors of each group are independent. [object Object]has one tensor, while[object Object]and[object Object]have tensors equal to the group count. In this case, use the optional parameter[object Object]to define the row-wise grouping of[object Object]. For example,[object Object]indicates that the first 10 rows of[object Object]participate in the multiplication of the first group of matrices.- The number of tensors for
[object Object]and[object Object]equals the group count, but[object Object]has only one tensor. In this case, products of each matrix group multiplication are stored contiguously within a single tensor. [object Object]and[object Object]each have one tensor, while[object Object]has tensors equal to the group count. This is a hybrid configuration combining the preceding two cases.
- The number of tensors for
Formula:
Non-quantization scenario:
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
Parameters
[object Object]Return
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following errors may be thrown:
[object Object]
Deterministic computation:
[object Object]defaults to a deterministic implementation.
Constraints on data type combinations: The supported data type combinations for
[object Object],[object Object], and[object Object]are as follows:[object Object]: FLOAT16;[object Object]: FLOAT16;[object Object]: FLOAT16[object Object]: BFLOAT16;[object Object]: BFLOAT16;[object Object]: FLOAT32
Dimension constraints:
- When
[object Object]is set to[object Object],[object Object]and[object Object]both support 2D to 6D. - When
[object Object]is set to[object Object],[object Object], or[object Object], both[object Object]and[object Object]support 2D. - Regardless of the value of
[object Object],[object Object]supports 2D.
- When
Device quantity: 2, 4, or 8 devices can be deployed.
Tensor dimension size requirements:
- The size of the last dimension for each tensor in
[object Object]and[object Object]must be less than 65536. (For[object Object], the last dimension refers to the K-axis when[object Object]is false, and the M-axis when it is true; for[object Object], the last dimension refers to the N-axis when[object Object]is false, and the K-axis when it is true.) - The size of each dimension for every tensor in
[object Object]and[object Object], after 32-byte alignment, should be less than the maximum value of INT32 (2147483647).
- The size of the last dimension for each tensor in
The following is sample code and is for reference only. For the detailed compilation and execution process, see the compilation and execution example.