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

[NPU] delete useless GELU in gelu grad npu op #33872

Merged
merged 4 commits into from
Jul 4, 2021

Conversation

pangyoki
Copy link
Contributor

@pangyoki pangyoki commented Jun 30, 2021

PR types

Performance optimization

PR changes

OPs

Describe

In the original implementation of gelu grad op, GELU NPU OP is used to calculate an intermediate variable named out. However, we found that this variable was not actually used. In order to improve performance, the useless GELU operation was deleted.

  • unittest result

图片

图片

  • timeline of gelu grad op
    Before:
    图片
    After:
    图片

  • model performance
    29491 tokens/s -> 30101 tokens/s, about 2.1% performance improvement.

@paddle-bot-old
Copy link

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

@pangyoki pangyoki changed the title [NPU] delete useless GELU in gelu npu op [NPU] delete useless GELU in gelu grad npu op Jun 30, 2021
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@phlrain phlrain self-requested a review July 2, 2021 13:51
@pangyoki pangyoki merged commit 4d16724 into PaddlePaddle:develop Jul 4, 2021
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