Description: Divides the input tensor into blocks according to the given rowBlockSize and colBlockSize, and performs quantization at the block level. For each block, the quantization parameter scaleOut is computed, and the input is quantized accordingly. The final quantized output and scaleOut for each block are returned.
Formula:
Where block_reduce_max denotes taking the maximum value within each block.
Each operator has calls. First, aclnnDynamicBlockQuantGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation flow. Then, aclnnDynamicBlockQuant is called to perform computation.
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]:
[object Object]must be 0.[object Object]must be rint.[object Object]must be 2, indicating ACL_INT8.[object Object]must be 1.- The data type of
[object Object]must be INT8.
- [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]:
Returns
aclnnStatus: status code. For details, see .
The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic computation:
- aclnnDynamicBlockQuant defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[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]:
[object Object]