[object Object]

[object Object][object Object]undefined
[object Object]
  • 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 AddRmsNorm operator integrates the Add operator before RmsNorm to reduce the move-in and move-out operations.
  • Formula:xi=x1i+x2ix_i=x1_{i}+x2_{i} RmsNorm(xi)=xiRms(x)gammai, where Rms(x)=1ni=1nxi2+epsilon\operatorname{RmsNorm}(x_i)=\frac{x_i}{\operatorname{Rms}(\mathbf{x})} gamma_i, \quad \text { where } \operatorname{Rms}(\mathbf{x})=\sqrt{\frac{1}{n} \sum_{i=1}^n x_i^2+epsilon}
[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 the [object Object], [object Object], [object Object], [object Object], and [object Object] parameters cannot be BFLOAT16.
      • The [object Object] parameter is invalid in the current product.
    • Ascend 950PR/Ascend 950DT:

      The shape of the [object Object] parameter must be the same as that of the last several dimensions of [object Object]. The last several dimensions are the dimensions that need to be normalized by [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]
[object Object]
  • Parameters

    [object Object]
  • Returns:

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

[object Object]
  • Description of boundary value scenarios:

    • When the input is Inf, the output is Inf.
    • When the input is NaN, the output is NaN.
  • The supported combinations of x1, x2, gamma, yOut, rstdOut, and xOut 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
  • Deterministic compute:

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

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

[object Object]