This directory is an offline Genie/QNN bundle for running Qwen3-0.6B on SA8775P ADP HTP.
1cd /Users/wangzhao/Documents/Qnnllm/files
2
3SERIAL=844e658e
4DEVICE_DIR=/data/local/tmp/qwen3_0_6b_genie
5MODEL_DIR=qwen3_0_6b_genie_sa8775_ctx256_download
6RUNTIME_DIR=qairt246_android_v73_runtime
7
8adb -s "$SERIAL" shell "rm -rf $DEVICE_DIR && mkdir -p $DEVICE_DIR/bin $DEVICE_DIR/lib $DEVICE_DIR/dsp"
9
10# Push the Genie model bundle.
11adb -s "$SERIAL" push "$MODEL_DIR/." "$DEVICE_DIR/"
12
13# Push executable runtime tools.
14adb -s "$SERIAL" push "$RUNTIME_DIR/bin/genie-t2t-run" "$DEVICE_DIR/bin/"
15
16# Push Android ARM-side Genie/QNN shared libraries.
17adb -s "$SERIAL" push "$RUNTIME_DIR/lib/." "$DEVICE_DIR/lib/"
18
19# Push DSP/HTP-side skeleton/runtime libraries.
20adb -s "$SERIAL" push "$RUNTIME_DIR/dsp/." "$DEVICE_DIR/dsp/"
21
22adb -s "$SERIAL" shell "chmod +x $DEVICE_DIR/bin/genie-t2t-run"
The runtime version must be compatible with the context binary and device firmware.
1adb -s "$SERIAL" shell "cat > $DEVICE_DIR/chat.txt <<'EOF'
2<|im_start|>system
3You are a helpful AI assistant.<|im_end|>
4<|im_start|>user
5Give me a short introduction to large language model.<|im_end|>
6<|im_start|>assistant
7EOF"
Run with HTP. Use semicolon separators in DSP library path values on this device family.
1adb -s "$SERIAL" logcat -c
2adb -s "$SERIAL" shell "cd $DEVICE_DIR && \
3 export LD_LIBRARY_PATH=\$PWD/lib:\$PWD/bin:\$PWD && \
4 export ADSP_LIBRARY_PATH='/vendor/lib/rfsa/adsp;$PWD/dsp;$PWD/lib' && \
5 export CDSP_LIBRARY_PATH='/vendor/lib/rfsa/adsp;$PWD/dsp;$PWD/lib' && \
6 export CDSP1_LIBRARY_PATH='/vendor/lib/rfsa/adsp;$PWD/dsp;$PWD/lib' && \
7 timeout 180 ./bin/genie-t2t-run -c genie_config.json --prompt_file chat.txt 2>&1"