Skip to content

[LITE][OPENCL] Add opencl image2d conv3x3. test=develop#2853

Merged
ysh329 merged 5 commits into
PaddlePaddle:developfrom
ysh329:conv2d_3x3_opencl_image2d
Feb 13, 2020
Merged

[LITE][OPENCL] Add opencl image2d conv3x3. test=develop#2853
ysh329 merged 5 commits into
PaddlePaddle:developfrom
ysh329:conv2d_3x3_opencl_image2d

Conversation

@ysh329

@ysh329 ysh329 commented Feb 10, 2020

Copy link
Copy Markdown
Contributor

状态:等待review


  1. 增加image2d opencl conv3x3的kernel以及单测;
  2. 需要注意也是之前发现的一个问题:带group的情况,filter_dims不能自动指定,否则计算有误。下面是两个例子:
// small scale with group
                const int stride = 2;
                const int group = 2;
                const int batch_size = 1;
                const int ic = 1;
                const int ih = 3;
                const int iw = 3;
                const int oc = 2;
// big scale with group
                const int stride = 1;
                const int group = 32;
                const int batch_size = 1;
                const int ic = 32;
                const int ih = 112;
                const int iw = 112;
                const int oc = 32;

// 注意下面这里
int filter_channel = ic;
if (group > 1) {
  filter_channel = 1;
}

以上两种带group的情况,在单测中的计算都是正确的。

注:convOp和DepthwiseOp都是卷积,DepthwiseOp是ConvOp的一种特殊情况,而分组卷积,和Depthwise又不一样。

@smilejames smilejames left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

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.

2 participants