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 with element-wise select / torch.where() fails to finalize #27

Open mako443 opened 3 months ago

mako443 commented 3 months ago

Describe the bug If a model contains the QNN ElementWiseSelect operation, equivalent to torch.where(), it converts successfully but the graph fails to finalize on device or in the emulator.

To Reproduce Steps to reproduce the behavior:

x = torch.rand(1, 3, 16, 16) y = Where()(x)


**Expected behavior**
After conversion, the model should run on the emulator and device as expected.

**Stack trace**
Output from `qnn-net-run`:

qnn-net-run pid:21299 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) Graph Finalize failure



**Host configuration:**
 - QAI-Hub-Models version: aihub-2024.03.07.0
 - QAI-Hub client version: 0.9.0

**Additional context**
As a heads-up: The operation also fails to finalize when converting through the `qnn-pytorch-converter` or going creating the model "manually" in C++.
gustavla commented 3 months ago

Thanks for reporting this issue! I have filed an internal bug report for this.