[object Object][object Object][object Object]undefined
[object Object]
  • Description: Fuses matrix multiplication (MatMul) computation, data transposition (Permute) to ensure a contiguous memory data layout after communication, and AlltoAll collective communication. Computation is performed before communication.
  • Formulas: (Assume that the shape of [object Object] is [object Object], the shape of [object Object] is [object Object], and [object Object] indicates the number of NPU processors.)computeOut=x1@x2+biaspermutedOut=computeOut.view(BS,rankSize,H2/rankSize).permute(1,0,2)output=AlltoAll(permutedOut).view(rankSizeBS,H2/rankSize)computeOut = x1 @ x2 + bias \\ permutedOut = computeOut.view(BS, rankSize, H2/rankSize).permute(1, 0, 2) \\ output = AlltoAll(permutedOut).view(rankSize*BS, H2/rankSize)
[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 validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns

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

[object Object]
  • Deterministic computing is supported by default.
  • The number of NPUs (rankSize) varies depending on the device model:
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: 2, 4, or 8 NPUs are supported.
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: 2, 4, 8, or 16 NPUs are supported.
    • Ascend 950PR/Ascend 950DT: 2, 4, 8, or 16 NPUs are supported.
  • The variable H2 used in the shape must be exactly divided by the number of NPUs.
  • The value range of H1 is [1, 65535].
  • The product of BS and rankSize and the value of H2 cannot exceed 2147483647 (INT32_MAX). The value of BS cannot be less than 0, and the value of H2 cannot be less than 2.
  • The support for empty tensors varies according to the device model:
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: Empty tensors are not supported.
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: Only empty tensors whose first dimension (BS) of x1 is 0 are supported.
    • Ascend 950PR/Ascend 950DT: Only empty tensors whose first dimension (BS) of x1 is 0 are supported.
  • The support for non-contiguous tensors varies according to the device model:
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: Non-contiguous tensors are not supported.
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: Non-contiguous tensors are not supported.
    • Ascend 950PR/Ascend 950DT: Only x2 can be a non-contiguous tensor.
  • The data types of the input tensors x1 and x2 must be the same as that of the output tensor. The input tensors x1 and x2 and the output tensor cannot be null pointers.
  • The data type of biasOptional varies according to the device model:
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: When the output data type of the output is FLOAT16, the input data type of the biasOptional operation can be FLOAT16. When the output data type of the output is BFLOAT16, the input data type of the biasOptional operation can be FLOAT32.
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: When the input data type of the x1/x2 operation is FLOAT16, the input data type of the biasOptional operation can be FLOAT16. When the input data type of the x1/x2 operation is BFLOAT16, the input data type of the biasOptional operation can be FLOAT32.
    • Ascend 950PR/Ascend 950DT: When the input data type of the x1/x2 operation is FLOAT16, the input data type of the biasOptional operation can be FLOAT16 or FLOAT32. When the input data type of the x1/x2 operation is BFLOAT16, the input data type of the biasOptional operation can be BFLOAT16 or FLOAT32.
  • MC2 operators cannot be called concurrently, nor can different MC2 operators.
  • Inter-SuperPod communication is not supported. Only intra-SuperPod communication is supported.
[object Object]

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

Note: In this sample code, some HCCL collective communication library APIs are called, including HcclGetCommName, HcclCommInitAll, and HcclCommDestroy. For details, see .

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

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

    [object Object]