Skip to content

Qualcomm AI Engine Direct - Addition of new APIs for QNN custom op package and quantization annotation#19094

Open
qti-mmadhava wants to merge 1 commit intopytorch:mainfrom
CodeLinaro:dev1/mmadhava/custom_op_refactor
Open

Qualcomm AI Engine Direct - Addition of new APIs for QNN custom op package and quantization annotation#19094
qti-mmadhava wants to merge 1 commit intopytorch:mainfrom
CodeLinaro:dev1/mmadhava/custom_op_refactor

Conversation

@qti-mmadhava
Copy link
Copy Markdown
Contributor

@qti-mmadhava qti-mmadhava commented Apr 23, 2026

Qualcomm AI Engine Direct - Addition of new APIs for QNN custom op package and quantization annotation

  • Add QnnCustomOpPackageBuilder in backends/qualcomm/custom_op/interface.py to parse QNN XML op package configs via QnnOpPackageGenerator, register per-target/platform implementations, and validate torch-to-QNN op type name mappings
  • Add IOQuantConfig dataclass and CustomOpsQuantAnnotator class in backends/qualcomm/custom_op/annotator.py to build per-op quantization annotation functions for custom ops, with support for both single and multi-output ops
  • Updated examples/qualcomm/custom_op/custom_ops_1.py as an end-to-end example using the new builder and annotator APIs
  • Add examples/qualcomm/custom_op/custom_ops_2.py and example_op_package_htp_multi_output/SplitCustomOpPackage demonstrating multi-output custom op support with a split op
  • README doc updates
    python3 examples/qualcomm/custom_op/custom_ops_1.py --build_folder build-android -s <device_serial> -H <host> -m SM8650 --op_package_dir examples/qualcomm/custom_op/example_op_package_htp/ExampleOpPackage --build_op_package
    python3 examples/qualcomm/custom_op/custom_ops_2.py --build_folder build-android -s <device_serial> -H <host> -m SM8650 --op_package_dir examples/qualcomm/custom_op/example_op_package_htp_multi_output/SplitCustomOpPackage --build_op_package

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 23, 2026

🔗 Helpful Links

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

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:

❌ 1 Cancelled Job, 2 Unrelated Failures

As of commit fc024f1 with merge base 369f5ca (image):

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was 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 23, 2026
@qti-mmadhava qti-mmadhava force-pushed the dev1/mmadhava/custom_op_refactor branch from 1286b0a to fc024f1 Compare April 23, 2026 21:09
@qti-mmadhava
Copy link
Copy Markdown
Contributor Author

Hi @cccclai, @abhinaykukkadapu,
This PR introduces new APIs and examples for using custom ops with QNN backend.
When you have time, could you please help review?
Thanks

@qti-mmadhava
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 24, 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