-
Couldn't load subscription status.
- Fork 5.9k
Add configure of quantization for dynamic graph #48000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configure of quantization for dynamic graph #48000
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for setup.py.in
c12d15c
1. Fix typo 2. Create new directory for unitests of quantization 3. Import quanter to paddle.quantization package 4. Refine docs
c12d15c to
1697a31
Compare
…y to make the doc can be extracted from code 2. remvoe some __all__
ea5ddd0 to
7117556
Compare
7117556 to
da8092a
Compare
2. remove unused __all__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api文档有一些小问题,可以先合入,再补充中文文档
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
APIs
Describe
Add configure of quantization for dynamic graph
原PR: #47530
和之前有什么不同
整个量化功能可以分为两部分:
本次调整,将量化功能和API放在合适的位置:
之前,
现在,
当前PR为本次调整的部分工作
当前PR包括以下架构图中的QuantConfig, QuanterFactory和部分quanter

关键概念
Quanter
对OP的输入或输出执行量化操作。
ObserverFactory & QuanterFactory
QauntConfig
对ObserverFactory & QuanterFactory实例进行管理,存储模型量化配置的所有信息。
关键类设计
在执行量化操作之前,用户首先要配置量化相关的信息,主要是指定每层的各个输入使用什么Observer或Quanter.
配置功能主要涉及三个类:QuantConfig,SingleLayerConfig,ObserverFactory/QuanterFactory。以上三个类分别存储整个模型、单层和单个Observer的配置信息。他们之间是组合关系,QuantConfig实例中包含若干SingleLayerConfig实例,SingleLayerConfig实例包含若干ObserverFactory/QuanterFactory实例。