-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 layer norm backward cuda kernel when cols is 1024. #39247
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… fused_dropout_op_support_ln_fp16
Thanks for your contribution! |
… fused_dropout_op_support_ln_fp16
zkh2016
approved these changes
Jan 29, 2022
xingfeng01
approved these changes
Jan 29, 2022
sneaxiy
approved these changes
Jan 29, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Performance optimization
PR changes
OPs
Describe
(1) Optimize layer norm baward cuda kernel when cols is 1024.
(1) Optimize fused_dropout_residual_layer_norm op backward kernel when cols is 1024.
Performance results:
(1) for layer_norm op backward kernel:
结论:优化后相比优化前获得20%-50%性能提升;优化后相比竞品基本持平,有些case略有提升。
(2) for fused_dropout_residual_ln op backward kernel:
结论:相比竞品获得大约20%左右提升(因为竞品只是将dropout和dresidual计算融合,并没有融合layer_norm_grad,一共有3个kernel;优化后我们只有2个kernel)。