Model Accuracy Tuning Guide
During the model quantization deployment process, high-precision computation data within the model is mainly mapped to corresponding low-precision representations. This brings gains in latency and bandwidth during edge deployment while minimizing the accuracy loss caused by quantization compression. Quantization error is the main factor affecting model accuracy. To minimize the accuracy loss caused by quantization, we provide you with tuning processes for both PTQ and QAT workflows.
Among them, the PTQ tuning process is universal across platforms. You can refer to the PTQ Model Accuracy Tuning section. The QAT tuning process, however, varies according to the hardware of different platforms. Below are the tuning processes for adapting the QAT workflow to various J6 platforms.
-
J6E/M Tuning Process
Based on the hardware characteristics of J6E/M, the main tuning configuration is mixed-precision quantization with int8 + int16. You can also try adding a small number of fp16 operators for further tuning. The specific tuning process is as follows:
-
J6H/P Tuning Process
Based on the hardware characteristics of J6H/P, the main tuning configuration is mixed-precision quantization with int8 + int16 + fp16. You can try adding more fp16 operators for further tuning. The specific tuning process is as follows:
On the J6H/P platform, more fp16 high-precision and GEMM-type dual int16 operator configurations are used. To make the configuration method simpler and more flexible, the QAT quantization tool provides a new qconfig quantization configuration template. For specific usage and precautions, refer to: https://developer.horizon.auto/blog/13112
By following the above processes for model accuracy tuning, you can reduce the accuracy loss caused by quantization. In subsequent sections, we will introduce in detail the quantization accuracy tuning methods for both PTQ and QAT workflows, and explain the specific operation processes of accuracy tuning methods with practical cases.
