Skip to content

Fix llama_qnn Buck target import failures - #24100

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
billmguo:export-D127006045
Oct 22, 2026
Merged

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

Conversation

@billmguo

@billmguo billmguo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
//executorch/examples/qualcomm/oss_scripts/llama:llama_qnn currently fails at import time for every model, before any argument is parsed, with ModuleNotFoundError: No module named 'executorch.examples.models.gemma4' and then ... granite_speech. The Buck targets drifted from the sources synced from upstream: the Gemma4 enablement (#20979) added an unconditional executorch.examples.models.gemma4 import with no owning target for gemma4/__init__.py, Granite-Speech added model/audio_encoder.py plus a granite_speech import, and QAD (#21036) added quantize/qat.py, dataset/{constants,targets}.py and the train/ package, none of which are in any target.

This adds a gemma4 library owning gemma4/__init__.py, a new train library (including its train/config/*.yaml resources), the missing sources in static_llama, dataset and quantize, and the gemma4 and granite_speech deps on llama_lib. The fbcode/ and xplat/ copies are kept byte-identical.

Known limitation, not addressed here: under Buck QNN_SDK_ROOT is a placeholder, so is_qnn_sdk_version_less_than("2.35") cannot detect the SDK version and masked softmax is disabled during export even though the pinned SDK (2.50) supports it.

Authored with Claude Code.

Differential Revision: D127006045

cc @cbilgin @psiddh

Summary:
`//executorch/examples/qualcomm/oss_scripts/llama:llama_qnn` currently fails at import time for every model, before any argument is parsed, with `ModuleNotFoundError: No module named 'executorch.examples.models.gemma4'` and then `... granite_speech`. The Buck targets drifted from the sources synced from upstream: the Gemma4 enablement (pytorch#20979) added an unconditional `executorch.examples.models.gemma4` import with no owning target for `gemma4/__init__.py`, Granite-Speech added `model/audio_encoder.py` plus a `granite_speech` import, and QAD (pytorch#21036) added `quantize/qat.py`, `dataset/{constants,targets}.py` and the `train/` package, none of which are in any target.

This adds a `gemma4` library owning `gemma4/__init__.py`, a new `train` library (including its `train/config/*.yaml` resources), the missing sources in `static_llama`, `dataset` and `quantize`, and the `gemma4` and `granite_speech` deps on `llama_lib`. The `fbcode/` and `xplat/` copies are kept byte-identical.

Known limitation, not addressed here: under Buck `QNN_SDK_ROOT` is a placeholder, so `is_qnn_sdk_version_less_than("2.35")` cannot detect the SDK version and masked softmax is disabled during export even though the pinned SDK (2.50) supports it.

Authored with Claude Code.

Differential Revision: D127006045
@billmguo
billmguo requested a review from psiddh as a code owner October 22, 2026 21:53
@pytorch-bot

pytorch-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 36 Pending, 2 Unclassified Failures

As of commit b704557 with merge base 71a713c (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:

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 Oct 22, 2026
@meta-codesync

meta-codesync Bot commented Oct 22, 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 D127006045.

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

@psiddh psiddh added the module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ label Oct 22, 2026
@meta-codesync
meta-codesync Bot merged commit 2c3e231 into pytorch:main Oct 22, 2026
238 of 246 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 module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants