[object Object]

[object Object][object Object]undefined
[object Object]
  • 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 normalized output of RmsNorm to one or two Quantize operators to reduce move-in and move-out operations. Compared with AddRmsNormQuant, the AddRmsNormQuantV2 operator adds the betaOptional parameter (that is, [object Object] in the formula) to the RmsNorm computation process.

  • Formula:

    xi=x1i+x2ix_i={x1}_i+{x2}_i yi=1Rms(x)xigammai+beta, where Rms(x)=1ni=1nxi2+epsilony_i=\frac{1}{\operatorname{Rms}(\mathbf{x})} * x_i * gamma_i + beta, \quad \text { where } \operatorname{Rms}(\mathbf{x})=\sqrt{\frac{1}{n} \sum_{i=1}^n x_i^2+epsilon} rmsNormOuti=1Rms(xi)xigammairmsNormOut_i=\frac{1}{\operatorname{Rms}(x_i)} * x_i * gamma_i
    • When divMode is True:

      y1Out=round((y/scales1)+zeroPoints1Optional)y1Out=round((y/scales1)+zeroPoints1Optional) y2Out=round((y/scales2)+zeroPoints2Optional)y2Out=round((y/scales2)+zeroPoints2Optional)
    • When divMode is False:

      y1Out=round((yscales1)+zeroPoints1Optional)y1Out=round((y*scales1)+zeroPoints1Optional) y2Out=round((yscales2)+zeroPoints2Optional)y2Out=round((y*scales2)+zeroPoints2Optional)
[object Object]

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.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
    • [object Object]Atlas inference products[object Object]: The data types of [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] cannot be BFLOAT16.
  • 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]
  • Parameters

    [object Object]
  • Returns:

    aclnnStatus: status code. (For details, see [aclnn Return Codes](../common/aclnn return codes.md).)

[object Object]
  • [object Object]Atlas inference products[object Object]: The number of dimensions to be normalized in [object Object] and [object Object] must be greater than or equal to 32. The number of [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] data records cannot be less than 32.

  • The supported scenarios and combinations of gamma, scales1, scales2Optional, zeroPoints1Optional, zeroPoints2Optional, betaOptional, divMode, y1Out, y2Out, xOut, and rmsNormOut are as follows:

    • [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
  • Description of boundary value scenarios:

    • [object Object]Atlas inference products[object Object]: The input cannot contain inf and NaN.
    • [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]: When the input is inf, the output is inf. When the input is NaN, the output is NaN.
  • Dimension boundary description:

    The size of each dimension in the shape of [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] must be less than or equal to the maximum value 2147483647 of INT32.

  • 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 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
  • Deterministic compute:

    • aclnnAddRmsNormQuantV2 defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]