[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 RmsNormQuant operator fuses the RmsNorm operator and the Quantize operator after RmsNorm to reduce move-in and move-out operations.
  • Formula:
quant_ini=xiRms(x)gammai+betai, where Rms(x)=1ni=1nxi2+epsilonquant\_in_i=\frac{x_i}{\operatorname{Rms}(\mathbf{x})} gamma_i + beta_i, \quad \text { where } \operatorname{Rms}(\mathbf{x})=\sqrt{\frac{1}{n} \sum_{i=1}^n x_i^2+epsilon} y=round((quant_inscale)+offset)y=round((quant\_in*scale)+offset) [object Object]

Each operator has calls. First, aclnnRmsNormQuantGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnRmsNormQuant is called to perform computation.

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

    [object Object]
    • [object Object]Atlas inference products[object Object] and [object Object]Atlas 200I/500 A2 inference products[object Object]: The data type of the input parameters [object Object], [object Object], [object Object] and [object Object] can only be FLOAT16.
    • For the [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 data type of the input parameters [object Object], [object Object], [object Object] and [object Object] can only be FLOAT16 and BFLOAT16, and the data type of [object Object] can only be INT8.
  • 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 .

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

  • Ascend 950PR/Ascend 950DT: When the data type of [object Object] is INT4, the last dimension of [object Object], [object Object], and [object Object] must be an even number.

  • Ascend 950PR/Ascend 950DT: When the data type of [object Object] is INT32, the last dimension of [object Object] must be 1/8 of the last dimension of [object Object].

  • 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] and [object Object]Atlas 200I/500 A2 inference products[object Object]:

      [object Object]undefined
    • Ascend 950PR/Ascend 950DT:

      [object Object]undefined
  • Deterministic compute:

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

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

[object Object]