Skip to content

Fix QNN online-prepare graph handle retrieval - #21860

Open
sylvesterkaczmarek wants to merge 1 commit into
pytorch:mainfrom
sylvesterkaczmarek:fix-21804-qnn-online-prepare-graph-handle
Open

Fix QNN online-prepare graph handle retrieval#21860
sylvesterkaczmarek wants to merge 1 commit into
pytorch:mainfrom
sylvesterkaczmarek:fix-21804-qnn-online-prepare-graph-handle

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 15, 2026

Copy link
Copy Markdown

Fixes #21804.

QnnContext::Configure() registers DLC graphs into the QNN context for ONLINE_PREPARE before QnnGraph::Configure() runs. The graph configuration path then skipped both graph creation and graph retrieval, leaving graph_handle null and storing it in handle_.

This change retrieves already-registered DLC graphs with qnn_graph_retrieve, matching the deserialization path, applies AfterRetrieveGraph, and defensively rejects a null graph handle before bookkeeping.

Validation: adds a dedicated qnn_online_prepare backend test flow and wires it into QNN pull-request and scheduled CI so this runtime path is exercised alongside the existing QNN flow. The branch is rebased on current main and kept to one commit.

cc @cbilgin @psiddh

@pytorch-bot

pytorch-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 Awaiting Approval, 1 New Failure

As of commit 6b1af15 with merge base bd2e855 (image):

AWAITING APPROVAL - The following workflow needs approval before CI can run:

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla

meta-cla Bot commented Aug 15, 2026

Copy link
Copy Markdown

Hi @sylvesterkaczmarek!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 15, 2026

Copy link
Copy Markdown

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

  • ✅ login: sylvesterkaczmarek / name: Sylvester Kaczmarek (487b3ea)

Copy link
Copy Markdown
Author

@pytorchbot label "release notes: qualcomm"

@pytorch-bot pytorch-bot Bot added the release notes: qualcomm Changes to the Qualcomm backend delegate label Aug 15, 2026
@meta-cla

meta-cla Bot commented Aug 15, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@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 15, 2026

Copy link
Copy Markdown
Author

CI is currently blocked on fork-workflow approval rather than a test failure. Dr. CI reports no failed jobs, both CLA checks are satisfied, and the QNN workflow has not started yet. Could a maintainer please approve the pending workflows, especially Test QNN Backend, Test QNN Windows MSVC build, and Lint, so the change can receive actual CI validation? Thanks.

Retrieve graphs composed from DLC for ONLINE_PREPARE and exercise the runtime path with a dedicated QNN backend test flow.
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-21804-qnn-online-prepare-graph-handle branch from 15196d5 to 6b1af15 Compare August 16, 2026 21:10
@nil-is-all

Copy link
Copy Markdown
Contributor

Hi @sylvesterkaczmarek, thanks for the PR and sorry for the delay. Running CI now

@chenweng-quic
chenweng-quic self-requested a review September 1, 2026 04:58

@chenweng-quic chenweng-quic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

withdraw approval since I cannot reproduce issue mentioned in #21804 (comment)

@chenweng-quic chenweng-quic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

withdraw approval

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.

Deterministic SIGSEGV in Method::execute_instruction via EventTracerProfileOpScope destructor — QNN restore-fails→DLC-fallback path

3 participants