Four Steps for Precision Tuning
No. |
Step |
Description |
|---|---|---|
1 |
Set up a precision benchmark. |
Before tuning, set up benchmark data and optimization objectives. The benchmark includes hardware configuration, compiler, math library, and MPI library. A comprehensive evaluation of the precision benchmark is required to better analyze the causes of differences and precision changes after tuning. For example, the x86 platform uses the O3 compilation option, the implementation of precision loss is black-box with which Kunpeng cannot be consistent. The optimization objectives are the expected application precision objectives based on the current software and hardware architecture. Precision tuning is a long-term process. At the early stage, differences can be easily identified and effective tuning measures can be implemented, so obvious results can be achieved. However, the later stage you reach, the more difficult it is, the precision differences and tuning measures are more difficult to find, and the effect is weaker. Therefore, we suggest setting a reasonable precision target and a complete consistency cannot be the target. |
2 |
Identify the differences. |
Precision differences usually occur in compilation options, math library interfaces, and application code. Locating differences is to analyze data exceptions that occur during the running of the application. Generally, manual instrumentation, automatic static instrumentation tools, and dynamic instrumentation tools are used for this step. Many precision differences are caused by compilation options, math libraries and other factors that can be easily ignored. Therefore, it is recommended that you first spend some time in checking these factors during precision tuning. |
3 |
Implement tuning. |
After the differences are identified and located, we can perform the tuning. This document summarizes the common precision differences and tuning measures. Not all precision tuning measures have positive effects. Negative tuning (the precision deteriorates) occurs sometimes. Therefore, when preparing the tuning measures, prepare the rollback measures for the implemented tunings to avoid wasting time and resources to restore the environment due to some irreversible tuning measures. |
4 |
Confirm the optimization effects. |
After the tuning, restart the precision comparison test, prepare precision comparison tools, and confirm the optimization effects. Roll back the measures that have negative effects in time and adjust the tuning solution. If the optimization effects are positive but the objectives are not achieved, repeat step 2 "Identify the differences." If the objectives are achieved, summarize and archive all effective tuning measures and parameters, and prepare for the subsequent version release of the production system. |
The preceding four steps for precision tuning are recommended if you are not experienced in precision tuning. You can use other methods as well, if you are experienced.