You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4647d62
Browse filesBrowse the repository at this point in the historyBrowse files
Qualcomm AI Engine Direct - Adding QNN backend support for reflection_pad3d core ATen op (pytorch#21502)
### Summary
Added support for `aten.reflection_pad3d` on the QNN HTP backend via a
decomposition pass into the `index_select` + `cat` operations.
Note that QNN HTP's native Pad op with `MIRROR_REFLECT` scheme only
supports tensors up to rank 4. Since `reflection_pad3d` operates on 5D
tensors `[N, C, D, H, W]`, it cannot be delegated directly. Using `2d`
or `1d` variants of this op in a decomposition is complicated, so this
PR decomposes `reflection_pad3d` into `index_select` and `cat`, which
are both fully supported at 5D rank on HTP.
This is done by:
1. `index_select` to gather mirrored indices along the dimension.
2. `cat` to concatenate the reflected slices with the original tensor.
### Test plan
```
pytest backends/qualcomm/tests/rework/htp/op/v68/test.py -k "test_reflection_pad_3d" -v
python backends/qualcomm/tests/test_qnn_delegate.py TestQNNQuantizedOperator.test_qnn_backend_reflection_pad3d --soc_model SM8750 --host aisw-vm15-labsd --device 545ee4aa --build_folder build-android
python backends/qualcomm/tests/test_qnn_delegate.py TestQNNFloatingPointOperator.test_qnn_backend_reflection_pad3d --soc_model SM8750 --host aisw-vm15-labsd --device 545ee4aa --build_folder build-android
```
0 commit comments