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

New format quant model support for MKLDNN #45416

Merged
merged 18 commits into from
Sep 5, 2022
Merged

New format quant model support for MKLDNN #45416

merged 18 commits into from
Sep 5, 2022

Conversation

yeliang2258
Copy link
Contributor

@yeliang2258 yeliang2258 commented Aug 25, 2022

PR types

New features

PR changes

Others

Describe

New format quant model support for MKLDNN

CPU:Intel(R) Xeon(R) Gold 6271C CPU @ 2.60GHz
Thread nums:1
Test modelhttps://github.com/PaddlePaddle/PaddleSlim/tree/develop/example/auto_compression/pytorch_yolo_series

yolov5

model Latency mAP
FP32 212.75 ms 37.4
INT8 149.77 ms 36.8

yolov6

model Latency mAP
FP32 355.43 ms 42.4
INT8 126.86 ms 41.1

yolov7

model Latency mAP
FP32 999.75 ms 51.1
INT8 545.14 ms 50.9

Copy link
Collaborator

@jiangjiajun jiangjiajun left a comment

Choose a reason for hiding this comment

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

这里的代码应该需要加上单测,解决代码测试覆盖率的问题

@yaomichael
Copy link

@wozna @jczaja can you help review this PR?

yghstill
yghstill previously approved these changes Aug 29, 2022
@jczaja jczaja requested a review from sfraczek August 30, 2022 08:07
@wozna
Copy link
Contributor

wozna commented Aug 30, 2022

@yaomichael @yeliang2258 I can see there are only changes in C++ passes. Are you planning to add this ONNX format to python/paddle/fluid/contrib/slim/quantization/quant2_int8_mkldnn_pass.py that serializes models?

@yeliang2258
Copy link
Contributor Author

@wozna According to the latest version, we only need to enable config.enable_mkldnn_int8(), no longer need to convert through save_quant_model.py script. So we no longer need to add codes to python/paddle/fluid/contrib/slim/quantization/quant2_int8_mkldnn_pass.py.

wozna
wozna previously approved these changes Sep 2, 2022
Copy link
Contributor

@wozna wozna left a comment

Choose a reason for hiding this comment

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

Thank you for adapting to the review. LGTM

jiangjiajun
jiangjiajun previously approved these changes Sep 2, 2022
Copy link
Collaborator

@jiangjiajun jiangjiajun left a comment

Choose a reason for hiding this comment

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

LGTM

@yeliang2258 yeliang2258 dismissed stale reviews from jiangjiajun and wozna via 79394a3 September 2, 2022 10:01
sfraczek
sfraczek previously approved these changes Sep 2, 2022
Copy link
Contributor

@sfraczek sfraczek left a comment

Choose a reason for hiding this comment

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

LGTM!

wozna
wozna previously approved these changes Sep 2, 2022
Copy link
Contributor

@wozna wozna left a comment

Choose a reason for hiding this comment

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

LGTM

@yeliang2258
Copy link
Contributor Author

leiqing1
leiqing1 previously approved these changes Sep 5, 2022
qingqing01
qingqing01 previously approved these changes Sep 5, 2022
Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

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

Approve for API

Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

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

Approve for API

@jiangjiajun jiangjiajun merged commit 4e4f458 into PaddlePaddle:develop Sep 5, 2022
Caozhou1995 pushed a commit to Caozhou1995/Paddle that referenced this pull request Sep 9, 2022
* support onnx format quantized model

* update code

* add test

* add test

* fix

* fix test

* fix cmake

* update code

* change scale file path to calibration file path

* update code

* update code

* fix build bug

* fix build bugs

* fix

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants