[object Object]

Note: This API will be deprecated in later versions. Use aclnnMatmulAllReduce and aclnnAddRmsNorm instead.

[object Object][object Object]undefined

Note: When using this API, ensure that the driver firmware package and CANN package are in the 8.0.RC2 version or later. Otherwise, an error, such as BUS ERROR, will be reported.

[object Object]
  • Description: Performs the MatMul, AllReduce, addition, and RMSNorm computation in sequence.
  • Formula:mm_out=allreduce(x1@x2+bias)mm\_out = all_reduce(x1 @ x2 + bias) y=mm_out+residualy = mm\_out + residual normOut=yRMS(y)gamma,RMS(y)=1di=1dyi2+epsilonnormOut = \frac{y}{RMS(y)} * gamma, RMS(y) = \sqrt{\frac{1}{d} \sum_{i=1}^{d} y_{i}^{2} + epsilon}
[object Object]
  • [object Object] and [object Object] implement the same function in different ways. Select a proper operator based on your requirements.

    • [object Object]: Two output tensor objects [object Object] and [object Object] need to be created to store the computation result.
    • [object Object]: One output tensor [object Object] needs to be created. The results that would have been stored in the output tensor [object Object] in the original non-inplace scenario are directly written to the memory of the input tensor [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]
  • 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]
  • Deterministic computation:

    • [object Object] defaults to non-deterministic implementation. You can set the HCCL_DETERMINISTIC environment variable to true to enable deterministic computation.
  • The application scenario is the same as that of [object Object]. MC2 is disabled in incremental scenarios but enabled in full scenarios.

  • The input [object Object] can be 2D or 3D with shape (m, k) or (b, s, k). [object Object] must be 2D with shape (k, n). The axes meet the input parameter requirements of the MatMul operator, and the k axes of [object Object] and [object Object] are equal. If [object Object] is not empty, it must be 1D with shape (n).

  • The values of b*s, [object Object], [object Object], and [object Object] cannot exceed [object Object] (INT32_MAX).

  • The input [object Object] must be 3D with shape (b, s, n). When [object Object] is 2D, (b*s) of [object Object] equals [object Object] of [object Object]. The input [object Object] must be 1D with shape (n).

  • The shapes and data types of the outputs [object Object] and [object Object] are the same as those of [object Object], with the shape (b, s, n).

  • The data types of the inputs [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], and [object Object] must be the same.

  • The [object Object] matrix cannot be transposed. The [object Object] matrix can be transposed or not transposed.

  • 1, 2, 4, and 8 ranks are supported, and only the all-mesh networking of HCCS links is supported.

  • Empty tensors with (b*s) and [object Object] being [object Object] are supported. Empty tensors with [object Object] being [object Object] are not supported.

  • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: Only one communication domain for MC2 operators within a model is supported.

[object Object]

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

  • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]:
[object Object]