-
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
【PFCC算子性能优化】为Paddle优化adaptive_pooling_op性能 #45959
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -92,12 +92,12 @@ class AvgPoolGrad { | |||
*/ | |||
HOSTDEVICE inline int AdaptStartIndex(int ph, int input_size, int output_size) { | |||
return static_cast<int>( | |||
floor(static_cast<double>(ph * input_size) / output_size)); | |||
floor(static_cast<float>(ph * input_size) / output_size)); |
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.
之前优化的时候没想到这里可以有性能提升,Good one!
const int padding_width, | ||
T1* output_data, | ||
T2* mask_data, | ||
FastDivModForPooling divmods) { |
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.
divmods
这参数在计算中没有采用,可以删除,或者想采用的话可以替换 Line1986-1987中的计算div 和 mod计算.
const int stride_width, | ||
const int padding_height, | ||
const int padding_width, | ||
FastDivModForPooling divmods, |
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.
divmods
参数使用的建议同下
这些建议留在反向的PR中修改吧 |
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.
LGTM
好的 |
PR types
Performance optimizationPR changes
OPsDescribe
TODO