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

Optimize BatchNorm1D backward #44783

Merged
merged 2 commits into from
Aug 3, 2022
Merged

Conversation

zkh2016
Copy link
Contributor

@zkh2016 zkh2016 commented Aug 1, 2022

PR types

Performance optimization

PR changes

OPs

Describe

优化BatchNorm1D在大batch_size下的反向性能,相关PR:优化BatchNorm1D前向性能

  1. 这个PR只对NC格式的反向进行优化
  2. 优化方法:将反向kernel拆分成三个kernel,每个kernel的并发度更高以得到更高的性能。
  3. 训练性能:以centerpoint模型训练情况,优化前Bn1D反向kernel占整体比重13.5%, 优化后只占1%。
  4. kernel耗时对比:其中paddle优化前在N<131070时走cudnn,否则走native kernel
shape torch(ns) paddle优化前(ns) paddle优化后(ns)
(126000, 16) 73,663.50 24,091,916.00 73,296.00
(136000, 32) 124,095.50 696,446.50 143,312.00
(215857, 32) 177,023.50 1,100,270.00 206,415.50
(215857, 64) 336,545.00 1,982,108.00 355,791.00
(143042, 64) 236,027.50 1,316,191.00 242,461.50
(62929, 64) 123,039.50 12,921,860.50 115,997.50

@paddle-bot
Copy link

paddle-bot bot commented Aug 1, 2022

你的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.

@zkh2016 zkh2016 changed the title Optimize BatchNorm1D backward [WIP]Optimize BatchNorm1D backward Aug 1, 2022
@zkh2016 zkh2016 changed the title [WIP]Optimize BatchNorm1D backward Optimize BatchNorm1D backward Aug 2, 2022
@zkh2016 zkh2016 merged commit 36f0882 into PaddlePaddle:develop Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants