Skip to content
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

[cherry-pick]Update quantization round and clip calculation methods #43829

Merged
merged 3 commits into from
Jun 27, 2022

Conversation

yghstill
Copy link
Contributor

PR types

Function optimization

PR changes

APIs

Describe

更新模型量化接口,包括如下内容: (cherry pick #42695 #43764 )

  • 在量化fp32->int时,新增支持rounding to nearest ties to even的四舍五入方式。
  • 修正量化取值范围,比如INT8量化时,数值范围从原先[-127, 127]的取值范围改变至[-128, 127]。
  • 量化旧格式保持原本计算不变的前提下新增round_type属性,可修改round和clip方式,默认模式不影响现有模型量化;量化新格式默认支持全新的round和clip方式,对齐onnx和trt,同时也新增round_type属性,可修改round和clip方式。

@paddle-bot-old
Copy link

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for PADDLE_ENFORCE

Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@XiaoguangHu01 XiaoguangHu01 merged commit ff70a26 into PaddlePaddle:release/2.3 Jun 27, 2022
@yghstill yghstill deleted the cp_quant_clip_round branch June 27, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants