Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Is the code multithreaded for arm64? #60

Closed
RuABraun opened this issue Jun 5, 2019 · 7 comments
Closed

Is the code multithreaded for arm64? #60

RuABraun opened this issue Jun 5, 2019 · 7 comments

Comments

@RuABraun
Copy link

RuABraun commented Jun 5, 2019

I'm using QNNPACK for inference for my models, I was testing it on a v7a phone where it worked well. Now I got a newer phone (S9) and while it sometimes is a lot faster (I think there is some CPU throttling happening at times which can make it very slow), I noticed in the profiler that the CPU is at 80%, compared to ~35% on the older phone. I cannot explain how that could happen other than the code is doing multithreading?

@hlu1
Copy link
Contributor

hlu1 commented Jun 10, 2019

It depends on your models and the number of big cores in your phone. We do have specially optimized kernels in QNNPACK for high end ARM CPUs.

@hlu1 hlu1 closed this as completed Jun 10, 2019
@RuABraun
Copy link
Author

RuABraun commented Jun 10, 2019

Is it possible to turn it off? Despite the higher CPU usage (implying better performance) it's actually slower most of the time than when running on a significantly older phone (this is probably not the code's fault, but to try and diagnose what is going wrong it would helpful for me to test that option).

@hlu1
Copy link
Contributor

hlu1 commented Jun 11, 2019

That kernel runs only on high end CPUs. The default kernel is used on older phones.

@RuABraun
Copy link
Author

? Like I said on the newer phone it is slower than on the older phone.

it's actually slower most of the time than when running on a significantly older phone

@RuABraun
Copy link
Author

Nevermind I tried a model without QNNPACK and still have the same issues.

@RuABraun
Copy link
Author

I'm curious about this again. I'd rather have the other cores working on other tasks. Is there a flag to disable using multiple cores?

@AshkanAliabadi
Copy link

As far as I can tell if the threadpool argument to qnnp_run_operator is NULL, the dispatch calls reduce to a sequential loop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants