Skip to content

Add boltnn_executorch_llm_runner: run weight-shared QNN LLM exports from the AP - #24456

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
billmguo:export-D129133307
Nov 2, 2026
Merged

meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
billmguo:export-D129133307

Conversation

@billmguo

@billmguo billmguo commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary:
QNN running inside the CDSP user PD cannot load weight-shared context binaries ("Shared weights buffer isn't supported on this platform", err 1000), so BoltNN's executorch_app (QNN inside the Bolt DSP skel) cannot run a hybrid LLM export whose prefill_forward and kv_forward share one weight-shared context. QNN running from the CPU side (AP libQnnHtp.so + libQnnHtpV79Stub.so, graph construction and execution kicked from the AP) handles them fine.

//arvr/projects/bolt/bolt/nn/apps:boltnn_executorch_llm_runner is the upstream qnn_llama_runner CLI linked against the upstream QNN ExecuTorch runtime, so QnnBackend delegates build and run their graphs from the AP. It takes the same flags as the upstream runner.

To share the CLI, oss_scripts/llama gains qnn_llama_runner_main: qnn_llama_runner.cpp with its entry point renamed to qnn_llama_runner_main, on :runner_lib. qnn_llama_runner and runner_lib are unchanged; the fbcode/ and xplat/ copies stay byte-identical.

Authored with Claude.

Differential Revision: D129133307

… from the AP

Summary:
QNN running inside the CDSP user PD cannot load weight-shared context binaries ("Shared weights buffer isn't supported on this platform", err 1000), so BoltNN's `executorch_app` (QNN inside the Bolt DSP skel) cannot run a hybrid LLM export whose `prefill_forward` and `kv_forward` share one weight-shared context. QNN running from the CPU side (AP `libQnnHtp.so` + `libQnnHtpV79Stub.so`, graph construction and execution kicked from the AP) handles them fine.

`//arvr/projects/bolt/bolt/nn/apps:boltnn_executorch_llm_runner` is the upstream `qnn_llama_runner` CLI linked against the upstream QNN ExecuTorch runtime, so `QnnBackend` delegates build and run their graphs from the AP. It takes the same flags as the upstream runner.

To share the CLI, `oss_scripts/llama` gains `qnn_llama_runner_main`: `qnn_llama_runner.cpp` with its entry point renamed to `qnn_llama_runner_main`, on `:runner_lib`. `qnn_llama_runner` and `runner_lib` are unchanged; the `fbcode/` and `xplat/` copies stay byte-identical.

Authored with Claude.

Differential Revision: D129133307
@billmguo
billmguo requested a review from psiddh as a code owner November 2, 2026 19:16
@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/24456

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

❌ 2 Pending, 1 Unrelated Failure, 2 Unclassified Failures

As of commit 6119f4a with merge base e40e64c (image):

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

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 Nov 2, 2026
@meta-codesync

meta-codesync Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@billmguo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D129133307.

@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.

@meta-codesync
meta-codesync Bot merged commit 690ace2 into pytorch:main Nov 2, 2026
243 of 252 checks passed
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants