API function:
[object Object]is a merged compute and communication (MC2) operator that implements parallelism of BatchMatMul computation and ReduceScatter and AllToAll collective communication.Formula: The general computing process is as follows: BatchMatMul computation --> transpose (required when yShardType is set to 0) --> ReduceScatter collective communication --> Add --> AllToAll collective communication. Below shows the computation logic, where
[object Object]is the output.
Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.
Parameters
[object Object]Returns
aclnnStatus: status code. For details, see .
The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic computing:
[object Object]defaults to a deterministic implementation.
Due to the requirements of collective communication and BatchMatMul computation, the input and output shapes must meet the following mathematical relationship (ep = [object Object] and tp = [object Object]):
ReduceScatter by H axis (
[object Object]= 0):[object Object]: (E/ep, ep*C, M/tp)[object Object]: (E/ep, M/tp, H)[object Object]: (E/ep, 1, H/tp) for 3D and (E/ep, H/tp) for 2D when the pointer is not empty[object Object]: (E, C, H/tp)
ReduceScatter scenario by the C axis, that is, the scenario where
[object Object]is 1:[object Object]: (E/ep, ep*tp*C/tp, M/tp)[object Object]: (E/ep, M/tp, H)[object Object]: (E/ep, 1, H) for 3D and (E/ep, H) for 2D when the pointer is not empty[object Object]: (E, C/tp, H)
Data relationship description:
- For example, if
[object Object]is equal to E/tp and[object Object]is equal to E, it indicates that[object Object]= ep*[object Object], where[object Object]is an integer multiple of ep. Other relationships are similar to this. - The value range of E is [2, 512], and E is an integer multiple of ep.
- The value range of H is [1, 65535]. When
[object Object]is 0, H is an integer multiple of tp. - The value range of M/tp is [1, 65535].
- The value range of E/ep is [1, 32].
- ep and tp can only be 2, 4, 8, 16, or 32.
[object Object]and[object Object]cannot have the same name.- When C is greater than 0, its maximum value is the upper limit of the operator device memory. When yShardType is 1, C is an integer multiple of tp.
- MC2 operators cannot be called concurrently, nor can different MC2 operators.
- Cross-supernode operations are not supported.
- For example, if
The following example is for reference only. For details, see .
- [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: