1

I am interested alot in huawei NPU(I am using kirin9000, 990, 810) and I just found that when using hiai foundation api to use NPU, hiai foundation is not working when i build as native shell program through adb shell, however, it is working well when it run through android app with jni.

Could I get some help about this problem?

In addition, when I run tensorflow lite benchmark_model in native, NNapi delegate is not well worked with NPU device. Does it related with above problem?

Thank you!

JanosLim
  • 11
  • 3
  • hi@JanosLim,We support this path. Can you describe your question more clearly? The question you're asking is it poor performance or it won't run? – zhangxaochen Apr 28 '21 at 08:31
  • hello @shirley, I tested 2 cases, using c++ hiai api through android application & native program through adb shell, and hiai npu returns(after Process() method called, the registered output std::vector is filled with calculated data) well however when I run it without jni and run it just a c+ + program, calling Process() is not a problem but the output vector is never changed. I just noticed that Paddle-lite said that if there is no root privilege, I cannot get data from huawei npu through adb shell. How can I solve this? – JanosLim Apr 28 '21 at 13:58
  • In addition, when I run tflite benchmark_model, NNapi do not delegate to huawei npu , since tflite benchmark_model is run through adb shell, so that I think it is somehow related to the problem above. Thank you!! – JanosLim Apr 28 '21 at 14:00
  • hi JanosLim,Can you provide your applog for us to reproduce the problem? If you do not have the permission to pull applogs, you can use logcat. – zhangxaochen Apr 29 '21 at 02:57
  • @shirley, I followed this tutorial(https://developer.huawei.com/consumer/en/doc/development/hiai-Examples/sample-code-0000001052989807) inference_npu_sample code which is made as android app, and I fix this code to run as cli program. I'll soon append the logcat asap too. Thanks alot. – JanosLim Apr 29 '21 at 04:13
  • According to (https://paddle-lite.readthedocs.io/zh/latest/demo_guides/huawei_kirin_npu.html), they said, "# android shell端的示例程序,注意:HiAI存在限制,拥有ROOT权限才能正常运行shell端程序". I wonder is there any way to use npu through adb shell without root since my device(mate pro 40) is not available to rooting as i know. – JanosLim Apr 29 '21 at 04:19
  • hi JanosLim,maybe you can refer this [link](https://github.com/huaweicodelabs/HiAI-Foundation/tree/master/IRBuild) – zhangxaochen Apr 29 '21 at 06:13
  • Thank you @shirley, additionally, I found CANN(compute architecture for neural network) here https://support.huawei.com/enterprise/en/ascend-computing/cann-pid-251168373 I wonder this can be used with kirin chips too. – JanosLim May 04 '21 at 06:46
  • Sorry JanosLim,just confirmed with the team that it cannot be used with the kirin chips. – zhangxaochen May 06 '21 at 08:41

0 Answers0