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

Optimize bilinear_interp backward #39423

Merged
merged 35 commits into from
Mar 14, 2022
Merged

Conversation

AshburnLee
Copy link
Contributor

@AshburnLee AshburnLee commented Feb 9, 2022

PR types

Performance optimization

PR changes

OPs

Describe

功能

优化nchw时的bilinear_interp_v2 后向计算

效果

下图是30个case中差于竞品的case优化前后表现:
截屏2022-03-09 16 55 34

结论

两个case差于竞品10% ,其他优于或打平

update Paddle USERNAME repo
@paddle-bot-old
Copy link

paddle-bot-old bot commented Feb 9, 2022

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

@paddle-bot-old
Copy link

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.

@AshburnLee AshburnLee closed this Mar 10, 2022
@AshburnLee AshburnLee reopened this Mar 10, 2022
@AshburnLee AshburnLee closed this Mar 10, 2022
@AshburnLee AshburnLee reopened this Mar 10, 2022
@lelelelelez lelelelelez reopened this Mar 10, 2022
@lelelelelez lelelelelez reopened this Mar 10, 2022
@@ -670,83 +670,100 @@ __global__ void KeBilinearInterpBwShareMemory(
}
}

__device__ __forceinline__ int idx(const size_t nc, const int height,
Copy link
Contributor

Choose a reason for hiding this comment

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

函数命名大驼峰

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

确定这里是&不是&&?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

操作数都是0或1,所以&和&& 均可

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM

@ZzSean ZzSean merged commit 9e1f762 into PaddlePaddle:develop Mar 14, 2022
@AshburnLee AshburnLee deleted the bilinear_bw branch March 14, 2022 11:37
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