Skip to content

Commit

Permalink
ggml-qnn: refine the scripts of Android command line program of UT (#228
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zhouwg authored Jun 2, 2024
1 parent 7f23543 commit 4d79860
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
15 changes: 13 additions & 2 deletions core/ggml/llamacpp/tests/ggml-qnn/build-ggml-qnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ set -e
#https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools
QNN_SDK_PATH=/opt/qcom/aistack/qnn/2.20.0.240223/


ANDROID_NDK=`pwd`/android-ndk-r26c
#for this project, re-use the existing ANDROID_NDK in prebuilts/toolchain/android-ndk-r26c directly
#for upstream PR, check and download ANDROID_NDK in this directory when this script is used at the first time
#ANDROID_NDK=`pwd`/android-ndk-r26c
ANDROID_PLATFORM=android-34
TARGET=ggml-qnn-test

Expand Down Expand Up @@ -88,6 +89,16 @@ function remove_temp_dir()
fi
}


#for this project, re-use the existing ANDROID_NDK in prebuilts/toolchain/android-ndk-r26c directly
show_pwd
if [ "x${PROJECT_ROOT_PATH}" == "x" ]; then
echo "pwd is `pwd`"
echo "pls run . build/envsetup in project's toplevel directory firstly"
exit 1
fi
. ${PROJECT_ROOT_PATH}/build/public.sh || (echo "can't find public.sh"; exit 1)

show_pwd
check_and_download_ndk
check_qnn_sdk
Expand Down
18 changes: 14 additions & 4 deletions core/ggml/llamacpp/tests/ggml-qnn/run-ggml-qnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,24 @@ function main()

check_qnn_sdk

unset $ggmlop
unset $qnnbackend
unset ggmlop
unset qnnbackend
if [ $# == 0 ]; then
ggmlop="GGML_OP_ADD"
qnnbackend=0
elif [ $# == 1 ]; then
ggmlop=$1
qnnbackend=0
if [ "$1" == "-h" ]; then
#avoid upload command line program to Android phone in this scenario
show_usage
exit 1
elif [ "$1" == "help" ]; then
#avoid upload command line program to Android phone in this scenario
show_usage
exit 1
else
ggmlop=$1
qnnbackend=0
fi
elif [ $# == 2 ]; then
ggmlop=$1
qnnbackend=$2
Expand Down
4 changes: 2 additions & 2 deletions docs/what-is-the-most-difficult-problem-for-this-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
I'm learning and practing AI tech by study the source codes of ggml(or ncnn) as an independent programmer although parts of them(the real/hardcore AI tech) are really hard to understand quickly. This is not the most important difficult problem for this project.


The most important difficult problem for this project is interference of GFW: a paid proxy must be used for reliable access to github.com and huggingface.
The most important difficult problem for this project is the big interference of GFW: a paid proxy must be used for reliable access to github.com and huggingface.

![Screenshot from 2024-06-01 08-00-20](https://github.com/zhouwg/kantv/assets/6889919/eb9a5c35-dd63-478f-8510-c4913f4c4038)


The cost of purchase a paid proxy is really not cheap for an independent programmer(the LLM models is so big and I have to downgrade the bandwidth of proxy after complete downloading the LLM models, of course, open/close the paid proxy on demand is essential for purpose of costdown):
The cost of purchase a paid proxy is really not cheap for an independent programmer(the LLM models is so big and I have to downgrade the bandwidth of proxy after complete downloading the LLM models, of course, open/close the paid proxy on demand is essential for purpose of costdown).

0 comments on commit 4d79860

Please sign in to comment.