Back to the ticker

llama.cpp Hexagon NPU backend tested on a Snapdragon 8 Gen 3 phone

A user has reported results from llama.cpp’s Hexagon NPU backend on a OnePlus 12 with a Snapdragon 8 Gen 3. They cross-compiled llama.cpp on Ubuntu following the project’s Snapdragon documentation and ran it from Termux on the phone.

The reported figures are 8 tokens per second of prompt processing and 4.5 of generation with gemma-3-12b-it-qat at Q4_0, and 20 tokens per second of prompt processing and 12.5 of generation with gemma-3-4b-it-qat at Q4_0. According to the report the speed is about the same as running on the same chip’s CPU, but the phone does not get hot.

The report lists several limitations. The backend accepts only Q4_0, IQ4_NL, MXFP4, Q8_0 and F32 files, and does not support KV cache quantisation. It runs on chips as old as the Snapdragon 888, but the poster notes that only the 8 Gen 2 and newer carry the tensor module used for language models. The Hexagon NPU can address 4 GB, so a model plus KV cache beyond that has to be split across more than one NPU device:

LD_LIBRARY_PATH=./lib:/vendor/lib64 \
  ADSP_LIBRARY_PATH=./lib \
  GGML_HEXAGON_NDEV=2 \
  ./bin/llama-completion \
  -m /sdcard/gguf/gemma-3-12b-it-qat-Q4_0.gguf \
  -ngl 99 --device HTP0,HTP1 \
  -sys 'You are a helpful AI assistant'

For context the poster cites 34 INT8 TOPS and 76.8 GB/s of memory bandwidth for the 8 Gen 3 NPU, against 80 TOPS and 228 GB/s for Qualcomm’s X2 Elite Extreme and 248 TOPS and 936 GB/s for an Nvidia RTX 3090. They ask readers with a Snapdragon 8 Elite Gen 5 phone or an X2 Elite Extreme laptop to post their own numbers, since those parts are said to address more than 4 GB and would not need multiple devices.

  1. llada.cpp runs a diffusion LLM on a Snapdragon NPU up to 42 times faster
  2. MLPerf Mobile v6.0 adds Llama tests in 1B, 3B and 8B sizes
  3. Airgap is a React Native kit for support chatbots that answer offline