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

add common conv depthwise optimization #9318

Merged
merged 3 commits into from
Aug 12, 2022

Conversation

lxwlaq
Copy link
Collaborator

@lxwlaq lxwlaq commented Aug 5, 2022

PR types

Performance optimization

PR changes

Others

Describe

此pr目的是优化stride不相等,dilation不为1,kernel size 不为 3x3 5x5等特殊depthwise conv,之前的做法是转换成矩阵乘计算,有多少group就调用多少次img2col,效率低下。本pr的优化采用直接计算的方式,性能比矩阵乘有显著提升,部分性能数据如下:

conv old new rate
input:1×32×128×128; weight:32×1×3×3 stride 2,1 2.88 0.51 82%
input:1×64×128×128; weight:64×1×3×3 stride 2,1 5.55 1 82%
input:1×32×256×256; weight:32×1×3×3 stride 2,1 28.79 3.35 88%
input:1×64×256×256; weight:64×1×3×3 stride 2,1 56.45 7.78 86%

@paddle-bot
Copy link

paddle-bot bot commented Aug 5, 2022

Thanks for your contribution!

Copy link
Contributor

@liyancas liyancas left a comment

Choose a reason for hiding this comment

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

LGTM

@lxwlaq lxwlaq merged commit eef0c0d into PaddlePaddle:develop Aug 12, 2022
QShiX pushed a commit to QShiX/Paddle-Lite that referenced this pull request Aug 13, 2022
* add common conv depthwise optimization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants