[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs backpropagation of . It is used to compute the gradient of RmsNorm, that is, compute the gradient of the input tensor during backpropagation.

  • Formula:

    • Forward propagation:
    RmsNorm(xi)=1Rms(x)xigi, where Rms(x)=1ni=1nxi2+eps\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}
    • Backward propagation:
    dxi=(dyigi1Rms(x)xiMean(y))1Rms(x), where Mean(y)=1ni=1n(dyigixi1Rms(x))dx_i= (dy_i * g_i - \frac{1}{\operatorname{Rms}(\mathbf{x})} * x_i * \operatorname{Mean}(\mathbf{y})) * \frac{1} {\operatorname{Rms}(\mathbf{x})}, \quad \text { where } \operatorname{Mean}(\mathbf{y}) = \frac{1}{n}\sum_{i=1}^n (dy_i * g_i * x_i * \frac{1}{\operatorname{Rms}(\mathbf{x})}) dgi=1Rms(x)xidyidg_i = \frac{1}{\operatorname{Rms}(\mathbf{x})} * x_i * dy_i
[object Object]

Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation 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], 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 [object Object]: status code. For details, see .

[object Object]
  • [object Object]Atlas inference products[object Object]: The length of the last axis of the inputs [object Object], [object Object], and [object Object] must be greater than or equal to 32 bytes.

  • Description of data types supported by different products:

    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], and Ascend 950PR/Ascend 950DT:

      [object Object]undefined
    • [object Object]Atlas inference products[object Object]:

      [object Object]undefined
  • Deterministic compute:

    • aclnnRmsNormGrad defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
[object Object]

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

[object Object]