-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Reduce memory usage in conv layer and RoI layer for mobile inference. #6659
Conversation
paddle/function/GemmConvOp.cpp
Outdated
@@ -233,6 +233,11 @@ class GemmConvGradInputFunction : public ConvFunctionBase { | |||
inputGrad += inputChannels * inputHeight * inputWidth; | |||
outputGrad += outputChannels * outputHeight * outputWidth; | |||
} | |||
#ifdef PADDLE_MOBILE_INFERENCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fix GemmConvFunction
not GemmConvGradInputFunction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... I'm sorry. I'll fix it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -126,6 +126,11 @@ class GemmConvFunction : public ConvFunctionBase { | |||
inputData += inputChannels * inputHeight * inputWidth; | |||
outputData += outputChannels * outputHeight * outputWidth; | |||
} | |||
#ifdef PADDLE_MOBILE_INFERENCE | |||
if (Device == DEVICE_TYPE_CPU) { | |||
delete memory_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use reset to release memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #6666
Fix #6658
Fix #6657