[BUG] Model with element-wise select / torch.where() fails to finalize
Closed this issue · 2 comments
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:
- Compile job is here: https://app.aihub.qualcomm.com/jobs/j0pxk1885/
- 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
:
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++.
Thanks for reporting this issue! I have filed an internal bug report for this.
This is fixed as of QNN 2.27. Verified today on AI Hub: https://app.aihub.qualcomm.com/jobs/j5mn6loqp/