(Optional) Performs PDF statistics on the byte where the exponent bit of the input tensor is located, and performs lossless compression based on the PDF distribution. The compressed result can be stored in the HBM of the device or offloaded to the host.
Each operator is divided into two segments. . You must call the aclnnHansEncodeGetWorkspaceSize interface to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call the aclnnHansEncode interface to perform computation.
[object Object][object Object]
Parameter description:
- inputTensor (aclTensor*, computation input): input tensor to be compressed, aclTensor on the device. The data type can be FLOAT16, BFLOAT16, or FLOAT32. The size of data elements must be a multiple of 64 and greater than or equal to 32768. are supported. The can be ND.
- pdfRef (aclTensor*, computation input/output): probability density distribution of the bytes where the exponent bits of the inputTensor are located, aclTensor on the device. The data type can be INT32. The shape must be (1, 256). are supported. The can be ND.
- statistic (bool, input): whether to perform PDF statistics.
- reshuff (bool, input): whether to perform memory reshuffling on the encoding result of each core.
- mantissaOut (aclTensor*, output): mantissa output, which is an aclTensor on the device. The data type can be FLOAT16, BFLOAT16, or FLOAT32, which must be the same as that of inputTensor. are supported. The can be ND.
- fixedOut (aclTensor*, output): first segment of the compressed output, which is an aclTensor on the device. The data type can be FLOAT16, BFLOAT16, or FLOAT32, which must be the same as that of inputTensor. are supported. The can be ND.
- varOut (aclTensor*, output): output after the fixedOut is compressed, which is an aclTensor on the device. The data type can be FLOAT16, BFLOAT16, or FLOAT32, which must be the same as that of inputTensor. are supported. The can be ND.
[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
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]
None
The following example is for reference only. For details, see .