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 products/Atlas A3 inference products[object Object]:
[object Object]must be rint.[object Object]must be 2, indicating ACL_INT8.[object Object]must be 1.- The
[object Object]parameter supports only the value 128. - The data type of
[object Object]must be INT8.
- Ascend 950PR/Ascend 950DT:
- The
[object Object],[object Object]and[object Object]parameters support only 2D shapes. - The value of the
[object Object]parameter is mapped to the data type of the[object Object]parameter as follows:- When the output
[object Object]data type is HIFLOAT8, the[object Object]parameter can be set to round. - When the output
[object Object]data type is FLOAT8_E4M3FN or FLOAT8_E5M2, the[object Object]parameter can be set to rint.
- When the output
- The
[object Object]parameter can be set to 34, 35, or 36, which represent HIFLOAT8, FLOAT8_E5M2, and FLOAT8_E4M3FN, respectively. - The
[object Object]data type does not support INT8.
- The
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:
Returns
[object Object]: 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 products/Atlas A3 inference products[object Object]:
[object Object]Ascend 950PR/Ascend 950DT:
[object Object]