Skip to content

Download QNN SDK outside of CMake for wheel builds (v2)#17751

Merged
larryliu0820 merged 2 commits intomainfrom
download-qnn-sdk-outside-cmake
Mar 1, 2026
Merged

Download QNN SDK outside of CMake for wheel builds (v2)#17751
larryliu0820 merged 2 commits intomainfrom
download-qnn-sdk-outside-cmake

Conversation

@larryliu0820
Copy link
Contributor

Unlike the reverted #17717 which set EXECUTORCH_BUILD_QNN=ON in pybind.cmake (causing all pybind-preset CI jobs to attempt the flaky cmake-time SDK download), this keeps QNN OFF in the preset. Only wheel builds enable it: setup.py detects QNN_SDK_ROOT and passes -DEXECUTORCH_BUILD_QNN=ON to cmake.

The pre_build_script downloads the SDK before cmake runs, avoiding the flaky in-cmake download. The cmake fallback download is kept as a last resort, gated on QNN_SDK_ROOT not already being set.

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 26, 2026

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Pending, 2 Unrelated Failures

As of commit 8bcc146 with merge base f478cb3 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs 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 Feb 26, 2026
@github-actions
Copy link

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.

@larryliu0820 larryliu0820 force-pushed the download-qnn-sdk-outside-cmake branch from efe9333 to 39ba417 Compare February 26, 2026 22:57
Unlike the reverted #17717 which set EXECUTORCH_BUILD_QNN=ON in
pybind.cmake (causing all pybind-preset CI jobs to attempt the flaky
cmake-time SDK download), this keeps QNN OFF in the preset. Only wheel
builds enable it: setup.py detects QNN_SDK_ROOT and passes
-DEXECUTORCH_BUILD_QNN=ON to cmake.

The pre_build_script downloads the SDK before cmake runs, avoiding the
flaky in-cmake download. The cmake fallback download is kept as a
last resort, gated on QNN_SDK_ROOT not already being set.

Also fix test_wheel_package_qnn.sh to export LD_LIBRARY_PATH so
libQnnHtp.so can be found at runtime, and check InitBackend() return
value in qnn_manager_lifecycle.py to prevent segfaults when QNN
backend initialization fails.

Co-authored-by: Claude <noreply@anthropic.com>
@larryliu0820 larryliu0820 force-pushed the download-qnn-sdk-outside-cmake branch from 39ba417 to f37a7d7 Compare February 27, 2026 11:16
@larryliu0820 larryliu0820 merged commit 88e5005 into main Mar 1, 2026
354 of 359 checks passed
@larryliu0820 larryliu0820 deleted the download-qnn-sdk-outside-cmake branch March 1, 2026 00:19
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