quic / ai-hub-models

The Qualcomm® AI Hub Models are a collection of state-of-the-art machine learning models optimized for performance (latency, memory etc.) and ready to deploy on Qualcomm® devices.
https://aihub.qualcomm.com
BSD 3-Clause "New" or "Revised" License
338 stars 45 forks source link

[BUG] Model converted from TorchScript gets stuck on qnn-net-run #17

Open mako443 opened 4 months ago

mako443 commented 4 months ago

Describe the bug I have a model with only layers like Conv2d, LeakyReLU, Sigmoids and element-wise multiplications. The model converts successfully, here is an example job: https://app.aihub.qualcomm.com/jobs/jegn9nk5o/ However, running the model on device (Vivo X90 Pro+ with 8550 chipset) through qnn-net-run gets stuck. If I run the model through the qnn-pytorch-converter it converts successfully and I can run it on device.

TorchScript can be downloaded here: https://drive.google.com/file/d/19Y2H8TyqEsJ_QbNISDBA98b_6RCYa38k/view?usp=share_link

To Reproduce

Expected behavior The qnn-net-run command should exit after a few seconds, generating an output/Result_0 folder.

Stack trace Stack trace with cancellation after a minute:

./qnn-net-run --backend libQnnHtp.so --model res/job_jegn9nk5o_optimized_so_m7n1evpm5.so --input_list res/input.txt                                  
qnn-net-run pid:11906
WARNING: linker: Warning: unable to normalize "$/data/local/tmp/QNN-2.19" (ignoring)
WARNING: linker: Warning: unable to normalize "$/data/local/tmp/QNN-2.19" (ignoring)
^C

Host configuration:

gustavla commented 3 months ago

Thank you for reporting this. I can confirm that I see the same behavior, although it does eventually finish for me after 10 minutes. I do not see this behavior when profiling via AI Hub and I do not yet know what the difference is. I thought it might be the htp graph optimization type, but even setting that to the slowest on AI Hub is super fast.

I'll keep digging.

gustavla commented 3 months ago

I have forwarded this to the appropriate internal team at Qualcomm. I will let you know when I hear something.

mako443 commented 3 months ago

@gustavla Thank your for following this - let me know if you get any feedback or if I can offer any help!