[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs input matrix multiplication in a fake-quantization scenario and implements output quantization. Compared with the aclnnWeightQuantBatchMatmulV2 API, this API has the following changes:

    The innerPrecise parameter is added to support the selection of high-precision or high-performance compute mode. To improve performance in the A16W4 per_group scenario, this parameter can be set to 1 when batchSize is less than or equal to 16.

  • Formula:

    y=x@ANTIQUANT(weight)+biasy = x @ ANTIQUANT(weight) + bias

    In the formula, weightweight is the input of the fake-quantization scenario, and the dequantization formula ANTIQUANT(weight)ANTIQUANT(weight) is as follows:

    ANTIQUANT(weight)=(weight+antiquantOffset)antiquantScaleANTIQUANT(weight) = (weight + antiquantOffset) * antiquantScale

    When quantScaleOptional is configured, the output is quantized using the following formula:

    y=QUANT(x@ANTIQUANT(weight)+bias)=(x@ANTIQUANT(weight)+bias)quantScale+quantOffset\begin{aligned} y &= QUANT(x @ ANTIQUANT(weight) + bias) \\ &= (x @ ANTIQUANT(weight) + bias) * quantScale + quantOffset \\ \end{aligned}

    If quantScaleOptional is set to nullptr, the out is as follows:

    y=x@ANTIQUANT(weight)+biasy = x @ ANTIQUANT(weight) + bias
[object Object]

Each operator has calls. First, aclnnWeightQuantBatchMatmulV3GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnWeightQuantBatchMatmulV3 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]: aclnnWeightQuantBatchMatmulV3 defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
  • per_channel mode: To improve performance, you are advised to use the weight input after transpose. If the value range of m is [65, 96], antiquantScale of the UINT64/INT64 data type is recommended.

  • per_group mode: In the A16W4 scenario where batchSize is less than or equal to 16, you can set innerPrecise to 1 and set the weight data format to FRACTAL_NZ to improve performance, but the accuracy may drop.

[object Object]

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

[object Object]