GemmConvMobileFunction(optimized for mobile)#7034
Merged
hedaoyuan merged 6 commits intoPaddlePaddle:developfrom Dec 29, 2017
Merged
GemmConvMobileFunction(optimized for mobile)#7034hedaoyuan merged 6 commits intoPaddlePaddle:developfrom
hedaoyuan merged 6 commits intoPaddlePaddle:developfrom
Conversation
qingqing01
reviewed
Dec 27, 2017
paddle/function/GemmConvOp.cpp
Outdated
| size_t colWidth = outputHeight * outputWidth; | ||
| // Max col matrix height 256, Max col matrix width 1024 | ||
| size_t stepColHeight = std::min(colHeight, (size_t)256); | ||
| size_t stepColWidth = std::min(colWidth, (size_t)2048); |
Contributor
There was a problem hiding this comment.
static_cast<size_t>(256)
static_cast<size_t>(2048)| for (size_t filterWidth : {3, 7}) { | ||
| for (size_t stride : {1, 2}) { | ||
| for (size_t padding : {0, 1}) { | ||
| for (size_t dilation : {1, 3}) { |
Contributor
There was a problem hiding this comment.
Maybe the test case can be reduced to speed up the unit testing time.
paddle/function/Im2Col.h
Outdated
| (imRowIdx - paddingHeight) >= inputHeight || | ||
| (imColIdx - paddingWidth) < 0 || | ||
| (imColIdx - paddingWidth) >= inputWidth) { | ||
| colData[colh * colWidthSize + colw] = T(0); |
| outputWidth}); | ||
|
|
||
| resizeBuffer<Device>(stepColHeight * stepColWidth * sizeof(real)); | ||
| colData = reinterpret_cast<real*>(memory_->getBuf()); |
Contributor
There was a problem hiding this comment.
I see that the memory_ is not released in every layer. Do you think the if at most 2M extra workspace is used in every layer, we do not need to release it?
Contributor
Author
There was a problem hiding this comment.
Done. Add release the memory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6801 #6802
#6802 (review)