Skip to content

Commit 28a572b

Browse files
author
zhouwg
committed
ggml-hexagon: fix a minior issue in dev ops
1 parent fe55240 commit 28a572b

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

ggml/src/ggml-hexagon/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,16 @@ function(ggml_hexagon_build_kernel KNAME)
115115
)
116116
endfunction()
117117

118+
function(ggml_hexagon_setup_cfg KNAME)
119+
message(STATUS "ggml_hexagon: setup runtime configuration file ${KNAME}")
120+
add_custom_command(
121+
TARGET ${PROJECT_NAME}
122+
POST_BUILD
123+
COMMAND echo "current working path:`pwd`\n"
124+
COMMAND /bin/cp -fv ../../../../../scripts/${KNAME} ../../../bin/
125+
COMMENT "setup runtime configuration file"
126+
)
127+
endfunction()
128+
118129
ggml_hexagon_build_kernel("cdsp")
130+
ggml_hexagon_setup_cfg("ggml-hexagon.cfg")

ggml/src/ggml-hexagon/ggml-hexagon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ static void ggmlhexagon_load_cfg() {
18301830
});
18311831
std::string precision_mode;
18321832
std::string ggml_hexagon_version;
1833-
hexagoncfg_instance.get_stringvalue("general", "ggml_hexagon_version", ggml_hexagon_version, "1.03");
1833+
hexagoncfg_instance.get_stringvalue("general", "version", ggml_hexagon_version, "1.00");
18341834
hexagoncfg_instance.get_intvalue("general", "enable_perf", g_hexagon_appcfg.enable_perf, 1);
18351835
hexagoncfg_instance.get_intvalue("general", "print_tensors_info", g_hexagon_appcfg.print_tensors_info, 0);
18361836
hexagoncfg_instance.get_intvalue("general", "dump_op_info", g_hexagon_appcfg.dump_op_info, 0);

scripts/build-run-android.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PWD=`pwd`
1212
REMOTE_PATH=/data/local/tmp/
1313
#LLM model file on Android phone
1414
GGUF_MODEL_NAME=/sdcard/gemma-3-4b-it-Q8_0.gguf
15+
#https://huggingface.co/Qwen/Qwen1.5-1.8B-Chat-GGUF/blob/main/qwen1_5-1_8b-chat-q4_0.gguf
1516
GGUF_MODEL_NAME=/sdcard/qwen1_5-1_8b-chat-q4_0.gguf
1617

1718
#Android NDK can be found at:
@@ -241,6 +242,10 @@ function prepare_run_on_phone()
241242
adb push ./out/android/bin/*.so ${REMOTE_PATH}/
242243
fi
243244
adb push ./out/android/bin/${program} ${REMOTE_PATH}/
245+
#for non developers: deploy dev ops once time with build outputs in ./out/android/bin/
246+
#adb push ./out/android/bin/ggml-hexagon.cfg ${REMOTE_PATH}/
247+
#for developers: modify ./scritps/ggml-hexagon.cfg before run
248+
adb push ./scripts/ggml-hexagon.cfg ${REMOTE_PATH}/
244249
adb shell chmod +x ${REMOTE_PATH}/${program}
245250
}
246251

0 commit comments

Comments
 (0)