-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Embedding quantization #4159
Conversation
Thanks for your contribution! |
Codecov Report
@@ Coverage Diff @@
## develop #4159 +/- ##
===========================================
- Coverage 36.39% 36.38% -0.02%
===========================================
Files 419 419
Lines 59059 59089 +30
===========================================
+ Hits 21496 21499 +3
- Misses 37563 37590 +27
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
self.quant(input_dir, args.strategy) | ||
elif args.strategy == "qat": | ||
output_dir_list = self.quant(input_dir, "ptq") | ||
print(output_dir_list) |
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.
print可以删除
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.
感谢提醒,已经删除
@@ -138,7 +153,7 @@ def _dynabert(self, model, output_dir): | |||
ofa_model = _dynabert_training( | |||
self, ofa_model, model, teacher_model, train_dataloader, eval_dataloader, args.num_train_epochs | |||
) | |||
|
|||
self.reset_optimizer_and_scheduler() |
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.
这里reset优化器和学习率的原因是什么了?
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.
这里是dynabert的部分,训练完毕后reset 了优化器和学习率,目的是如果后面接入了 qat,防止qat的优化器和学习率是接着dynabert的部分来的而不是自己独立的从头开始。
|
||
input_dir = os.path.dirname(input_prefix) | ||
|
||
paddle.fluid.io.save_inference_model( |
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.
这里建议不要再使用fluid相关的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.
目前只有这个 API 可以直接使用,新版本的paddle.static.save_inference_model
输入需要feed_var
,fluid API 只需要feed_var_names
,而feed_var_names
可以通过上面load_inference_model
给出
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
Description
Add Embedding quantization