- Description: The RmsNorm operator is a normalization operation commonly used in foundation models. Compared with the LayerNorm operator, the RmsNorm operator removes the part of subtracting the mean value. The DynamicQuant operator is used to perform symmetric dynamic quantization on the input tensor. The AddRmsNormDynamicQuant operator fuses the Add operator before RmsNorm and the normalized output of RmsNorm to one or two DynamicQuant operators to reduce move-in and move-out operations.
- Formula:
- If smoothScale1Optional and smoothScale2Optional are not input, the outputs y2Out and scale2Out are meaningless. The calculation process is as follows:
- If only smoothScale1Optional is input, the outputs y2Out and scale2Out are meaningless. The calculation process is as follows:
- If both smoothScale1Optional and smoothScale2Optional are input, all the five outputs of the operator are valid. The calculation process is as follows:
row_max indicates that the maximum value of each row is calculated.
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
Parameters
[object Object]- [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] and [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:
- The output parameters
[object Object]and[object Object]support only INT8.
- The output parameters
- [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] and [object Object]Atlas A2 training products/Atlas A2 inference products[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]
Parameters
[object Object]Returns:
aclnnStatus: status code. (For details, see [aclnn Return Codes](../common/aclnn Return Codes.md).)
Description of supported types
Empty tensors: Empty input and output are supported.
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.
Description of data types supported by different product models
[object Object]Atlas A3 training products/Atlas A3 inference products[object Object] and [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:
[object Object]undefined
Ascend 950PR/Ascend 950DT:
[object Object]undefined
Deterministic compute:
- aclnnAddRmsNormDynamicQuant defaults to a deterministic implementation.
The following example is for reference only. For details, see .