Skip to content

[cherry-pick] Remove gpu_cpu_reshape2_matmul_fuse_pass in EnableMkldnn#43750

Merged
ZeyuChen merged 1 commit intoPaddlePaddle:release/2.3from
lidanqing-vv:release/2.3-fix-resnet50-perf
Jun 23, 2022
Merged

[cherry-pick] Remove gpu_cpu_reshape2_matmul_fuse_pass in EnableMkldnn#43750
ZeyuChen merged 1 commit intoPaddlePaddle:release/2.3from
lidanqing-vv:release/2.3-fix-resnet50-perf

Conversation

@lidanqing-vv
Copy link
Copy Markdown
Contributor

@lidanqing-vv lidanqing-vv 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
Copy Markdown

你的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-vv lidanqing-vv 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-vv
Copy link
Copy Markdown
Contributor Author

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

@lidanqing-vv
Copy link
Copy Markdown
Contributor Author

lidanqing-vv 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
Copy Markdown

@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
Copy Markdown
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

@lidanqing-vv lidanqing-vv force-pushed the release/2.3-fix-resnet50-perf branch 2 times, most recently from b6e5d25 to dcde6eb Compare June 23, 2022 06:08
Copy link
Copy Markdown
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-vv lidanqing-vv 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