Skip to content

Improve QNN backend build-from-source user experience#18413

Merged
abhinaykukkadapu merged 3 commits into
mainfrom
gh/abhinaykukkadapu/17/orig
Mar 23, 2026
Merged

Improve QNN backend build-from-source user experience#18413
abhinaykukkadapu merged 3 commits into
mainfrom
gh/abhinaykukkadapu/17/orig

Conversation

@pytorchbot
Copy link
Copy Markdown
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #17990 by @abhinaykukkadapu
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/17/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/17/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/16/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/17/orig

@diff-train-skip-merge

- Read QNN_VERSION from qnn_config.sh instead of hardcoding in
  download_qnn_sdk.py, eliminating version duplication
- Add download progress bars for SDK (~2.4GB), libc++ (~575MB), and
  glibc (~10MB) downloads with percentage and MB counters
- Add extraction progress for SDK, libc++, and tar archives
- Add retry + resume for SDK download — on mid-stream failures
  (ChunkedEncodingError, ConnectionError), resumes from where it
  left off using HTTP Range headers instead of restarting
- Replace NullHandler logger with configured StreamHandler so users
  see status messages (previously all output was swallowed)
- Cache SDK at ~/.cache/executorch/qnn/sdk-<version>/ instead of
  inside the pip package directory, surviving pip reinstalls
- Include version in cache directory name for automatic upgrade
  detection when qnn_config.sh version changes
- Set both QNN_SDK_ROOT and LD_LIBRARY_PATH after auto-download
- Print SDK version and path on first import (cached or fresh)
- Print user-provided QNN_SDK_ROOT path when set via env var
- Add visible warning before glibc re-exec with guidance
- Replace unhelpful "check logs above" error with actionable message
  including full SDK download URL and env var setup instructions

ghstack-source-id: ddb21d7
Pull Request resolved: #17989
- Remove EXECUTORCH_BUILD_WHEEL_DO_NOT_USE gate in CMakeLists.txt so
  QNN SDK auto-downloads for all build paths (editable installs,
  build.sh), not just wheel builds
- Use shared cache dir (~/.cache/executorch/qnn/) instead of cmake
  build dir, so SDK survives build dir cleans and is shared across
  all build flows
- Remove hard QNN_SDK_ROOT requirement from build.sh — cmake handles
  auto-download during configure when SDK is not set
- Auto-download Android NDK in build.sh via install_qnn_sdk.sh when
  ANDROID_NDK_ROOT is not set
- Fix PYTHON_EXECUTABLE default in build.sh (was checked before being
  used, with a buggy test that never triggered)
- Default EXECUTORCH_BUILD_QNN to ON on Linux x86 in pybind preset,
  matching wheel behavior so editable installs build QNN out of the box
- Redirect download_qnn_sdk.py progress output to stderr when
  --print-sdk-path is used, so cmake can capture the path cleanly

ghstack-source-id: 7a0428c
Pull Request resolved: #17990
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 23, 2026

🔗 Helpful Links

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

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

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 Mar 23, 2026
Base automatically changed from gh/abhinaykukkadapu/16/orig to main March 23, 2026 16:41
@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.

@abhinaykukkadapu abhinaykukkadapu merged commit 9846a56 into main Mar 23, 2026
135 of 140 checks passed
@abhinaykukkadapu abhinaykukkadapu deleted the gh/abhinaykukkadapu/17/orig branch March 23, 2026 16:46
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