Skip to content

Build for Snapdragon 8 Elite#650

Closed
wennitao wants to merge 1 commit intoUbiquitousLearning:mainfrom
wennitao:fix/qnn-android-aot
Closed

Build for Snapdragon 8 Elite#650
wennitao wants to merge 1 commit intoUbiquitousLearning:mainfrom
wennitao:fix/qnn-android-aot

Conversation

@wennitao
Copy link

@wennitao wennitao commented Mar 11, 2026

Change Hexagon SDK version to v79

Summary by CodeRabbit

  • New Features

    • Added environment variable support for SDK path configuration, with automatic fallbacks to default locations for more flexible deployments.
  • Chores

    • Updated Android build configuration to support newer Hexagon tool versions with intelligent version detection.
    • Enhanced security by ignoring sensitive artifacts and large model directories.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e880261-987a-4d14-8fd0-5ed8475d163a

📥 Commits

Reviewing files that changed from the base of the PR and between 10d3d6a and 803262f.

📒 Files selected for processing (10)
  • .gitignore
  • examples/llama_qnn_aot/compile.cpp
  • examples/llama_qnn_aot/compile_sha.cpp
  • examples/qwen2_qnn_aot/compile.cpp
  • examples/qwen2_qnn_aot/compile_sha.cpp
  • examples/qwen3_qnn_aot/compile.cpp
  • examples/qwen3_qnn_aot/compile_sha.cpp
  • mllm/backends/qnn/aot/QnnWrappersAPI.cpp
  • mllm/backends/qnn/custom-op-package/LLaMAPackage/Makefile
  • tasks/build_android_qnn.yaml

📝 Walkthrough

Walkthrough

The pull request adds dynamic environment-based path resolution for QNN SDK and Hexagon tools across compilation examples and runtime components. It replaces hardcoded default paths with runtime detection using environment variables, updates Hexagon tool version discovery with fallback mechanisms, adjusts the Android build target version, and adds binary/model file ignore patterns.

Changes

Cohort / File(s) Summary
Git Configuration
.gitignore
Adds ignore patterns for sensitive/binary files (*.pem, *.mir, *.bin) and large model directories (Qwen3-1.7b, Qwen3-1.7b-mllm).
QNN AOT Compilation Examples
examples/llama_qnn_aot/compile.cpp, examples/llama_qnn_aot/compile_sha.cpp, examples/qwen2_qnn_aot/compile.cpp, examples/qwen2_qnn_aot/compile_sha.cpp, examples/qwen3_qnn_aot/compile.cpp, examples/qwen3_qnn_aot/compile_sha.cpp
Introduces anonymous namespace with defaultQnnEnvPath() helper that checks QAIRT_SDK_ROOT environment variable and falls back to hardcoded path; replaces fixed default argument with dynamic resolution.
QNN Runtime Environment
mllm/backends/qnn/aot/QnnWrappersAPI.cpp
Adds private helper utilities (normalizeLibPath, getPossibleQnnDynLibPaths, prependToLdLibraryPath, preloadHostRuntimeLib, prepareHostRuntimeDeps) for dynamic QNN library discovery and host runtime dependency preloading; replaces hardcoded paths with environment-driven resolution in initialization.
Hexagon Build Configuration
mllm/backends/qnn/custom-op-package/LLaMAPackage/Makefile
Introduces dynamic Hexagon tools version detection (HEXAGON_TOOLS_VERSION_19X) with directory-based fallback; unifies version references (V73, V75, V79, V81) and HEXAGON_TOOLS_VERSION_X86 to use discovered versions; adds informational warnings for fallback usage.
Android Build Task
tasks/build_android_qnn.yaml
Updates QNN target from htp_v75 to htp_v79; converts absolute CMake install prefix path to relative path variable (\$PWD).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • liang1232018
  • chenghuaWang
  • oreomaker

Poem

🐰 Paths that once were carved in stone,
Now dance with env'ment vars, full-grown!
From hardcoded lines to dynamic grace,
Our QNN finds its rightful place.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wennitao wennitao closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant