华为计算微信公众号
昇腾AI开发者公众号
华为计算微博
华为计算今日头条
量化后模型比量化前更慢
#fp32模型转换 atc --framework=5 --model=$model --input_shape=$input_shape --insert_op_conf=aipp-bgr.cfg --output=./outputs/$model_name --soc_version=Ascend310P3 --log=info #int8 模型转换 atc --framework=5 --model=$model --input_shape=$input_shape --insert_op_conf=aipp-bgr.cfg --output=./outputs/$model_name --compression_optimize=$cfg_name --soc_version=Ascend310P3 --log
aipp_op { aipp_mode : static input_format : RGB888_U8 src_image_size_w : 640 src_image_size_h : 640 csc_switch : false rbuv_swap_switch : true min_chn_0 : 0 min_chn_1 : 0 min_chn_2 : 0 var_reci_chn_0: 0.0039215686274509803921568627451 var_reci_chn_1: 0.0039215686274509803921568627451 var_reci_chn_2: 0.0039215686274509803921568627451}
enable_first_layer_quantization:true calibration: { input_data_dir: ./data/images/calibration.bin input_shape: images:1,3,640,640 infer_soc: Ascend310P3 log: info }
batch数 推理时间 1 13.8 int8量化 1 8.67 fp32
本帖最后由 匿名用户 于 2025/03/12 14:52:21 编辑
我要发帖子
问题
量化后模型比量化前更慢
复现流程
aipp_op { aipp_mode : static input_format : RGB888_U8 src_image_size_w : 640 src_image_size_h : 640 csc_switch : false rbuv_swap_switch : true min_chn_0 : 0 min_chn_1 : 0 min_chn_2 : 0 var_reci_chn_0: 0.0039215686274509803921568627451 var_reci_chn_1: 0.0039215686274509803921568627451 var_reci_chn_2: 0.0039215686274509803921568627451}enable_first_layer_quantization:true calibration: { input_data_dir: ./data/images/calibration.bin input_shape: images:1,3,640,640 infer_soc: Ascend310P3 log: info }