Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2ceaaf5

Browse filesBrowse files
committed
ggml-qnn: pr to upstream
1 parent 25789ae commit 2ceaaf5
Copy full SHA for 2ceaaf5

File tree

Expand file treeCollapse file tree

10 files changed

+1522
-1604
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+1522
-1604
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ include(CheckIncludeFileCXX)
66
set(CMAKE_WARN_UNUSED_CLI YES)
77

88
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
9-
set(CMAKE_VERBOSE_MAKEFILE on)
109

1110
if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
1211
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)

‎cmake/aarch64-w64-mingw32.cmake

Copy file name to clipboardExpand all lines: cmake/aarch64-w64-mingw32.cmake
-18Lines changed: 0 additions & 18 deletions
This file was deleted.

‎cmake/arm64-windows-cygwin.cmake

Copy file name to clipboardExpand all lines: cmake/arm64-windows-cygwin.cmake
-16Lines changed: 0 additions & 16 deletions
This file was deleted.

‎cmake/arm64-windows-llvm.cmake

Copy file name to clipboardExpand all lines: cmake/arm64-windows-llvm.cmake
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ set( CMAKE_CXX_COMPILER clang++ )
99
set( CMAKE_C_COMPILER_TARGET ${target} )
1010
set( CMAKE_CXX_COMPILER_TARGET ${target} )
1111

12-
#set( arch_c_flags "-march=armv8.7-a -fvectorize -ffp-model=fast -fno-finite-math-only" )
13-
#set( warn_c_flags "-Wno-format -Wno-unused-variable -Wno-unused-function -Wno-gnu-zero-variadic-macro-arguments" )
12+
set( arch_c_flags "-march=armv8.7-a -fvectorize -ffp-model=fast -fno-finite-math-only" )
13+
set( warn_c_flags "-Wno-format -Wno-unused-variable -Wno-unused-function -Wno-gnu-zero-variadic-macro-arguments" )
1414

1515
set( CMAKE_C_FLAGS_INIT "${arch_c_flags} ${warn_c_flags}" )
1616
set( CMAKE_CXX_FLAGS_INIT "${arch_c_flags} ${warn_c_flags}" )

‎ggml/src/ggml-qnn/CMakeLists.txt

Copy file name to clipboardExpand all lines: ggml/src/ggml-qnn/CMakeLists.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
77
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
88
set(QNN_DEFAULT_LIB_SEARCH_PATH "C:\\" CACHE STRING "customized library search path for QNN backend")
99
elseif(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
10-
set(QNN_DEFAULT_LIB_SEARCH_PATH "/cygdrive/c/qairt/2.31.0.250130/" CACHE STRING "customized library search path for QNN backend")
10+
set(QNN_DEFAULT_LIB_SEARCH_PATH "/cygdrive/c/qairt/2.32.0.250228/" CACHE STRING "customized library search path for QNN backend")
1111
else()
1212
message(FATAL_ERROR "QNN now only available on Android and Windows(Windows on ARM)")
1313
endif()

‎ggml/src/ggml-qnn/ggml-qnn.cpp

Copy file name to clipboardExpand all lines: ggml/src/ggml-qnn/ggml-qnn.cpp
+1,500-1,084Lines changed: 1500 additions & 1084 deletions
Large diffs are not rendered by default.

‎scripts/build-run-android.sh

Copy file name to clipboardExpand all lines: scripts/build-run-android.sh
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GGUF_MODEL_NAME=/sdcard/qwen1_5-1_8b-chat-q4_0.gguf
1414
#https://www.qualcomm.com/developer/software/qualcomm-ai-engine-direct-sdk
1515
#https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools
1616
QNN_SDK_URL=https://www.qualcomm.com/developer/software/qualcomm-ai-engine-direct-sdk
17-
QNN_SDK_PATH=/opt/qcom/aistack/qairt/2.31.0.250130/
17+
QNN_SDK_PATH=/opt/qcom/aistack/qairt/2.32.0.250228/
1818

1919
#default is QNN NPU
2020
qnnbackend=2
@@ -97,11 +97,14 @@ function check_qnn_libs()
9797
{
9898
#reuse the cached qnn libs on Android phone
9999
adb shell ls ${REMOTE_PATH}/libQnnCpu.so
100+
adb shell ls ${REMOTE_PATH}/libQnnGpu.so
101+
adb shell ls ${REMOTE_PATH}/libQnnHtp.so
100102
if [ $? -eq 0 ]; then
101103
printf "QNN libs already exist on Android phone\n"
102104
else
103105
update_qnn_libs
104106
fi
107+
update_qnn_cfg
105108
}
106109

107110

@@ -119,6 +122,12 @@ function update_qnn_libs()
119122
}
120123

121124

125+
function update_qnn_cfg()
126+
{
127+
adb push ./scripts/ggml-qnn.cfg ${REMOTE_PATH}/
128+
}
129+
130+
122131
function build_ggml_qnn()
123132
{
124133
show_pwd

‎scripts/ggml-qnn.cfg

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[general]
2+
# enable/disable QNN's internal log
3+
print_qnn_internal_log = 0
4+
# 0: general approach,similar to ggml-sycl or ggml-cann
5+
# 1: mapping entire ggml cgraph to QNN graph
6+
inference_approach = 0
7+
8+
[npu]
9+
npu_inference_datatype = "fp16"

‎tests/CMakeLists.txt

Copy file name to clipboardExpand all lines: tests/CMakeLists.txt
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ llama_target_and_test(test-chat-template.cpp)
137137
# llama_target_and_test(test-opt.cpp) # SLOW
138138
llama_target_and_test(test-gguf.cpp)
139139
llama_target_and_test(test-backend-ops.cpp)
140-
llama_target_and_test(ggml-qnn-ut.cpp)
141140

142141
llama_target_and_test(test-model-load-cancel.cpp LABEL "model")
143142
llama_target_and_test(test-autorelease.cpp LABEL "model")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.