Commit c9eee94
authored
Qualcomm AI Engine Direct - Enabling Support for Qualcomm Chipsets for Snapdragon 7+ Gen 3 (pytorch#22542)
### Summary
Adding SoC support for SM7675 (Snapdragon 7+ Gen 3) and SM8635
(Snapdragon 8s Gen 3), both HTP V73.
Scope of Support:
- Quantized HTP: supported*. Quantized HTP validated across
8a8w/16a4w/16a2w, per-channel, block-wise, and QAT paths, plus the full
quantized utils suite. See test cases in the Test Plan section. I did
not run the whole quantized ops/model suite, which is why support is
denoted with a (*).
- FP16: not supported. QNN rejects these SoCs for FP16 (`"The SocModel
doesn't support FP16"`), so FP16 lowering does not produce a delegated
graph. Note it also does not degrade gracefully today: models containing
ops on the partitioner's non-decompose list (e.g. `linear`,
`layer_norm`) fail to export rather than falling back to CPU.
Note that these changes need the fix added in
pytorch#22543 for the tests to pass.
### Test plan
```
python backends/qualcomm/tests/test_qnn_delegate.py \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_conv2d \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_linear \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_layer_norm \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_conv2d \
-v --soc_model SM8635 --host aisw-local-vm3 --device 4603496b \
--build_folder build-android
python backends/qualcomm/tests/test_qnn_delegate.py \
TestQNNQuantizedOperator.test_qnn_backend_sort \
TestQNNQuantizedOperator.test_qnn_backend_conv2d \
TestQNNQuantizedOperator.test_qnn_backend_linear \
TestQNNQuantizedOperator.test_qnn_backend_layer_norm \
TestQNNQuantizedOperator.test_qnn_backend_element_wise_add \
-v --soc_model SM8635 --host aisw-local-vm3 --device 4603496b \
--build_folder build-android
python backends/qualcomm/tests/test_qnn_delegate.py \
TestQNNQuantizedOperator.test_qnn_backend_16a2w_conv2d \
TestQNNQuantizedOperator.test_qnn_backend_16a2w_linear \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_per_channel_linear \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_per_channel_linear_with_bias \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_conv2d_qat \
TestQNNQuantizedOperator.test_qnn_backend_16a4w_block_conv2d_qat \
-v --soc_model SM8635 --host aisw-local-vm3 --device 4603496b \
--build_folder build-android
python backends/qualcomm/tests/test_qnn_delegate.py TestQNNQuantizedUtils -v --soc_model SM8635 --host aisw-local-vm3 --device 4603496b --build_folder build-android
```1 parent f3f0c96 commit c9eee94
3 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1199 | 1199 | | |
1200 | 1200 | | |
1201 | 1201 | | |
| 1202 | + | |
1202 | 1203 | | |
1203 | 1204 | | |
1204 | 1205 | | |
| 1206 | + | |
1205 | 1207 | | |
1206 | 1208 | | |
1207 | 1209 | | |
| |||
1332 | 1334 | | |
1333 | 1335 | | |
1334 | 1336 | | |
| 1337 | + | |
1335 | 1338 | | |
| 1339 | + | |
1336 | 1340 | | |
1337 | 1341 | | |
1338 | 1342 | | |
| |||
1362 | 1366 | | |
1363 | 1367 | | |
1364 | 1368 | | |
| 1369 | + | |
1365 | 1370 | | |
1366 | 1371 | | |
1367 | 1372 | | |
1368 | 1373 | | |
1369 | 1374 | | |
| 1375 | + | |
1370 | 1376 | | |
1371 | 1377 | | |
1372 | 1378 | | |
| |||
0 commit comments