Forums - How to improve elapsed time for SNPE.NeuralNetworkBuilder

5 posts / 0 new
Last post
How to improve elapsed time for SNPE.NeuralNetworkBuilder
weiting_hsiao
Join Date: 2 May 18
Posts: 4
Posted: Thu, 2018-08-23 01:26

I try to use tensorflow lite and .dlc on android.

But .dlc cost much time on build  network.  This part shown in below:

final SNPE.NeuralNetworkBuilder builder = new SNPE.NeuralNetworkBuilder(application)
        .setDebugEnabled(false)
        .setRuntimeOrder(targetRuntime)
        .setModel(mModel, mModel.available())
        .setCpuFallbackEnabled(true);
long start = System.currentTimeMillis();
network = builder.build();
long end = System.currentTimeMillis();

 

.dlc cost 1300ms on build.build(), but .tflite only cost 10ms to initial interpreter .

Could you help me to improve this?

 

  • Up0
  • Down0
jihoonk
Profile picture
Join Date: 28 Jan 13
Location: Seoul
Posts: 55
Posted: Thu, 2018-08-23 01:36

Hi weiting_hsiao,

Initilization time takes longer in case of followings:

- Un-quantized model is used on DSP runtime

- Quantized model is used on CPU and GPU runtime

Check if your environment is one of above.

Thanks,

Jihoon

  • Up0
  • Down0
weiting_hsiao
Join Date: 2 May 18
Posts: 4
Posted: Fri, 2018-08-24 01:02

Hi  jihoonk

I check my enviroment, but no longer these two cases.

Un-quantized pb(convert to .dlc) model and GPU run time in my app. 

Is there any solution to improve initial time ?

  • Up0
  • Down0
jihoonk
Profile picture
Join Date: 28 Jan 13
Location: Seoul
Posts: 55
Posted: Fri, 2018-08-24 01:11

Please try snpe-diagview tool, which is profiling tool using the result of snpe-nut-run. It might help you.

https://developer.qualcomm.com/docs/snpe/tools.html#tools_snpe-diagview

Thanks,

Jihoon

  • Up0
  • Down0
weiting_hsiao
Join Date: 2 May 18
Posts: 4
Posted: Wed, 2018-08-29 23:43

I still don't know how to solve this problem of initial time.

tensorflow .lite  initial time: 10ms   inference time:250ms

snpe .dlc initial time:1300ms inference time:60ms

if you have any solution, please contact me.

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.