Note: This API will be deprecated in later versions. Use aclnnWeightQuantMatmulAllReduce and aclnnAddRmsNorm instead.
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: Performs the MatMul, AllReduce, addition, and RMSNorm computation in sequence.
- Formula:
[object Object]and[object Object]implement the same function in different ways. Select a proper operator based on your requirements.[object Object]: Two output tensor objects[object Object]and[object Object]need to be created to store the computation result.[object Object]: One output tensor[object Object]needs to be created. The results that would have been stored in the output tensor[object Object]in the original non-inplace scenario are directly written to the memory of the input tensor[object Object].
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:
[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]defaults to non-deterministic implementation. You can set the HCCL_DETERMINISTIC environment variable to true to enable deterministic computation.
The application scenario is the same as that of
[object Object]. MC2 is disabled in incremental scenarios but enabled in full scenarios.The input
[object Object]can be 2D or 3D with shape (b, s, k) or (s, k), respectively.[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. The range of b*s and[object Object]is [1, 2147483647], and the range of[object Object]and[object Object]is [1, 65535]. If[object Object]is not empty,[object Object]is 1D with shape (n).The input
[object Object]must be 3D with shape (b, s, n). When[object Object]is 2D, (b*s) of[object Object]equals[object Object]of[object Object]. The input[object Object]must be 1D with shape (n).The shape of
[object Object]is (1) in the per-tensor scenario, (1,n) or (n) in the per-channel scenario, and (ceil(k,antiquantGroupSize),n) in the per-group scenario. If[object Object]is not empty, the shape is the same as that of[object Object].The dimensions and data types of the outputs
[object Object]and[object Object]are the same as those of[object Object]. If[object Object]is not empty, the shape is equal to the last dimension of[object Object].The data type of
[object Object]must be int8 or int4. The data types of the inputs[object Object],[object Object],[object Object],[object Object],[object Object], and[object Object]must be the same.The
[object Object]matrix cannot be transposed. The[object Object]matrix can be transposed or not transposed.The value of
[object Object]falls in the range [32, min(k – 1, INT_MAX)] and must be a multiple of 32.1, 2, 4, and 8 ranks are supported, and only the all-mesh networking of HCCS links is supported.
Empty tensors with (b*s) and
[object Object]being[object Object]are supported. Empty tensors with[object Object]being[object Object]are not 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.
The following example is for reference only. For details, see .