Improve QNN backend AOT user experience#17989
Improve QNN backend AOT user experience#17989abhinaykukkadapu merged 6 commits intogh/abhinaykukkadapu/16/basefrom
Conversation
- 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-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17989
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 6 Pending, 2 Unrelated FailuresAs of commit 54a68e6 with merge base eb92cec ( 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. |
This PR needs a
|
- 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-poisoned]
| continue | ||
| key, _, val = line.partition("=") | ||
| # Strip quotes and resolve bash-style ${VAR} references | ||
| val = val.strip().strip('"').strip("'") |
There was a problem hiding this comment.
Feel like val.strip('"') is enough.
|
|
||
| if total > 0: | ||
| pct = (i + 1) * 100 // total | ||
| _progress(f"\r[QNN] Extracting: {pct}%") |
There was a problem hiding this comment.
Would you want to align the message in L360?
- 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 ## Test plan (user flows) 1. Extracting and reusing QNN SDK from cache <img width="901" height="487" alt="Screenshot 2026-03-06 at 12 02 30 PM" src="https://github.com/user-attachments/assets/90be5a8a-f5f6-4228-847f-9f5fb1978c74" /> 2. Show clear errors and actionable steps when there is a download failure <img width="1943" height="246" alt="Screenshot 2026-03-06 at 12 02 58 PM" src="https://github.com/user-attachments/assets/c09d30fe-0bf3-49d5-8bff-48aec5c7b687" /> 3. Automatically detect and download latest QNN sdk basing from `qnn_config.sh` <img width="831" height="326" alt="Screenshot 2026-03-06 at 12 07 04 PM" src="https://github.com/user-attachments/assets/8799fd29-873a-4c3b-a36d-204b0d07dbe2" /> 4. Set `QNN_SDK_ROOT` and `LD_LIBRARY_PATH` for the python process. <img width="859" height="230" alt="Screenshot 2026-03-06 at 12 42 49 PM" src="https://github.com/user-attachments/assets/3e6bf0bc-6fe7-41dc-a013-032099ab35a3" /> [ghstack-poisoned]
|
@haowhsu-quic addressed comments, can you please stamp these two pr stack if you are ok with the changes. |
- 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 ## Test plan (user flows) 1. Extracting and reusing QNN SDK from cache <img width="901" height="487" alt="Screenshot 2026-03-06 at 12 02 30 PM" src="https://github.com/user-attachments/assets/90be5a8a-f5f6-4228-847f-9f5fb1978c74" /> 2. Show clear errors and actionable steps when there is a download failure <img width="1943" height="246" alt="Screenshot 2026-03-06 at 12 02 58 PM" src="https://github.com/user-attachments/assets/c09d30fe-0bf3-49d5-8bff-48aec5c7b687" /> 3. Automatically detect and download latest QNN sdk basing from `qnn_config.sh` <img width="831" height="326" alt="Screenshot 2026-03-06 at 12 07 04 PM" src="https://github.com/user-attachments/assets/8799fd29-873a-4c3b-a36d-204b0d07dbe2" /> 4. Set `QNN_SDK_ROOT` and `LD_LIBRARY_PATH` for the python process. <img width="859" height="230" alt="Screenshot 2026-03-06 at 12 42 49 PM" src="https://github.com/user-attachments/assets/3e6bf0bc-6fe7-41dc-a013-032099ab35a3" /> cc cccclai cbilgin [ghstack-poisoned]
- 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 ## Test plan (user flows) 1. Extracting and reusing QNN SDK from cache <img width="901" height="487" alt="Screenshot 2026-03-06 at 12 02 30 PM" src="https://github.com/user-attachments/assets/90be5a8a-f5f6-4228-847f-9f5fb1978c74" /> 2. Show clear errors and actionable steps when there is a download failure <img width="1943" height="246" alt="Screenshot 2026-03-06 at 12 02 58 PM" src="https://github.com/user-attachments/assets/c09d30fe-0bf3-49d5-8bff-48aec5c7b687" /> 3. Automatically detect and download latest QNN sdk basing from `qnn_config.sh` <img width="831" height="326" alt="Screenshot 2026-03-06 at 12 07 04 PM" src="https://github.com/user-attachments/assets/8799fd29-873a-4c3b-a36d-204b0d07dbe2" /> 4. Set `QNN_SDK_ROOT` and `LD_LIBRARY_PATH` for the python process. <img width="859" height="230" alt="Screenshot 2026-03-06 at 12 42 49 PM" src="https://github.com/user-attachments/assets/3e6bf0bc-6fe7-41dc-a013-032099ab35a3" /> cc cccclai cbilgin [ghstack-poisoned]
- 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 ## Test plan (user flows) 1. Extracting and reusing QNN SDK from cache <img width="901" height="487" alt="Screenshot 2026-03-06 at 12 02 30 PM" src="https://github.com/user-attachments/assets/90be5a8a-f5f6-4228-847f-9f5fb1978c74" /> 2. Show clear errors and actionable steps when there is a download failure <img width="1943" height="246" alt="Screenshot 2026-03-06 at 12 02 58 PM" src="https://github.com/user-attachments/assets/c09d30fe-0bf3-49d5-8bff-48aec5c7b687" /> 3. Automatically detect and download latest QNN sdk basing from `qnn_config.sh` <img width="831" height="326" alt="Screenshot 2026-03-06 at 12 07 04 PM" src="https://github.com/user-attachments/assets/8799fd29-873a-4c3b-a36d-204b0d07dbe2" /> 4. Set `QNN_SDK_ROOT` and `LD_LIBRARY_PATH` for the python process. <img width="859" height="230" alt="Screenshot 2026-03-06 at 12 42 49 PM" src="https://github.com/user-attachments/assets/3e6bf0bc-6fe7-41dc-a013-032099ab35a3" /> cc cccclai cbilgin [ghstack-poisoned]
|
@pytorchbot merge |
|
Mergebot is not configured for this repository. Please use the merge button provided by GitHub. |
35396f6
into
gh/abhinaykukkadapu/16/base
Stack from ghstack (oldest at bottom):
download_qnn_sdk.py, eliminating version duplication
glibc (~10MB) downloads with percentage and MB counters
(ChunkedEncodingError, ConnectionError), resumes from where it
left off using HTTP Range headers instead of restarting
see status messages (previously all output was swallowed)
inside the pip package directory, surviving pip reinstalls
detection when qnn_config.sh version changes
including full SDK download URL and env var setup instructions
Test plan (user flows)
qnn_config.shQNN_SDK_ROOTandLD_LIBRARY_PATHfor the python process.cc @cccclai @cbilgin