ONNX量化

ONNX量化

https://onnxruntime.ai/docs/performance/model-optimizations/quantization.html
Quantization Overview
Quantization in ONNX Runtime refers to 8 bit linear quantization of an ONNX model.

During quantization, the floating point values are mapped to an 8 bit quantization space of the form: val_fp32 = scale * (val_quantized - zero_point)

scale is a positive real number used to map the floating point numbers to a quantization space. It is calculated as follows:

For asymmetric quantization:

scale = (data_range_max - data_range_min) / (quantization_range_max - quantization_range_min)

For symmetric quantization:

scale = max(abs(data_range_max), abs(data_range_min)) * 2 / (quantization_range_max - quantization_range_min)

zero_point represents zero in the quantization space. It is important that the floating point zero value be exactly representable in quantization space. This is because zero padding is used in many CNNs. If it is not possible to represent 0 uniquely after quantization, it will result in accuracy errors.

相关推荐
AI技术控1 天前
《Transformers are Inherently Succinct》论文解读:从“能表达什么”到“多紧凑地表达”
人工智能·python·深度学习·机器学习·自然语言处理
Robot_Nav1 天前
深度学习与强化学习面试八股文知识点汇总
人工智能·深度学习·强化学习
一颗牙牙1 天前
安装mmcv
开发语言·python·深度学习
paperClub1 天前
AACR 2026 · AI诊断:深度学习在肿瘤早期检测中的应用
人工智能·深度学习
AI医影跨模态组学1 天前
NPJ Precis Oncol(IF=8)中国科学院深圳先进技术研究院吴红艳教授等团队:深度可解释放射基因组学解析乳腺MRI肿瘤微环境
人工智能·深度学习·论文·医学·医学影像
大模型最新论文速读1 天前
05-15 · LLM 最新论文速览
论文阅读·人工智能·深度学习·机器学习·自然语言处理
数智工坊1 天前
【DINOv2论文阅读】:无需监督的通用视觉特征提取器——机器人VLA模型的“眼睛“基石
论文阅读·人工智能·深度学习·计算机视觉·transformer
一切皆是因缘际会1 天前
AI低代码开发实战:轻量化部署与多场景落地
人工智能·深度学习·低代码·机器学习·ai·架构
EnCi Zheng1 天前
09-斯坦福CS336作业 [特殊字符]
人工智能·pytorch·python·深度学习·神经网络
Hali_Botebie1 天前
【量化】Post-training quantization for vision transformer.
人工智能·深度学习·transformer