Skip to content

Qualcomm AI Engine Direct - Broadcast the constant base of quantized pow - #24431

Open
msluszniak wants to merge 1 commit into
pytorch:mainfrom
msluszniak:ms/qnn-pow-scalar-base-broadcast
Open

msluszniak wants to merge 1 commit into
pytorch:mainfrom
msluszniak:ms/qnn-pow-scalar-base-broadcast

Conversation

@msluszniak

Copy link
Copy Markdown
Contributor

Quantized pow.Scalar(c, x) on HTP returns 0 for every element but the first: the lifted one-element base is not broadcast by ElementWisePower. fp16 is unaffected. This expands a constant base to the output shape.

TestQNNQuantizedOperator.test_qnn_backend_pow_scalar reproduces it on SM8850 (QAIRT 2.47): 99 of 100 outputs are 0 before, exact after. Found quantizing RF-DETR, whose sine position embedding computes 10000 ** x in the graph.

cc @nil-is-all

LiftConstantScalarOperands lifts the base of pow.Scalar to a one-element
constant. Quantized HTP ElementWisePower does not broadcast its first
input, so only the first output element is computed and the rest are 0.
Expand a constant base to the output shape.
@msluszniak
msluszniak requested a review from psiddh as a code owner November 2, 2026 14:11
@pytorch-bot

pytorch-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⚠️ 16 Awaiting Approval

As of commit 8e29ee1 with merge base aed328d (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

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 Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

This branch has not been deployed

No deployments
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant