- Description: The RmsNorm operator is a standardization operation commonly used in foundation models. Compared with the LayerNorm operator, the RmsNorm operator removes the part of subtracting the mean value. The AddRmsNormQuant operator fuses the Add operator before RmsNorm and the Quantize operator after RmsNorm to reduce move-in and move-out operations.
- Formula:
When divMode is True:
When divMode is False:
Each operator has calls. First, aclnnAddRmsNormQuantGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnAddRmsNormQuant is called to perform computation.
Parameters
[object Object][object Object]Atlas inference products[object Object]:
- Data type:
- The input parameters
[object Object],[object Object], and[object Object]and the output parameter[object Object]support only FLOAT16. - The input parameters
[object Object]and[object Object]support only FLOAT32. - The optional parameters
[object Object]and[object Object]support only INT32. - The output parameters
[object Object]and[object Object]support only INT8.
- The input parameters
- The input parameter
[object Object]supports only True.
- Data type:
[object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:
- Data type:
- The input parameters
[object Object],[object Object], and[object Object]and the output parameter[object Object]support only FLOAT16 and BFLOAT16. - The input parameters
[object Object]and[object Object]support only FLOAT32 and BFLOAT16. - The optional parameters
[object Object]and[object Object]support only INT32 and BFLOAT16. - The output parameters
[object Object]and[object Object]support only INT8.
- The input parameters
- The input parameter
[object Object]supports only True.
- Data type:
Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
[object Object]Atlas inference products[object Object]: The length of the norm axis of x1, x2, y1Out, y2Out, and xOut and the length of gamma, scales1, scales2Optional, zeroPoints1Optional, and zeroPoints2Optional must be greater than or equal to 32 bytes.
Data format description:
The ND format is recommended for all input and output tensors. If other data formats are used, the framework converts them into the ND format by default for processing.
The following table describes the data types supported by different product models.
[object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:
[object Object]undefined
[object Object]Atlas inference products[object Object]:
[object Object]undefined
Ascend 950PR/Ascend 950DT:
[object Object]undefined
Deterministic compute:
- aclnnAddRmsNormQuant defaults to a deterministic implementation.
The following example is for reference only. For details, see .