This API will be deprecated in later versions. Use the latest API . For details about how to migrate the API, see below.
- Description: Performs quantized matrix multiplication, supporting 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:
Each operator has calls. First, aclnnQuantMatmulV2GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnQuantMatmulV2 is called to perform computation.
[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]
- Deterministic description:
- [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: aclnnQuantMatmulV2 defaults to a deterministic implementation.
To migrate this API to the aclnnQuantMatmulV4 API, perform the following steps:
- The inputs x1, x2, bias, adjX1, and adjX2 can be directly converted to x1, x2, bias, transposeX1, and transposeX2 in the aclnnQuantMatmulV4 API.
- The input deqScale is a UINT64 aclTensor, and has the same data type as scale in aclnnQuantMatmulV4. The deqScale shape of aclnnQuantMatmulV2 is one-dimensional (t,), where t = align(n, 16). The scale shape of aclnnQuantMatmulV4 is one-dimensional (t,), where t = 1 or n. aclnnTransQuantParamV2 can be called for the original FLOAT quantization parameters to get an output aclTensor, whose output data type is UINT64 and shape is (n,). (For details, see ). The value is recorded as scale, which is the same as scale in the aclnnQuantMatmulV4 API.
- Set the optional inputs offset and pertokenScaleOptional in the aclnnQuantMatmulV4 API to nullptr.
- Set the API parameters to
[object Object].
The following example is for reference only. For details, see .
[object Object]