Model Performance Analysis

This section describes how to use the hb_compile tool provided by Horizon to evaluate the model performance.

Use thehb_compile tool

The hb_compile tool provided by Horizon supports the model conversion, for the usage of the tool and the related specific configurations and parameters, please refer to the Model Quantized Compilation.

After the model conversion completed, the model static performance evaluation files(the model.html with the better readability and the model.json) of the BPU part of the model predicted by the compiler will be generated under the working_dir path specifed by the yaml file.

Call the API Interface

You can also call the API interface for model analysis. The reference commands are listed below:

from hbdk4.compiler import hbm_perf hbm_perf("model.hbm")
Attention

Please note that this model.hbmis for example only, for actual use, please replace it with the correct path of the model you are using.

Upon successful execution, basic information such as model FPS will be printed within the terminal, and at the same time, a static performance evaluation file for the model will be generated in the directory where the API interface is currently called:

|-- model.html # Static performance evaluation files (better readability) |-- model.json # Static performance evaluation file

You can select either the model.html or the model.json to view the static performance data for the BPU part.