Skip to content

<Close this diff>#20209

Closed
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:pr-20195
Closed

<Close this diff>#20209
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:pr-20195

Conversation

@psiddh

@psiddh psiddh commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 10, 2026 23:45
@pytorch-bot

pytorch-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 29 Pending, 1 Unrelated Failure

As of commit f725c7c with merge base 4519036 (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following job 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 Jun 10, 2026
@github-actions

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Qualcomm QNN backend’s cdist decomposition support to also handle the internal aten._cdist_forward op, and adds corresponding test coverage to validate lowering for both FP32 and QDQ flows.

Changes:

  • Add a CDistForward test model that directly calls torch.ops.aten._cdist_forward.default.
  • Add new delegate tests to exercise lowering for _cdist_forward in both non-quantized and QDQ paths.
  • Update QNN pass configuration/documentation to enable and document DecomposeCDist for aten._cdist_forward.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extension/android/executorch_android/src/main/java/org/pytorch/executorch/Module.kt Kotlin formatting update for multi-line exception creation call.
backends/qualcomm/tests/test_qnn_delegate.py Adds new _cdist_forward backend tests for both FP32 and QDQ flows.
backends/qualcomm/tests/models.py Adds CDistForward module that calls aten._cdist_forward.
backends/qualcomm/builders/README.md Documents _cdist_forward as handled by DecomposeCDist.
backends/qualcomm/_passes/qnn_pass_manager.py Enables DecomposeCDist by default and adds its capture-program dependency.
backends/qualcomm/_passes/decompose_cdist.py Extends decomposition target matching to include aten._cdist_forward.
Comments suppressed due to low confidence (1)

backends/qualcomm/_passes/decompose_cdist.py:55

  • torch.ops.aten._cdist_forward.default passes p as a float (e.g. 2.0), but the decomposition asserts node.args[2] == 2. With the newly supported _cdist_forward target (and even for aten.cdist depending on tracing), this assertion can fail even when p is effectively 2.

Accept both 2 and 2.0 (or generally numeric values equal to 2) to avoid spurious assertion failures while still enforcing p=2 only.

            if node.target in self.cdist_targets:
                if len(node.args) > 2:
                    assert (
                        node.args[2] == 2
                    ), "Currently only p=2 is supported for CDist Decomposition"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@psiddh psiddh changed the title Pr 20195 Qualcomm AI Engine Direct - Adding QNN backend support for _cdist_forward core ATen op Jun 11, 2026
@psiddh

psiddh commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@qti-horodnic I accidentally pushed one of my commits on your PR, Sorry about that. Can you force push one more time so that author, title and summary etc is set properly. Sorry for the trouble

@psiddh psiddh closed this Jun 11, 2026
@psiddh
psiddh deleted the pr-20195 branch June 11, 2026 00:28
@psiddh psiddh changed the title Qualcomm AI Engine Direct - Adding QNN backend support for _cdist_forward core ATen op <Close this diff> Jun 11, 2026
@qti-horodnic

Copy link
Copy Markdown
Contributor

@qti-horodnic I accidentally pushed one of my commits on your PR, Sorry about that. Can you force push one more time so that author, title and summary etc is set properly. Sorry for the trouble

Looks like you already fixed this, lmk if you need anything from me

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.

3 participants