Repository navigation
Commit ba8b711
authored
Qualcomm AI Engine Direct - Move QCOM_AXIS_ORDER pop into LayoutTransform pass (pytorch#21932)
### Context
This PR supersedes pytorch#21630.
The original PR was closed due to CLA issues.
This new PR is created from a new branch to track CLA status and
continue the review process.
Please refer to pytorch#21630 for previous review comments and discussion.
### Summary:
- The pop of QCOM_AXIS_ORDER was previously done in
QnnBackend._build_op_wrappers before calling
transform_for_preprocess_pipeline. Moving it into
LayoutTransform.call() when insert_permute=True keeps the cleanup
logic co-located with the code that depends on it.
- The pop is necessary because the delegated subgraph is created via
deepcopy, which carries over the QCOM_AXIS_ORDER tags written by the
to-edge LayoutTransform run. Without clearing them,
is_transformed_node()
returns True for every sensitive node in the
main for-loop, causing all traversals to be skipped and no permute
nodes to be inserted.
### Test plan
```bash
python -m backends.qualcomm.tests.test_qnn_delegate TestQNNQuantizedOperator --device ${SERIAL_NUM} --soc_model ${SOC_MODEL} --build_folder build-android --executorch_root .
```
cc @cccclai @winskuo-quic @shewu-quic @haowhsu-quic @DannyYuyang-quic
@cbilgin @abhinaykukkadapu @psiddh1 parent 8789aa5 commit ba8b711
3 files changed
Lines changed: 9 additions & 15 deletions
File tree
- backends/qualcomm
- _passes
- tests/rework/passes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
357 | 365 | | |
358 | 366 | | |
359 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 100 | | |
108 | 101 | | |
109 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | 303 | | |
311 | 304 | | |
312 | 305 | | |
| |||
0 commit comments