[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs matrix multiplication on the tensors self and mat2. mat2 supports only the AI processor affinity data layout format. self must be two-dimensional, and mat2 must be four-dimensional. Similar APIs include aclnnMatmul (mat2 supports only ND), aclnnMm (two-dimensional tensors can be used as the input of matrix multiplication), and aclnnBatchMatmul (only three-dimensional matrix multiplication is supported, whose first dimension is the batch dimension).
  • Formula:result=self@mat2result=self @ mat2
[object Object]

Each operator has calls. First, aclnnMatmulWeightNzGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMatmulWeightNz is called to perform computation.

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

    [object Object]
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]:
      • Before calling this API, use aclnnTransMatmulWeight to convert the original input format of mat2 from ND to the AI processor affinity data layout format.
  • Returns:

    aclnnStatus: 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]
  • Deterministic description:
    • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: aclnnMatmulWeightNz defaults to a deterministic implementation.
  • Compute consistency:
    • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]:
      • If strong consistency compute is enabled, the compute result is deterministic, meaning that multiple executions will generate the same result. In addition, the compute result is irrelevant to the data location.
      • aclnnMatmulWeightNz defaults to a non-consistent implementation. You can call aclrtCtxSetSysParamOpt to enable consistency compute.
      • For example, during matrix multiplication, the accumulation sequence of different basic blocks may be different. As a result, the computation results of the same data in different rows may be slightly different. However, when strong consistency compute is enabled, the results will remain consistent across rows as long as the inputs are the same. - If one input is BFLOAT16 and the other is FLOAT16, the data type cannot be deduced.
  • self supports only two dimensions, and mat2 supports only the AI processor affinity data layout format (NZ). Before calling this API, you must convert mat2 from ND to the AI processor affinity data layout format.
  • When any dimension of mat2 is 1 and mat2 is in non-contiguous NZ format, the precision and functionality are not guaranteed. That is, when k = 1 or n = 1, it is not supported to first convert mat2 to the NZ format and then perform any operations (such as transpose) on the tensor shape.
[object Object]
  • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data types of self and mat2 are float16. The sample code when mat2 is in AI processor affinity data layout format is as follows (for reference only). For details about the compilation and running process, see .

    [object Object]