666DZY666 / micronet

micronet, a model compression and deploy lib. compression: 1、quantization: quantization-aware-training(QAT), High-Bit(>2b)(DoReFa/Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference)、Low-Bit(≤2b)/Ternary and Binary(TWN/BNN/XNOR-Net); post-training-quantization(PTQ), 8-bit(tensorrt); 2、 pruning: normal、regular and group convolutional channel pruning; 3、 group convolution structure; 4、batch-normalization fuse for quantization. deploy: tensorrt, fp32/fp16/int8(ptq-calibration)、op-adapt(upsample)、dynamic_shape
MIT License
2.2k stars 478 forks source link

如何进行定点化测试 #61

Open Baymax-chen opened 3 years ago

Baymax-chen commented 3 years ago

大佬您好,感谢您提供的资料! 受益匪浅。 由于刚入门量化工作,想向您请教一下,在用IAO方法进行伪量化训练后,保存的模型实质上还是浮点数。请问如何转为定点数模型?并用定点输入对定点模型进行测试呢? 在bn_folding中没有找到合适的方法,烦请指教!谢谢!

666DZY666 commented 3 years ago

量化部署推理这部分确实还需要完善。三/二值适合在fpga/asic上部署,这部分参数后处理/推理仿真已有。高位量化(8-bit、4-bit)适合在通用cpu/gpu上部署,后续会加入:1、量化推理仿真;2、量化训练后接到推理框架(tensorrt/mnn等)部署。你提到的转换和测试包含其中。