[object Object][object Object][object Object]undefined
[object Object]
  • Description: Fuses [object Object] communication, [object Object] (to ensure contiguous memory addresses after communication), and [object Object] computation using a communication-before-computation sequence.
  • Formulas: Assume that the input [object Object] shape is [object Object], and [object Object] represents the number of NPUs.commOut=AlltoAll(x1.view(rankSize,BS/rankSize,H))permutedOut=commOut.permute(1,0,2).view(BS/rankSize,rankSizeH)output=permutedOut@x2+biascommOut = AlltoAll(x1.view(rankSize, BS/rankSize, H)) \\ permutedOut = commOut.permute(1, 0, 2).view(BS/rankSize, rankSize*H) \\ output = permutedOut @ x2 + bias \\
[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]
  • Parameter Description

    [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 BS used in the shape must be exactly divided by the number of NPUs.
  • The values of BS and N cannot exceed 2147483647 (INT32_MAX). The value of BS cannot be less than 0, and the value of N cannot be less than 1.
  • The H*rankSize range varies depending on the device model.
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: The value range is [1, 35000].
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] Ascend 950PR/Ascend 950DT: The value range is [2, 65535].
  • The support for empty tensors varies depending on the device model.
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: No empty tensor is supported.
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] / Ascend 950PR/Ascend 950DT: Only empty tensors with the first dimension (BS) of the input x1 being 0 are supported.
  • The support for non-contiguous tensors varies depending on the device model.
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]、[object Object]Atlas A3 training products/Atlas A3 inference products[object Object] : No non-contiguous tensor is supported.
    • Ascend 950PR/Ascend 950DT: Only x2 can be a non-contiguous tensor. Other non-contiguous tensors are not supported.
  • The data types of the input tensors x1 and x2 must be the same as those of the output tensors and alltoAllOutOptional. The input tensors x1, x2, and output are not null pointers.
  • The data type of biasOptional is restricted by the device model.
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]、[object Object]Atlas A3 training products/Atlas A3 inference products[object Object] : When the data type of the input tensors x1 and x2 is FLOAT16, the data type of the input tensor biasOptional can be FLOAT16. When the data type of the input tensors x1 and x2 is BFLOAT16, the data type of the input tensor biasOptional can be FLOAT32.
    • Ascend 950PR/Ascend 950DT: When the data type of the input tensors x1 and x2 is FLOAT16, the data type of the input tensor biasOptional can be FLOAT16 or FLOAT32. When the data type of the input tensors x1 and x2 is BFLOAT16, the data type of the input tensor biasOptional can be BFLOAT16 or FLOAT32.
  • MC2 operators cannot be called concurrently, nor can different MC2 operators.
  • Inter-super node communication is not supported. Only intra-super node communication is supported.
[object Object]

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

Note: This sample code calls some HCCL collective communication library APIs, including HcclGetCommName, HcclCommInitAll, and HcclCommDestroy. For details, see .

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

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

    [object Object]