huge memory consumption during configure
Hi,
I am seeing a huge memory consumption (~ 1.3GB) while configuring NEDeconvolutionlayer. inputSize 30 x 40 x 256 and weights 8 x 8 x 256 x 256.
Why is this happening?
Thanks, Pranathi.
Hi @pranathibl
Could you please share all the values you use to configure the function? Data types and PadStrideInfo ?
Hi @pranathibl.
Thanks for the setup and I could reproduce the issue with the setup. From investigation, I found this is expected behavior on NEON mainly due to the Im2col. We'll start our internal discussion to plan the improvement.
As an alternative for now, if you can use OpenCL version of DeconvolutionLayer, it is expected to have smaller memory consumption.
I hope it helps.
Hi @pranathibl , We recently merged a patch which should solve your problem. This is the line you might be more interested on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3135/6/src/runtime/NEON/functions/NEConvolutionLayer.cpp#170
Basically we pick NEDirectConvolution in case of big input tensors and bigger weights shapes to avoid the need of huge allocations. In fact, this layer doesn't require more memory
Let us know, Manuel
Hi @ManubARM ,
I have tried out with the patch provided. and still seeing the memory consumption to be high (1.3GB).
Thanks, Pranathi.
Could you please try to print what are your values of: input->total_size() and weights->dimension(idx_h) ? And also which ConvolutionMethod is get_convolution_method() returning?
Best, Manuel
Hi @ManubARM ,
It is picking GEMM as Convolution method. And input->total_size() = 21.7MB weights->dimension(idx_h) = 8
-Pranathi
Hi @pranathibl
The following patch on the top of master solves the problem: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6806
I ran the test and it's now using DirectConv as Deconvolution method.
Hope this helps.