-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Refactor dropout cuda impl for code reuse. #35621
Refactor dropout cuda impl for code reuse. #35621
Conversation
Thanks for your contribution! |
建议 Describe 里第 (2) 条描述稍微的详细一点。 |
LGTM |
Done. |
*(reinterpret_cast<LoadT*>(&dst[i])) = | ||
*reinterpret_cast<LoadT*>(&dest_vec[0]); | ||
*(reinterpret_cast<MaskLoadT*>(&mask_data[i])) = | ||
*reinterpret_cast<MaskLoadT*>(&mask_vec[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里在当前的devleop已经不是这样写了。注意下挪动后,不要修改了内容
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
… refactor-dropout-cuda-impl
PR types
Performance optimization
PR changes
OPs
Describe
Refactor dropout cuda impl for code reuse:
(1) Move dropout cuda forward impl in dropout_op.cu and backward impl in dropout_op.h to newly dropout_impl.cu.h;
(2) Originally, the backward impl for cpu and gpu share same code. To be more clear, they are separated into two pieces.
I extract the cuda backward impl from dropout_op.h and put them in dropout_impl.cu.h.
Now, all the cpu impl is in dropout_op.h and all the gpu impl is in dropout_impl.cu.h.
Unittest Results for dropout op: