Skip to content

Qualcomm AI Engine Direct - Adding QNN backend support for atan2 core ATen ops#19051

Merged
abhinaykukkadapu merged 1 commit intopytorch:mainfrom
CodeLinaro:atan2
Apr 29, 2026
Merged

Qualcomm AI Engine Direct - Adding QNN backend support for atan2 core ATen ops#19051
abhinaykukkadapu merged 1 commit intopytorch:mainfrom
CodeLinaro:atan2

Conversation

@qti-horodnic
Copy link
Copy Markdown
Contributor

Summary

Adding support for the atan2 ATen op by a decomposition pass using the identity:

        atan2(y, x) =
            atan(y/x)        if x > 0
            atan(y/x) + π    if x < 0, y >= 0
            atan(y/x) - π    if x < 0, y < 0
            +π/2             if x = 0, y > 0
            -π/2             if x = 0, y < 0

Note that the op atan2.out is also added as a target, even though that op is converted to atan2.default by torch.export. The decomposition would still work in case the conversion was missed somehow.

Test plan

python backends/qualcomm/tests/test_qnn_delegate.py -k TestQNNQuantizedOperator.test_qnn_backend_atan2 --model SM8750 --host aisw-vm19-labsd --device 8afa1dd9 --build_folder build-android
python backends/qualcomm/tests/test_qnn_delegate.py -k TestQNNFloatingPointOperator.test_qnn_backend_atan2 --model SM8750 --host aisw-vm19-labsd --device 8afa1dd9 --build_folder build-android

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 22, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (2 Unrelated Failures)

As of commit 72a42b3 with merge base 069a793 (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Apr 22, 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 Apr 22, 2026
Comment thread backends/qualcomm/tests/models.py
@qti-horodnic
Copy link
Copy Markdown
Contributor Author

@abhinaykukkadapu Hi, is there anything you wanted me to modify with this PR?

@abhinaykukkadapu
Copy link
Copy Markdown
Contributor

@abhinaykukkadapu Hi, is there anything you wanted me to modify with this PR?

Ohhh i forgot to merge this, as i was waiting for CI results at that time, will merge now

@abhinaykukkadapu abhinaykukkadapu merged commit d9688da into pytorch:main Apr 29, 2026
169 of 171 checks passed
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.

2 participants