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.
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.
You can create an equivalent model in Pytorch with
class Where(nn.Module):
def __init__(self):
super(Where, self).__init__()
self.conv1 = nn.Conv2d(3, 3, kernel_size=3, padding=1)
def forward(self, x):
mask = x > 0.5
y = x - 1.0
x = torch.where(mask, x, y)
x = self.conv1(x)
return x
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`:
**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++.
Describe the bug If a model contains the QNN
ElementWiseSelect
operation, equivalent totorch.where()
, it converts successfully but the graph fails to finalize on device or in the emulator.To Reproduce Steps to reproduce the behavior:
You can create an equivalent model in Pytorch with
x = torch.rand(1, 3, 16, 16) y = Where()(x)
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