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] Remove gpu_cpu_reshape2_matmul_fuse_pass in EnableMkldnn #43750

Conversation

lidanqing-intel
Copy link
Contributor

@lidanqing-intel lidanqing-intel commented Jun 22, 2022

PR types

Others

PR changes

Others

Describe

Fix resnet50 performance drop issue

@paddle-bot-old paddle-bot-old bot added contributor External developers status: proposed labels Jun 22, 2022
@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.

@lidanqing-intel lidanqing-intel changed the title Remove gpu_cpu_reshape2_matmul_fuse_pass in EnableMkldnn [cherry-pick] Remove gpu_cpu_reshape2_matmul_fuse_pass in EnableMkldnn Jun 22, 2022
@lidanqing-intel
Copy link
Contributor Author

@wozna @yeliang2258 Please review this cherry-pick PR.

@lidanqing-intel
Copy link
Contributor Author

lidanqing-intel commented Jun 22, 2022

With this PR, performance results as follows. @yeliang2258 @jiangjiajun

Resnet50 FP32

KMP_BLOCKTIME=1 KMP_AFFINITY=granularity=fine,compact,1,0 GLOG_logtostderr=1 numactl -c 0 -m 0 ./build/sample_tester --infer_model=resnet50_fp32/model/ --infer_data=val_1000.bin     --batch_size=1     --num_threads=1     --iterations=0     --with_accuracy_layer=true    --use_analysis=true
I0622 08:32:15.652083 411584 sample_tester.cc:162] Model: resnet50_fp32/model/
I0622 08:32:15.652092 411584 sample_tester.cc:163] ====== num of threads: 1 ======
I0622 08:32:15.652096 411584 sample_tester.cc:164] ====== batch size: 1, iterations: 1000
I0622 08:32:15.652096 411584 sample_tester.cc:165] ====== batch latency: 50.0012ms, number of samples: 1000
I0622 08:32:15.652109 411584 sample_tester.cc:167] , sample latency: 50.0012ms, fps: 19.9995 ======
I0622 08:32:15.652285 411584 sample_tester.cc:309] Top1 accuracy: 0.7670
I0622 08:32:15.652299 411584 sample_tester.cc:311] Top5 accuracy: 0.9370

Resnet50 INT8

KMP_BLOCKTIME=1 KMP_AFFINITY=granularity=fine,compact,1,0 GLOG_logtostderr=1 ./build/sample_tester --infer_model=INT8     --infer_data=val_1000.bin     --batch_size=1     --num_threads=1     --iterations=0     --with_accuracy_layer=false    --use_analysis=true
I0622 08:33:34.907552 411585 sample_tester.cc:162] Model: INT8
I0622 08:33:34.907559 411585 sample_tester.cc:163] ====== num of threads: 1 ======
I0622 08:33:34.907562 411585 sample_tester.cc:164] ====== batch size: 1, iterations: 1000
I0622 08:33:34.907563 411585 sample_tester.cc:165] ====== batch latency: 13.4044ms, number of samples: 1000
I0622 08:33:34.907577 411585 sample_tester.cc:167] , sample latency: 13.4044ms, fps: 74.6022 ======
I0622 08:33:34.960709 411585 sample_tester.cc:309] Top1 accuracy: 0.7550
I0622 08:33:34.960731 411585 sample_tester.cc:311] Top5 accuracy: 0.9420

wozna
wozna previously approved these changes Jun 22, 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.

I can confirm that this PR should not influence on performance for any other model running with EnableMkldnn only for this Resnet50 int8 model.
LGTM

jiangjiajun
jiangjiajun previously approved these changes Jun 23, 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

Copy link
Member

@ZeyuChen ZeyuChen left a comment

Choose a reason for hiding this comment

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

LGTM

@ZeyuChen ZeyuChen merged commit 096eb80 into PaddlePaddle:release/2.3 Jun 23, 2022
@lidanqing-intel lidanqing-intel deleted the release/2.3-fix-resnet50-perf branch July 15, 2022 10:06
@paddle-bot-old paddle-bot-old bot removed the contributor External developers label Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants