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

Memory optimization in convolution layer by the grouped im2col and gemm. #6802

Closed
wants to merge 5 commits into from

Conversation

qingqing01
Copy link
Contributor

@qingqing01 qingqing01 commented Dec 20, 2017

Fix #6801

  • Reduce the memory usage in convolution layer by grouped im2col+gemm.
    • Add a flag FLAGS_ conv_workspace_limit_in_mb to determine whether to enable this function.
  • Add unit testing.

@qingqing01
Copy link
Contributor Author

Except for the unit testing, also tested on the real model.

resizeBuffer<Device>(colShape.getElements());
size_t workspaceSize = colShape.getElements() * sizeof(real);
double memoryLimitBytes =
static_cast<double>(1LL << 20) * FLAGS_conv_workspace_limit_in_mb;
Copy link
Contributor

Choose a reason for hiding this comment

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

FLAGS_conv_workspace_limit_in_mb这个值,一般用户不会知道该如何设置。这么实现,可以减少临时内存的使用,但代码不够友好,使用起来也比较困难。基于这个思路,可以进一步优化实现,见#7034

@qingqing01 qingqing01 closed this Dec 27, 2017
@qingqing01 qingqing01 deleted the mobile_mem branch November 14, 2019 05:26
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