Note: When using this API, ensure that the driver firmware package and CANN package are in the 8.0.RC2 version or later. Otherwise, an error, such as BUS ERROR, will be reported.
- Description: Integrates the MatMul computation and AllReduce communication.
- Formula:
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 flow. Then, [object Object] is called to perform computation.
Parameters
[object Object]Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic computation:
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: By default, aclnnMatmulAllReduce uses non-deterministic implementation. You can set the HCCL_DETERMINISTIC environment variable to true to enable deterministic computation.
- Ascend 950PR/Ascend 950DT:
[object Object]defaults to a deterministic implementation.
- MC2 is disabled in incremental scenarios but enabled in full scenarios.
- The input
[object Object]can be 2D or 3D with shape (m, k) or (b, s, k).[object Object]must be 2D with shape (k, n). The axes meet the input parameter requirements of the MatMul operator, and the k axes of[object Object]and[object Object]must be equal. If[object Object]is not empty, its shape is (n). - The values of b*s,
[object Object],[object Object], and[object Object]cannot exceed[object Object](INT32_MAX). - When the shape of the input
[object Object]is (b, s, k), the shape of[object Object]is (b, s, n). When the shape of the input[object Object]is (m, k), the shape of[object Object]is (m, n). - The data types of the inputs
[object Object],[object Object], and[object Object]must be the same as the data type of[object Object]. - Only the all-mesh networking of the HCCS link is supported.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: 1, 2, 4, and 8 ranks are supported.
- Ascend 950PR/Ascend 950DT: 1, 2, 4, 8, 16, 32, and 64 cards are supported.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: Only one communication domain for MC2 operators within a model is supported.
- Empty tensor support:
- The scenario where k is 0 is supported. In this case, the output is bias.
- When bs/m/n is 0, the input output should also be an empty tensor. In this case, the kernel is not executed and the result is directly returned.
The following example is for reference only. For details, see .
Note: This sample code calls some HCCL collective communication library APIs: HcclGetCommName, HcclCommInitAll, and HcclCommDestroy. For details, see .
[object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and Ascend 950PR/Ascend 950DT:
[object Object]