Qualcomm: bmm over a flattened 4D input returns ~1/W of the right value when followed by unsqueeze (HTP fp16)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- embedded-iot, machine-learning
Direzione di ricerca
Start with the issue's minimal model and run it on CPU and the SM8850 HTP using the shown ExecuTorch lowering utilities; compare outputs with and without the final unsqueeze and with mask supplied as a graph input. Done means the HTP output matches the CPU result for the reported bmm pattern, rather than producing values about 1/W as large.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 Describe the bug
On the HTP, bmm over a flattened 4D input returns wrong values when the same input also feeds a conv and the result is unsqueezed back to 4D. Every output element is ~1/W of the right value (W=24 here), as if only one spatial row were summed. Found in ZipDepth's GlobalContextBlock.
import torch, torch.nn.functional as F
from executorch.backends.qualcomm.serialization.qc_schema import QcomChipset
from executorch.backends.qualcomm.utils.utils import (
generate_htp_compiler_spec, generate_qnn_executorch_compiler_spec, to_edge_transform_and_lower_to_qnn)
class M(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv = torch.nn.Conv2d(192, 1, 1)
def forward(self, x):
B, C, H, W = x.shape
mask = F.softmax(self.conv(x).view(B, 1, H * W), -1)
return torch.bmm(x.view(B, C, H * W), mask.transpose(1, 2)).unsqueeze(-1)
x = torch.rand(1, 192, 24, 24) * 0.5
cs = generate_qnn_executorch_compiler_spec(
soc_model=QcomChipset.SM8850, backend_options=generate_htp_compiler_spec(use_fp16=True))
edge = to_edge_transform_and_lower_to_qnn(M().eval(), (x,), cs)
On an S26 Ultra (SM8850, QAIRT 2.47, fp16), main and 1.4.1: output sum 2.05 vs 48.04 on CPU, ratio ~0.043 for every element.
- Without the
unsqueeze, or withmaskas a graph input: exact. (x.view(B, C, H * W) * mask).sum(-1, keepdim=True).unsqueeze(-1): exact (our workaround).
Versions
ExecuTorch main (a489dcac3b) and 1.4.1, QAIRT 2.47.0.260601, torch 2.14.
- Lingua principale
- Python
- Stelle
- 5.2k
- Fork
- 1.2k
- Merge medio
- 1g 22h
- PR unite (30g)
- 675
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytorch/executorch
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
pytorch/executorch#24434 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
pytorch/executorch#24410 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement triaged
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
pytorch/executorch#21640 ·
I maintainer di solito rispondono entro 1 giorno
-
Optimized le.Tensor_out returns b <= a for reverse-argument broadcastsForse già presa @SofianElmotiem l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
pytorch/executorch#24485 ·
I maintainer di solito rispondono entro 1 giorno
-
`install_executorch.sh` fails in a fresh uv virtual environment: `No module named pip`Forse già presa @mshr-h l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
pytorch/executorch#24417 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pytorch/executorch
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
jejjohnson/gaussx#752 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
521xueweihan/HelloGitHub#4270 ·
-
enhancement owner: den-haag
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ok-oldking/ok-wuthering-waves#1828 ·
I maintainer di solito rispondono entro 1 giorno
-
lesson-submission pending-review
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
Ikalus1988/MisakaNet#4512 ·
I maintainer di solito rispondono entro 1 giorno