-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Added support for quantization of fusion_gru #27518
Added support for quantization of fusion_gru #27518
Conversation
Thanks for your contribution! |
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.
Great work! 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.
LGTM
92bf678
to
28356f6
Compare
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
Could you separate this PR, and we can merge them ASAP. |
28356f6
to
0d4fc6d
Compare
@luotao1 |
@wangzhen-nlp 嗨,这是fusion_gru INT8 实现,你要review一下吗? |
@wojtuss Next time we can use fps as measurement. Because batch latency is latency for one batch which is 50 samples. |
PR types
New features
PR changes
OPs
Describe
This patch adds support for INT8 quantization of
fusion_gru
op. It includes commits from PR #27481 and provides the rest of functionality required for #27330.This patch adds also a test with transformation of a quant GRU model into int8 model. The saved int8 model can be used for testing accuracy and performance:
Performance benchmarking will make sense only after bumping up oneDNN version commit with an optimized GRU INT8 primitive, as the current oneDNN version provides unoptimized GRU INT8 kernel only. The oneDNN version will be updated most probably by the end of this week.
With these changes INT8 quantization of the
fusion_gru
op will be enabled. However, quantization of all the quantizable operators in the GRU model does not work yet because other operators likeconcat
does not support quantization with shift yet. For performance reasons it is desirable to have a sequence of quantized operators without dequantization/quantization in between, so support for quantization ofconcat
op with shift will be implemented as well. A PR with the changes should come by the end of this week as well.[Update]
Now the patch has updated oneDNN commit hash containing optimized version of GRU INT8 kernel. Here are the benchmark results of the saved GRU INT8 model on CLX 6248:
The command for GRU INT8 model benchmarking:
For GRU FP32 use the model from http://paddle-inference-dist.bj.bcebos.com/gru/GRU_eval_model_v2.tar.gz
There are still options to improve INT8 performance, we are working on them.