Skip to content

Qualcomm AI Engine Direct - Adding QNN backend support for var core ATen ops#19722

Merged
psiddh merged 1 commit into
pytorch:mainfrom
CodeLinaro:var
Jun 9, 2026
Merged

Qualcomm AI Engine Direct - Adding QNN backend support for var core ATen ops#19722
psiddh merged 1 commit into
pytorch:mainfrom
CodeLinaro:var

Conversation

@qti-horodnic

@qti-horodnic qti-horodnic commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Added support for the core ATen ops var.correction and var.dim via a decomposition pass using:

var(x, dim) = mean((x - mean(x, dim, keepdim=True))^2, dim, keepdim) * N / (N - correction)

Where var.correction is an optional scalar (default=1) and for var.dim unbiased=True -> correction=1, unbiased=False -> correction=0.

Also added a couple of test cases for the select_scatter op per a suggestion in another pr.

Test plan

python backends/qualcomm/tests/test_qnn_delegate.py -k TestQNNQuantizedOperator.test_qnn_backend_var --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_var --model SM8750 --host aisw-vm15-labsd --device 545ee4aa --build_folder build-android

cc @cccclai @cbilgin @abhinaykukkadapu

@pytorch-bot

pytorch-bot Bot commented May 21, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 5 New Failures

As of commit c54f8ca with merge base af92b60 (image):

NEW FAILURES - The following jobs have failed:

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 May 21, 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 May 21, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 24, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: qti-horodnic / name: Arik Horodniceanu (4df3d21)

@qti-horodnic

qti-horodnic commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: qti-horodnic / name: Arik Horodniceanu (93d7f6f)

@psiddh

psiddh commented May 28, 2026

Copy link
Copy Markdown
Contributor

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: qti-horodnic / name: Arik Horodniceanu (c54f8ca)

Comment thread backends/qualcomm/_passes/decompose_var.py Outdated
@qti-horodnic

Copy link
Copy Markdown
Contributor Author

Hi @psiddh

The CLA has been signed for this PR and the other open ones, feel free to merge them at your earliest convenience:
#19785
#19826

@psiddh

psiddh commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Lint failures on the PR, pls check

@psiddh psiddh added the module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ label Jun 4, 2026
@qti-horodnic

Copy link
Copy Markdown
Contributor Author

Lint failures on the PR, pls check

@psiddh

Resolved now, thanks

@qti-horodnic

Copy link
Copy Markdown
Contributor Author

@psiddh

Hi, can we merge this pr or did you want any other changes?

@psiddh

psiddh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Lgtm, I will merge it once the CI passes basic sanity tests.

@psiddh psiddh merged commit b771dab into pytorch:main Jun 9, 2026
173 of 178 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. module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ release notes: qualcomm Changes to the Qualcomm backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants