[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: The RmsNorm operator is a normalization operation commonly used in foundation models. The AddRmsNormCast operator fuses the Cast operator after AddRmsNorm to reduce move-in and move-out operations.
  • Formula:xi=x1i+x2ix_i=x1_{i}+x2_{i} y2Out=RmsNorm(xi)=1Rms(x)xigi, where Rms(x)=1ni=1nxi2+epsy2Out=\operatorname{RmsNorm}(x_i)=\frac{1}{\operatorname{Rms}(\mathbf{x})} * x_i *g_i, \quad \text { where } \operatorname{Rms}(\mathbf{x})=\sqrt{\frac{1}{n} \sum_{i=1}^n x_i^2+eps} y1Out=float(y2Out)y1Out=float(y2Out)
[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]
  • 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:

    [object Object]: status code. For details, see .

[object Object]
  • Dimension boundary description:

    The size of each dimension in the shape of thex1, x2,gamma, y1Out, y2Out, rstdOut, and xOut parameters cannot be greater than the maximum value 2147483647 of INT32.

  • Description of boundary value scenarios:

    • When the input is Inf, the output is Inf.
    • When the input is NaN, the output is NaN.
  • Deterministic compute:

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

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

[object Object]