Qualcomm AI Engine Direct - Adding QNN backend support for the sort core ATen op (#21386)
### Summary Added support for the `aten.sort` core ATen op for QNN HTP backend. Implements `aten.sort.default` delegation to QNN HTP by reusing the existing `TopK` op with `k = dim_size`. Supports both ascending and descending sort order. Note that this op faces the same limitations as the existing `TopK` op: - Only supports sorting along the last dimension (QNN constraint). - Sort indices are output as `int32`; consuming them with gather in quantized models may cause `dtype` mismatches. Added a floating point `sort_and_index` test for this use-case. ### Test plan ``` pytest backends/qualcomm/tests/rework/htp/op/v68/test.py -k "test_sort" python backends/qualcomm/tests/test_qnn_delegate.py TestQNNQuantizedOperator.test_qnn_backend_sort --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_sort --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_sort_and_index --soc_model SM8750 --host aisw-vm15-labsd --device 545ee4aa --build_folder build-android ```
Q
qti-horodnic committed
d0fe35d9b1c1c453116fbf2264e01a20905a6db4
Parent: 94c6c88
Committed by GitHub <noreply@github.com>
on 7/29/2026, 4:08:25 AM