Skip to content

Qualcomm AI Engine Direct - Adding QNN backend support for diagonal core ATen op#20596

Open
qti-horodnic wants to merge 1 commit into
pytorch:mainfrom
CodeLinaro:diagonal
Open

Qualcomm AI Engine Direct - Adding QNN backend support for diagonal core ATen op#20596
qti-horodnic wants to merge 1 commit into
pytorch:mainfrom
CodeLinaro:diagonal

Conversation

@qti-horodnic

Copy link
Copy Markdown
Contributor

Summary

Added support for the core ATen op diagonal using a decomposition pass and the permute, view, arange, index_select ops by:

  1. Permute input so dim1 and dim2 are the last two dimensions.
  2. Reshape (view) to flatten the last two dims: [..., M*N].
  3. Compute flat diagonal indices via arange(start, end, stride).
  4. Use index_select on the last dim with the computed indices.

Also made a small update to the new_op_development skill.

Test plan

python backends/qualcomm/tests/test_qnn_delegate.py -k TestQNNQuantizedOperator.test_qnn_backend_diagonal --soc_model SM8750 --host aisw-vm15-labsd --device 545ee4aa --build_folder build-android

python backends/qualcomm/tests/test_qnn_delegate.py -k TestQNNFloatingPointOperator.test_qnn_backend_diagonal --soc_model SM8750 --host aisw-vm15-labsd --device 545ee4aa --build_folder build-android

@pytorch-bot

pytorch-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20596

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 58a639a with merge base 2af5638 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 29, 2026
@qti-horodnic

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: qualcomm"

@pytorch-bot pytorch-bot Bot added the release notes: qualcomm Changes to the Qualcomm backend delegate label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: qualcomm Changes to the Qualcomm backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant