HAT is capable of compiling fixed-point models to make the compiled Pytorch models suitable for on-board running. Users can choose to compile the model as described in the next section.
This method uses the script tools/compile_perf.py to compile the model obtained from model and model_convert_pipeline in int_infer_trainer into hbm with the following command.
This command will get the compilation-related configurations from the compile_cfg field in the config file, as illustrated by the following example:
When the compilation is complete, the following files are generated.
tmp_compile/model.hbm: Compiled model file.
tmp_compile/model.hbir: Intermediate representation of the model used in the compilation process.
perf_results/example_model.json, perf_results/example_model.html: Information related to the on-board model saved in different formats, e.g., running speed, resource usage, etc.