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

replace dropout_grad implementation with cuda kernel #39795

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

zhangting2020
Copy link
Contributor

@zhangting2020 zhangting2020 commented Feb 22, 2022

PR types

Performance optimization

PR changes

OPs

Describe

replace dropout_grad implementation with cuda kernel

修改点:将原来的eigen kernel移除

  • 反向算子某些分支等价于scale,使用ScaleFunctor和Elementwise模版去优化。同时为了保证fp16下的算子精度,修改了已有的ScaleFunctor,计算采用fp32,结果转为fp16
  • 反向算子中部分分支,原来是对输出乘以0,使用cudaMemset置0

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@AnnaTrainingG AnnaTrainingG 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
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM,建议把优化前后的性能变化补充在PR中

@zhangting2020 zhangting2020 merged commit 64f1485 into PaddlePaddle:develop Feb 25, 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.

3 participants