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]:
[object Object]defaults to a 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.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:
- 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]are 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 inputs
[object Object],[object Object], and[object Object]must be the same as the data type of[object Object]. The input[object Object],[object Object],[object Object], or[object Object]cannot be a null pointer. - 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 NPUs 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.
- Support for empty tensors:
- The scenario where k is 0 is supported. The output is bias + x3.
- The scenario where bs/m/n is 0 is supported. In this case, the input output should also be an empty tensor. In this scenario, the kernel calculation is not performed 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]