24 lines
1.0 KiB
Bash
24 lines
1.0 KiB
Bash
CONFIG=input/config.json
|
|
TASKID=$(python3 read_json.py $CONFIG task_id)
|
|
MARCH=$(python3 read_json.py $CONFIG quant.march)
|
|
OUTPUT=output/$TASKID
|
|
|
|
python3 load_config.py $CONFIG
|
|
echo "Convert PTQ YAML Haved been Prepared"
|
|
|
|
VISIONENCODER_YAML=$OUTPUT/ptq_yaml/VisionEncoder.yaml
|
|
TRANSFORMERLAYERS_YAML=$OUTPUT/ptq_yaml/TransformerLayers.yaml
|
|
|
|
if [[ "$MARCH" == *"nash"* ]]; then
|
|
echo -e "\033[44;37m===== Start Compiling TRANSFORMERLAYERS =====\033[0m"
|
|
hb_compile --config $TRANSFORMERLAYERS_YAML
|
|
echo -e "\033[44;37m===== Start Compiling TRANSFORMERLAYERS =====\033[0m"
|
|
hb_compile --config $VISIONENCODER_YAML
|
|
echo -e "\033[44;37m===== End Compiling Nash Model =====\033[0m"
|
|
else
|
|
echo -e "\033[44;37m===== Start Compiling TRANSFORMERLAYERS =====\033[0m"
|
|
hb_mapper makertbin --model-type onnx --config $TRANSFORMERLAYERS_YAML
|
|
echo -e "\033[44;37m===== Start Compiling VISIONENCODER =====\033[0m"
|
|
hb_mapper makertbin --model-type onnx --config $VISIONENCODER_YAML
|
|
echo -e "\033[44;37m===== End Compiling Bayes Model =====\033[0m"
|
|
fi |