Granite 4.2 3B for the Snapdragon 8 Gen 1 NPU — LiteRT-LM
ibm-granite/granite-4.2-3b packaged for LiteRT-LM and compiled for the Hexagon NPU of the Snapdragon 8 Gen 1 (SM8450, Hexagon v69), as 12 QNN contexts. Built for and measured on a Samsung Galaxy S22 Ultra (SM-S908E).
Two bundles, same weights, different KV-cache size:
granite42-3b_sm8450.litertlm— context 4096granite42-3b-ctx2048_sm8450.litertlm— context 2048, a little faster
Text only. Thinking mode works.
Google publishes LiteRT-LM bundles for SM8550, SM8650 and SM8750 only. A bundle for another Hexagon version gets
Failed to create QNN context: 1002, so this one had to be built.
The easy way to run it: AutoDroid Studio
AutoDroid Studio is the Android app this model was built for and measured in. It runs these bundles on the NPU of a Snapdragon 8 Gen 1 phone, exactly as published here. "Running it" below is for people who want to drive it by hand.
Why use it:
- Nothing to set up. No runner to build, no
adb, no environment variables. The app sets up the Qualcomm runtime itself and finds and downloads models from Hugging Face in its own browser. - Chat on the phone, with the model's reasoning shown when you want it, and a benchmark to compare models and backends on your own hardware.
- A model server for your other devices. An OpenAI-compatible HTTP API, a web dashboard and an MCP endpoint on your local network, so existing tools, scripts and agents on your computer can use the phone as their model backend. A spare phone on a charger works well for this.
- Automation. A visual workflow builder with 70+ task types (AI steps, HTTP, RSS, PDF, OCR, SQLite, JavaScript), run on a schedule, from a webhook or as a Telegram or Discord bot.
- Your own documents. On-device embeddings, so the chat model can answer from your files.
- Private. No ads, no analytics, no account. Models run on the phone, and your data leaves it only when you send it somewhere yourself.
Get AutoDroid Studio on Google Play
At a glance
| Files | granite42-3b_sm8450.litertlm (2.01 GB), granite42-3b-ctx2048_sm8450.litertlm (2.01 GB) |
| Base model | ibm-granite/granite-4.2-3b (dense, 40 layers, hidden 2560, 8 KV heads x 64, vocab 100352) |
| Contexts | 4096 or 2048 tokens, shared by prompt and answer |
| On the NPU | all 40 decoder layers (12 QNN contexts); the lm_head runs on the CPU (XNNPACK, 4-bit) |
| Weights | all decoder linears 4-bit, GPTQ (act-order, per-channel clip search) |
| Activations / KV cache | 16-bit / 8-bit; norms, residual adds, RoPE and the massive-activation layers (6, 39) in float / fp16 |
| Calibration | 8 prompts (about 10 min each on CPU) |
| QNN SDK | QAIRT 2.50.0.260828 |
| LiteRT-LM | v0.17.1 |
Measured on the phone (Galaxy S22 Ultra, big cores, from a shell)
| Decode | Prefill | |
|---|---|---|
granite42-3b_sm8450.litertlm (ctx 4096) |
~8 tok/s | ~8 tok/s |
granite42-3b-ctx2048_sm8450.litertlm (ctx 2048) |
~10–11 tok/s | ~10–11 tok/s |
In an Android app, end to end, about 6 tok/s (a 1,470-token story).
Quality
Held-out perplexity (the same text through each stage): float 9.08, plain round-to-nearest 4-bit 22.9, GPTQ 4-bit 9.83. Layer-by-layer, every decoder layer matches the float model (cosine >= 0.996) and greedy decoding is identical to the float model's.
CLI eval (6 prompts: a fact, arithmetic, a haiku, a two-sentence explanation, a list, a translation), greedy, raw prompt: 6 of 6 correct on both bundles, thinking on and off. Through an Android app's OpenAI-style endpoint it answered single- and multi-turn chats and a 1,470-token story.
Files
| File | SHA-256 |
|---|---|
granite42-3b_sm8450.litertlm |
9461bd68ff988323f9af9cc7309de148da80b427be47272ac4995c17175d804c |
granite42-3b-ctx2048_sm8450.litertlm |
6a0f7a3b0b40198df4d7807af3f74eee991fb3c6df0f54b80ef659e1912cfe0b |
The tokenizer, chat template and generation metadata are inside the .litertlm; there is nothing
else to download. Not included: the Qualcomm runtime libraries and the LiteRT dispatch library
(see "Running it").
Running it
You need three things besides the bundle. None are included: they are Qualcomm's or Google's to distribute, and the LiteRT ones must match each other.
- QAIRT 2.50 runtime, from
lib/aarch64-android/andlib/hexagon-v69/unsigned/:libQnnHtp.so,libQnnSystem.so,libQnnHtpV69Stub.so,libQnnHtpV69Skel.so. The context binaries inside the bundle were compiled with 2.50.0.260828, and the runtime has to be 2.50 too; the stock 2.39 libraries fail with "Qnn System library version 1.5.0 is mismatched". libLiteRtDispatch_Qualcomm.sobuilt from the LiteRT commit your LiteRT-LM embeds (LiteRT-LM v0.17.1 -> LiteRT9fe5be4). LiteRT 2.2.0's dispatch library crashes LiteRT-LM v0.17.1 when a model is unloaded.litert_lm_main/litert_lm_advanced_mainfrom LiteRT-LM v0.17.1, built for Android arm64.
Put everything in one folder on the phone, then:
cd /data/local/tmp/litert
export LD_LIBRARY_PATH=$PWD ADSP_LIBRARY_PATH=$PWD
./litert_lm_advanced_main --backend=npu --model_path=$PWD/granite42-3b_sm8450.litertlm \
--litert_dispatch_lib_dir=$PWD --use_session --async=false \
--max_num_tokens=2048 --input_prompt_file=$PWD/prompt.txt
prompt.txt holds the fully rendered conversation (--use_session takes raw text):
<|im_start|>system
<|im_end|>
<|im_start|>user
What is the capital of France?<|im_end|>
<|im_start|>assistant
<think></think>
Thinking on ends the prompt with <think>\n instead of <think></think>.
Notes:
- The NPU executor is greedy. Temperature, top-k and seed have no effect on this path.
- One NPU model per process. Unloading a LiteRT NPU model leaves its I/O buffers registered on
the DSP ("Failed to deregister memHandles"); the next, different model can then fail to map
its contexts (
fastrpc_mmapfailed, "Failed to create QNN context: 1002"). Reloading the same model is fine. Restart the process to switch models. - Prompts go in one token per call, so prompt speed equals decode speed (see "Why one graph").
- A foreground/backgrounded app is scheduled on the little cores on some Samsung builds; the CLI
numbers above were taken with
taskset f0(big cores) from a shell.
How it was built
A 3B model is too big for 8-bit weights under v69's ~1.85 GB per-process mapping budget, so all
decoder linears are 4-bit. They were quantized with GPTQ (act-order, per-channel clip search) and
the exact codes and scales are written into the TFLite graph (the quantizer would otherwise
re-derive the scale as max|w|/7). 4-bit 1x1 convs are emitted as FULLY_CONNECTED.
Granite has massive activations: layer 6's MLP writes values around +-11,900 into the residual stream (down_proj outputs up to 37,700) and layer 39 removes them. 16-bit codes are too coarse for normal tokens across that range, so RMSNorm, the residual adds, and the gate*up product and down_proj of layers 6 and 39 stay in float/fp16 (which v69's HTP computes accurately).
Other Granite-specific fixes:
- lm_head on the CPU. The plugin rejects f32 x int4 FULLY_CONNECTED (it stays on the CPU, where XNNPACK is fast), and the output is arranged so nothing NPU-capable consumes an XNNPACK output.
- RoPE in float. Quantized, the position was clamped to the longest calibration sequence (247), RoPE froze and the model degenerated into repetition. The bundle carries a float RoPE subgraph with only its outputs quantized (verified to position 4095).
- The CPU twin used for debugging floors int16 softmax exp() at ~e^-10, which is wrong for long caches; the HTP has no such floor.
Why one graph
QNN weight sharing between a prefill graph and a decode graph needs Hexagon v73 or newer. On v69 a
two-graph bundle holds every weight twice, and one process can map only about 1.85 GB on this
phone's cDSP. So the bundle has a single decode graph that also serves as prefill_1.
v69 workarounds baked into the build
Each of these was reproduced on the phone and the export/quantizer avoids it:
- A binary op that broadcasts both operands, and a matmul whose left operand is a slice at a non-zero offset, give wrong results on v69.
- All-zero weight rows get a per-channel scale of about 1e-11 and the HTP saturates the channel; they are given the median scale.
- The Qualcomm plugin's
CONV_2Dpath mishandles INT4 filters (axis not remapped, filter unpacked twice); 4-bit 1x1 convs are emitted asFULLY_CONNECTED. - A 1.6 GB QNN context cannot be created ("Failed to create QNN context: 1002"), so the graph is cut into ~170 MB contexts with a CPU-only no-op between stretches.
- Every QNN graph input/output has to be a buffer LiteRT binds; no NPU op may consume an XNNPACK output and no op may be left with an unconsumed output ("No memHandle provided").
Limitations
- Snapdragon 8 Gen 1 (SM8450, Hexagon v69) only. The context binaries are compiled for that DSP; other chips answer "Failed to create QNN context: 1002".
- Text only.
- It needs most of the phone's free memory. The contexts total about the DSP's per-process budget; close heavy apps first.
- Quantization costs quality compared with the float model. The checks listed above are small (6 prompts); there is no benchmark suite behind this.
- Tool calling was not tested.
- These bundles were built on a PC with a custom pipeline (not Google's published recipe, which has no SM8450 target) and are an unofficial community build, provided as is, with no warranty.
Licence and credits
The model weights derive from ibm-granite/granite-4.2-3b and are under the same licence (apache-2.0). Compiled with Google's LiteRT / LiteRT-LM tooling and Qualcomm AI Engine Direct. This is an unofficial community build, not affiliated with the authors of the base model, Google or Qualcomm.