ggml-hexagon v0.98(v20250625) #54
zhouwg
announced in
Announcements
Replies: 2 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Overview
the ggml-hexagon v0.98(ggml-hexagon.cpp v1.13 + ggml-dsp v0.98) is released on 20250625(June 25 2025).
fully source code of ggml-hexagon.cpp: https://github.com/zhouwg/ggml-hexagon/blob/self-build/ggml/src/ggml-hexagon/ggml-hexagon.cpp
reference source code of ggml-dsp: https://github.com/zhouwg/ggml-hexagon/tree/self-build/ggml/src/ggml-hexagon/kernels
test phone is a Snapdragon 8Elite based Android phone and a Snapdragon 8Gen3 based Android phone, test model is qwen1_5-1_8b-chat-q4_0.gguf. QNN SDK is v2.35.0.250530, Hexagon SDK is v6.2.0.1, Android NDK is android-ndk-r28.
computation results in the following test cases can be reproduced by third-party or AI experts otherwise the benchmark data is meaningless.
Supported Qualcomm mobile SoC
for simplify workflow, only support following two HTP archs at the moment.
Android phone equipped with Qualcomm Snapdragon 8Elite is strongly recommended, because
for 8Gen3(0x8c75):
for 8Elite(0x8c79):

Highlights
How to verify on Android phone
a Linux machine is required for following steps, Android phone equipped with Qualcomm Snapdragon 8Elite is strongly recommended.
the following steps have verified in a fresh&clean ggml-hexagon project with 8Elite based Android phone.
https://github.com/zhouwg/ggml-hexagon
./scripts/build-run-android.sh
modify following in the scripts/build-run-android.sh for your phone accordingly(used to make sure the appropriate libggmldsp-skel.so matches the test phone:libggmldsp-skelv75.so for 8Gen3, libggmldsp-skelv79.so for 8Elite).

https://github.com/zhouwg/ggml-hexagon/blob/self-build/scripts/build-run-android.sh#L103-L104
build
./scripts/build-run-android.sh build
upload QNN runtime libs to phone for compare performance between QNN-CPU, QNN-GPU, QNN-NPU, Hexagon-cDSP, ggml
./scripts/build-run-android.sh updateqnnlib
run test-backend-ops on Snapdragon based phone
./scripts/build-run-android.sh run_testops
run LLM inference via cDSP on Snapdragon based phone(the default LLM model is qwen1_5-1_8b-chat-q4_0.gguf)
./scripts/build-run-android.sh run_llamacli 3 (the following benchmark data might-be depend on workload of Android OS)
run ggmlhexagon-benchmark on Snapdragon based phone
./scripts/build-run-android.sh run_benchmark ADD 0 (benchmark of QNN-CPU)
./scripts/build-run-android.sh run_benchmark ADD 1 (benchmark of QNN-GPU)
./scripts/build-run-android.sh run_benchmark ADD 2 (benchmark of QNN-NPU)
./scripts/build-run-android.sh run_benchmark ADD 3 (benchmark of Hexagon-cDSP)
./scripts/build-run-android.sh run_benchmark ADD 4 (benchmark of ggml)
./scripts/build-run-android.sh run_benchmark MUL_MAT 0 (benchmark of QNN-CPU)
./scripts/build-run-android.sh run_benchmark MUL_MAT 1 (benchmark of QNN-GPU)
./scripts/build-run-android.sh run_benchmark MUL_MAT 2 (benchmark of QNN-NPU)
./scripts/build-run-android.sh run_benchmark MUL_MAT 3 (benchmark of Hexagon-cDSP)
./scripts/build-run-android.sh run_benchmark MUL_MAT 4 (benchmark of ggml)
verify speed/performance of mulmat on cDSP side
./scripts/build-run-android.sh run_benchmark MUL_MAT 3 0/1/2/3/4/5/6/32/33
verify accuracy/computation result of mulmat on cDSP side
./scripts/build-run-android.sh run_testop MUL_MAT 0/1/2/3/4/5/6/32/33
observe logs on ARM AP side
Todo
All reactions