API description: Dynamically quantizes the input data to float8 based on the start value of the input group index.
Formula:
- The input x is first grouped in dimension 0 based on groupIndex. Each group is further divided into k groups, where k is equal to blocksize. The quantization scale mxscale_pre and corresponding to the group of numbers are calculated using the following formulas (1) and (2).
- Each number in the group is divided by mxscale and converted to the corresponding dst_type based on round_mode to obtain the quantization result y. The calculation formula is as follows (3):
The quantized forms the output y according to the position of the corresponding . mxscale_pre is grouped based on the corresponding groupIndex. The first dimension in each group is padded with an even number, and the output mxscale is formed.
emax: exponent of the maximum positive regular number of the corresponding data type.
[object Object]undefined
Each operator has calls. You must call aclnnGroupedDynamicMxQuantGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnGroupedDynamicMxQuant to perform the computation.
Parameters
[object Object]Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]
- Deterministic computation:
- The aclnnGroupedDynamicMxQuant is implemented in deterministic mode by default.
The following example is for reference only. For details, see .