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

opt 1x1 conv adreno kernel #5904

Merged
merged 3 commits into from
Apr 21, 2021
Merged

Conversation

daming5432
Copy link
Collaborator

@daming5432 daming5432 commented Apr 14, 2021

1、添加分块h1w5c1 h1w7c1 h2w2c2三个1x1 kernel。
2、将1x1分块纳入tuning当中。
c40140f92e3f50813c9f21b9b03d2c04
本pr中的尚未能将kernel名字、global_work_size、local_work_size保存为bin文件,暂不能merge。

@paddle-bot-old
Copy link

Thanks for your contribution!

kernel_key.str("");
kernel_key << kernel_func_names_[0] << build_options_[0] << time_stamp_;
kernel_ = context.cl_context()->GetKernel(kernel_key.str());
if (kernel_func_names_[0] == "conv2d_1x1_h1w5c1") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

SetLocalWorkSize 函数中只计算 local_work_size,global_work_size 相关的代码需要移出到 SetGlobalWorkSize 函数中

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

现在的情况是一开始不能确定函数名是啥。函数名确定golobal_work_size_,有了global_work_size_再去确定local_work_size。tuning后确定了函数名其他的也就都确定了。我再想想看看能不能剥离或者更改SetLocalWorkSize名字

Copy link
Collaborator

Choose a reason for hiding this comment

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

直接把对w_blk_的赋值放在SetGlobalWorkSize函数中就可以吧。

if (kernel_func_names_[0] == "conv2d_1x1_h1w5c1") {
  w_blk_ = UP_DIV(default_w_blk_, 5);
}
...

Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

LGTM

@daming5432 daming5432 merged commit b57bec6 into PaddlePaddle:develop Apr 21, 2021
@daming5432 daming5432 deleted the mbv1_speed branch April 21, 2021 08:35
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