Skip to content

Qualcomm: key the QnnManager registry on the compile options - #21934

Draft
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:qnn-manager-registry-key
Draft

Qualcomm: key the QnnManager registry on the compile options#21934
psiddh wants to merge 1 commit into
pytorch:mainfrom
psiddh:qnn-manager-registry-key

Conversation

@psiddh

@psiddh psiddh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

QnnManagerRegistry keyed managers on backend_type alone, so two specs for one backend resolved to the same manager (two compile specs for one backend silently share a QnnManager) , the one built from whichever spec was seen first. Precision, VTCM size and SoC config all come from the options a manager was constructed with, so a graph meant to compile fp16 alongside a quantized one silently compiled at the first spec's precision instead. Mixed precision within a single program was not expressible.

Keying on (backend_type, option) gives each distinct spec its own manager. Same-spec lookups still reuse one, so nothing extra is created in the common single-spec case. destroy_qnn_manager now drops every manager for a backend type rather than a single entry.

Known remaining gap, not addressed here: preprocess_multimethod still takes list(compile_specs.values())[0][0], so that path applies one partition's spec to all of them even with distinct managers available.

QnnManagerRegistry keyed managers on backend_type alone, so two specs for one
backend resolved to the same manager -- the one built from whichever spec was
seen first. Precision, VTCM size and SoC config all come from the options a
manager was constructed with, so a graph meant to compile fp16 alongside a
quantized one silently compiled at the first spec's precision instead. Mixed
precision within a single program was not expressible.

Keying on (backend_type, option) gives each distinct spec its own manager.
Same-spec lookups still reuse one, so nothing extra is created in the common
single-spec case. destroy_qnn_manager now drops every manager for a backend
type rather than a single entry.

Known remaining gap, not addressed here: preprocess_multimethod still takes
list(compile_specs.values())[0][0], so that path applies one partition's spec
to all of them even with distinct managers available.

Authored with Claude Code.
Copilot AI lite review requested due to automatic review settings August 19, 2026 07:40
@pytorch-bot

pytorch-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 0447315 with merge base b45e85d (image):

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

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 Aug 19, 2026

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@psiddh
psiddh marked this pull request as draft August 19, 2026 07:40
@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.

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.

2 participants