ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

Arm Compute on Custom Cores

Open uu-praveeng opened this issue 8 years ago • 5 comments

Hi,

I have built alexnet application linked with neon based armcompute library. I am trying to run it on the Hardware, which has 4 mongoose m1 cores and 4 cortex-a53 cores(toatl 8 cores).

When I run the alexnet continuously it is not running on all the CPU cores .Top command is not displaying 100% cpu usage. Threads created(num_threads) during the execution of alexnet are only 4 instead of 8.

Is this expected behaviour? if there is anything that need to be change to use all the 8 cores.

Thank you, G. Praveen.

uu-praveeng avatar Oct 26 '18 09:10 uu-praveeng

Hi,

Yes, it is expected: if you run on a mixed combination of big and LITTLE cores then it will almost certainly be slower than running only on the big cores, therefore by default we look at how many cores of each type you've got on your system and set the number of threads to the minimum: (i.e if you've got 2 cores of one type and 4 of another, the default number of threads will be 2).

You can easily override this by specifying the number of threads on the command line: ./build/examples/graph_alexnet --help to see all the options available, and to force the number of threads: ./build/examples/graph_alexnet --threads=8 You can also use taskset to use only some of the cores.

Hope this helps

AnthonyBarbier avatar Oct 26 '18 10:10 AnthonyBarbier

Thank you Anthony . I am not using the graph model to build and run the network. I have created network using the ACL apis.

so I can't use your suggested solution . However I have treid to hardcode the num_threads to 8 by changing the return value from get_threads_hint(). So ideally now it should create 8 threads ,which it does. But still the CPU utilization is not 100%. Am I missing anything here .

Thank you, G. Praveen.

uu-praveeng avatar Oct 29 '18 09:10 uu-praveeng

FYI, all the command line argument does is call the set_num_threads() method from the scheduler: https://github.com/ARM-software/ComputeLibrary/blob/v18.08/src/graph/backends/NEON/NEDeviceBackend.cpp#L78

AnthonyBarbier avatar Oct 29 '18 10:10 AnthonyBarbier

The default scheduling policy is very basic: it simply divides the work to do by the number of threads and each thread has the same quantity of work to do which means on a big LITTLE system the small cores will have as much work to do as the big cores, and therefore they'll become the bottleneck, and that might be why the overall utilisation is not 100%.

AnthonyBarbier avatar Oct 29 '18 13:10 AnthonyBarbier

Closing for inactivity, feel free to reopen otherwise

ManubARM avatar Feb 01 '19 10:02 ManubARM