Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Model with element-wise select / torch.where() fails to finalize #27

Open
mako443 opened this issue Mar 19, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@mako443
Copy link

mako443 commented Mar 19, 2024

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:

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++.

@mestrona-3 mestrona-3 added the bug Something isn't working label Mar 21, 2024
@gustavla
Copy link

gustavla commented Apr 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants