The hb_config_generator Tool

The hb_config_generator is used to support you in obtaining the simplest yaml configuration file and yaml configuration file with all parameter defaults during model compiling. Among them:

  • The simplest yaml configuration file contains the minimal parameter configuration which you can use to quickly verify that the model conversion process performs properly.
  • The yaml configuration files with all parameter defaults contains all the parameters that have default values when the model is compiled.

Usage

Usage: hb_config_generator [OPTIONS]

Options:
  -h, --help               Show this message and exit.
  -s, --simple-yaml        Generate simple yaml template file
  -f, --full-yaml          Generate full yaml template file
  -m, --model TEXT         Model to be compiled
  -p, --proto TEXT         Caffe model proto file
  --march [nash-b-lite|nash-b|nash-b-plus|nash-e|nash-h|nash-m|nash-p]  
                           BPU micro arch

Parameters Introduction

Parameter NameParameter Description
-h, --helpDisplays help information.
-s, --simple-yamlGenerate a simplest yaml configuration file that you can use to quickly verify that the model conversion performs properly.
-f, --full-yamlGenerate a yaml configuration file containing all the default values of the parameters.
-m, --modelCaffe or ONNX model file.
-p, --protoSpecify the Prototxt file of the Caffe model.
--marchBPU's micro architectures.
  • for J6B processor, you should specify it to nash-b-lite or nash-b or nash-b-plus based on reality.
  • for J6E processor, you should specify it to nash-e.
  • for J6M processor, you should specify it to nash-m.
  • for J6H processor, you should specify it to nash-h.
  • for J6P processor, you should specify it to nash-p.

Usage Example

  1. Generate a simplest yaml configuration file:
hb_config_generator --simple-yaml
  1. Generate a simplest yaml configuration file based on model information:
hb_config_generator --simple-yaml --model model.onnx --march nash-e
  1. Generate a yaml configuration file containing all the default values of the parameters:
hb_config_generator --full-yaml 
  1. Generate a yaml configuration file containing all the default values of the parameters based on model information:
hb_config_generator --full-yaml --model model.onnx --march nash-e

Output Contents

The hb_config_generator command will generate the simplest yaml configuration file or the yaml configuration file with default values for all parameters, depending on your configuration.

Attention

Please note that you need to modify the default values in the yaml file that contained the full parameter defaults to your current reality before you can use it.