Unsupported Node in onnxruntime with vsi npu

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unsupported Node in onnxruntime with vsi npu

2,305 Views
phillin702
Contributor I

I am using IMX 8M Plus,and deploying the model in NPU with onnxruntime. My code is download from https://source.codeaurora.org/external/imx/onnxruntime-imx/tree/csharp/test/Microsoft.ML.OnnxRuntime... .

When I set execution_provider to CPU,it works fine, as shown below.

cpu.png

when I set execution_provider to vsi_npu, it works very slowly, and flag some unsupported nodes, as shown below.

npu.png

Is this because nodes which are not supported switch from NPU to CPU ??

Or is there something wrong with our operation??

0 Kudos
Reply
10 Replies

2,291 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

PRelu is not in VSI NPU node support list , that log shows that this operation node has been switched to CPU. 

0 Kudos
Reply

2,287 Views
phillin702
Contributor I

Thank you for your reply , But  Appendix C Neural network API reference in 《i.MX Machine Learning User's Guide》,it show that the prelu operation is supported,Didn't it mean NPU support?

0 Kudos
Reply

2,285 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @phillin702 

The npu driver and onnxruntime driver is also updating in each BSP release,the hardware supports it but the driver hasn't. 

0 Kudos
Reply

2,283 Views
phillin702
Contributor I

Thank you for your reply. Does this mean I have an incorrect driver version and need to update the driver?

0 Kudos
Reply

2,277 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

I will test the lastest version and reply here.

0 Kudos
Reply

2,274 Views
phillin702
Contributor I

Thank you for your reply. In addition, are other operations such as BN and Flatten also not supported? Do you have a list of operators supported by ONNX NPU?

0 Kudos
Reply

2,231 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Have you include the npu provider when you compile this source code?

Qmiller_0-1666577755374.png

Test on lasteset BSP[L5.15.52] with vsi_npu:

root@imx8mpevk:~# ./onnxruntime_sample
WARNING: Since openmp is enabled in this build, this API cannot be used to configure intra op num threads. Please use the openmp environment variables to control the number of threads.
Using Onnxruntime C API
Number of inputs = 1
Input 0 : name=data_0
Input 0 : type=1
Input 0 : num_dims=4
Input 0 : dim 0=1
Input 0 : dim 1=3
Input 0 : dim 2=224
Input 0 : dim 3=224
Score for class [0] = 0.000045
Score for class [1] = 0.003846
Score for class [2] = 0.000125
Score for class [3] = 0.001180
Score for class [4] = 0.001317
Done!

0 Kudos
Reply

2,187 Views
phillin702
Contributor I

Hello, do you have any new progress?

0 Kudos
Reply

2,185 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Previous reply contains my test log under VSI NPU with L5.15.52

The NPU test can pass with Prelu.

0 Kudos
Reply

2,204 Views
phillin702
Contributor I

Thank you for your reply. Yes, we had include the npu provider when we compile this source code.

1.png2.png3.png

0 Kudos
Reply