[object Object]

This API will be deprecated in later versions. Use the latest API . For details about how to migrate the API, see below.

[object Object][object Object]undefined
[object Object]
  • Description: Performs quantized matrix multiplication, supporting at least two-dimensional input and at most three-dimensional input.

    Similar APIs include aclnnMm (only 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:

out=(x1@x2+bias)deqScaleout = (x1@x2 + bias) * deqScale [object Object]

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

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

    [object Object]
  • 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]: aclnnQuantMatmul defaults to a deterministic implementation.

To migrate this API to the aclnnQuantMatmulV4 API, perform the following steps:

  • x1, x2, and bias can be directly converted to x1, x2, and bias in aclnnQuantMatmulV4.
  • If the input deqScale is of the FLOAT type, construct the FLOAT number into a FLOAT aclTensor with the shape of (1,) (for details, see CreateAclTensor in ). Then, use aclnnTransQuantParamV2 to convert the aclTensor into a uint64_t aclTensor with the shape of (1,) (for details, see ). Record it as scale, which corresponds to scale in aclnnQuantMatmulV4.
  • Set the optional input offset or pertokenScaleOptional of aclnnQuantMatmulV4 to nullptr, and set transposeX1 and transposeX2 to false.
  • Set the API parameters to [object Object].
[object Object]

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

[object Object]