Commit f099cfb
authored
Qualcomm AI Engine Direct - Fix mem_handel register twice issue (#13410)
Summary:
- Insert registered handle in pre_registered_handles_ map to avoid
register multiple times for the same data_ptr
Background:
When running llama in lookahead mode using the same AR-N model for both
the prompt processor and token generator. The input and output are the
same, and the kv cache is shared between both components.. This causes a
"register twice" error message from QNN when a shared buffer (Smart
Mask) is used.
Error message:
```
[ERROR] [Qnn ExecuTorch]: <E> Memory Handle duplicate found, matches Handle ID 0x2
[ERROR] [Qnn ExecuTorch]: <E> Mem handle exists already
[ERROR] [Qnn ExecuTorch]: <E> Failed to register memHandles
[ERROR] [Qnn ExecuTorch]: <E> Failed to register memHandles
[ERROR] [Qnn ExecuTorch]: <E> Failed to register mem with error 0x1f42
```
cc: @sxu , @haowhsu-quic1 parent 204eee9 commit f099cfb
File tree
3 files changed
+11
-3
lines changed- backends/qualcomm/runtime
- backends
3 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
| 295 | + | |
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
70 | 72 | | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
0 commit comments