ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

AlexNet.h Model Crashes when the batch size is more than 5 or 6

Open XiaoMaol opened this issue 9 years ago • 3 comments

Dear ARM Developers:

Thank you so much for all your support along the way.

Currently, I run into some problem when using the /test/model_objects/AlexNet.h. I have written a program that uses AlexNet.h as an object and tests how fast forward propagation is. When the batch size is 1, the program usually runs, but when I switch the batch size into 6 or 7, the program will just crash.

This is part of my program to wrap the AlexNet object. alexnet_model

And It is possible to use the first parameter of init_weights to specify the batch size in the line

MyAlexNet.init_weights(1,false); 

After I switch the parameter from 1 to 7, this happens: alexnet_fail_batch2

In the beginning, I thought that I have run out the GPU memory, but when I am using the htop command, I find out that I have run out the memory on my ordroid board instead: screenshot from 2017-08-02 01-40-38

I am just wondering, Is 2GB of the memory too small? I have heard that 2GB of memory for an embedded device is not too small. Could it be that GPU memory ran out? Did I use the AlexNet.h somehow wrong?

The platform of my odroid is

Linux odroid 3.10.103-124 #1 SMP PREEMPT Tue Oct 11 11:51:06 UTC 2016 armv7l armv7l armv7l GNU/Linux

The following is the information about the Mali GPUs I am using, mali_gpu_info1 mali_gpu_info2

XiaoMaol avatar Aug 02 '17 01:08 XiaoMaol

Interesting, we haven't tried with a batch size of 6 or 7, usually we only run with 1, 4 and 8. We'll try to reproduce on our end, in the meantime could you try with 8 to see if it works ?

AnthonyBarbier avatar Aug 02 '17 07:08 AnthonyBarbier

@XiaoMaol On Odroid and similar system-on-a-chip platforms, the total system memory (e.g. 2 GB) is shared between all the devices. The GPU doesn't have any dedicated physical memory like on desktop or server cards. When you run out of the system memory, you cannot use the GPU either.

Also, because the memory is only shared physically (OpenCL 1.x limitation), you need to copy or map from the host memory space to the device memory space, which may increase your memory consumption.

psyhtest avatar Aug 02 '17 09:08 psyhtest

Sorry I have been away for a while. I think the problem is with the memory as @psyhtest suggested. 8 does not work either. Thank you for all you support!

XiaoMaol avatar Aug 14 '17 20:08 XiaoMaol