-
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 bilinear_interp backward #39423
Conversation
Update forked PaddlePaddle
Update my fork
update from PaddlePaddle
Update forked paddle repo
Update USERNAME/paddle
update Paddle USERNAME repo
update username repo
update local paddlepaddle
update paddlepaddle
Thanks for your contribution! |
Sorry to inform you that bd226d1's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@@ -670,83 +670,100 @@ __global__ void KeBilinearInterpBwShareMemory( | |||
} | |||
} | |||
|
|||
__device__ __forceinline__ int idx(const size_t nc, const int height, |
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.
函数命名大驼峰
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
@@ -1907,11 +1924,23 @@ static void Interpolate2DCUDABwd(const framework::ExecutionContext& ctx, | |||
ctx.cuda_device_context().stream()>>>( | |||
input_grad_data, in_h, in_w, output_grad_data, out_h, out_w, n, c, | |||
ratio_h, ratio_w, align_type_value, is_nchw); | |||
} else if (!optimize_flag & is_nchw) { |
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.
确定这里是&不是&&?
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.
操作数都是0或1,所以&和&& 均可
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 optimization
PR changes
OPs
Describe
功能
优化nchw时的bilinear_interp_v2 后向计算
效果
下图是30个case中差于竞品的case优化前后表现:
![截屏2022-03-09 16 55 34](https://user-images.githubusercontent.com/18277990/157407165-6b4954f9-cb17-409d-b9b0-6357e7ceedf0.png)
结论
两个case差于竞品10% ,其他优于或打平