In this guide, I explain my optimization for running Inkling 2 Mini (26.4B looped MoE, 48 logical layers, 128 experts, top-8 active) on my Omarchy ASUS Zenbook A16 (SC8480XP, 18-core Oryon CPU, Hexagon v81 NPU, 48 GB LPDDR5X at 136 GB/s) using llama.cpp, getting the benefit from both the NPU and the Oryon CPU on Linux.

Out of the box, stock llama.cpp ran Inkling 2 Mini at 6.7 tok/s prefill and 4.95 tok/s decode on this 35W laptop.
After moving to a zero-copy hybrid setup (Hexagon v81 NPU for prefill, and 12 Prime Oryon CPU cores reading the exact same rpcmem buffer for decode), prefill jumped to 247.7 tok/s (37×) and decode reached 22.7 to 30.5 tok/s (4.6× to 6.2×).
Benchmark Summary (Snapdragon X2 Elite, 35W, Linux)
Hexagon v81 HMX Prefill · Higher is faster
Direct ARM64 NEON Decode on rpcmem · Higher is faster
Single Unified rpcmem Buffer · Lower is smaller
What stands out from these numbers:
- Zero extra RAM: One
rpcmembuffer (13.9 to 16.35 GiB),0 mshandoff between NPU and CPU, and about5.5 scold load. - Full memory bus saturation: ARM64 NEON
vdotq_s32reads Hexagon’s32×32HTP tiles directly at135 to 145 GB/son a136 GB/sLPDDR5X bus. - Upstreamed fixes: omacom/omarchy#21464 (NPU udev permissions), ggml-org/llama.cpp#33604 (
NVFP4HMX accuracy fix), and ggml-org/llama.cpp#33606 (fused HVXSiTU).
Comparison Across GPUs, Apple Silicon, and Snapdragon X2 Elite
The GPU numbers below come from Unsloth’s published Inkling 2 Mini benchmarks, and the Apple Silicon MLX numbers (*) are bandwidth-scaled estimates. To keep things fair, I separated X2 Elite (Same 16G) (22.7 tok/s) from the smaller X2 Elite (Q2_K 12G) (30.5 tok/s) quant.
Higher is faster · *MLX estimated
tok/s per Watt · Higher is cooler
tok/s per $1,000 · Higher is better value
tok/s per 100 GB/s RAM · Software efficiency (#1 overall)
Why Split Prefill (NPU) and Decode (CPU)?
On a unified-memory laptop SoC, prefill and decode hit opposite bottlenecks:
- Prefill (
n_tokens > 1) is compute-bound: Hexagon v81’s HMX systolic array reuses each loaded weight tile across hundreds of tokens, hitting247.7 tok/s. That is 3.9× faster than 12 Prime Oryon CPU cores (63.7 tok/s). - Decode (
n_tokens == 1) is memory-bandwidth-bound: Each token reads3.63 GBof active weights (2.71 GBinQ4_0,2.34 GBinQ2_K). 12 Prime Oryon cores (cpu6tocpu17at4.45 GHz) saturate the shared136 GB/sbus (135 to 145 GB/smeasured), beating 8 Hexagon HVX threads by 1.7× (22.7vs13.5 tok/s).
Instead of loading the model twice, my **Unified 2b path keeps one copy of the weights in Hexagon’s rpcmem using 32×32 HTP-tiled layout. During n_tokens == 1, llama-context.cpp routes the graph to backend_cpu with a dedicated ~30 MiB allocator, and custom ARM64 NEON vdotq_s32 kernels (htp-tiled-cpu.h) read Q8_0, NVFP4, Q4_0, Q2_K, and F16 tiles directly in place.
The 3 Profiling Fixes That Unlocked the Speedup
OPBATCH=2048corruption on looped layers: Standalone unit tests showed that realblk.12NVFP4weights andSiTUwere accurate on their own. The!!!!garbage came fromGGML_HEXAGON_OPBATCH=2048overflowing on Inkling’s 3× looped middle layers. Lowering it toGGML_HEXAGON_OPBATCH=512fixed it completely.- FP16 HMX
NVFP4underflow (6.6%down to0.38%RMS): Small per-expert scales (~4e-5to2e-4) pushed dequantized weights into FP16 subnormals. Boostingvtcm_scaleby256×and compensating with HMX’s hardware column scale0x1c00(1/256) cut RMS error 17× with zero extra DSP cycles (llama.cpp#33604). - The
2,709 msprefill cliff (K = 16to32): After enablingMM_SELECT=3(W8A8 INT HMX) andFA_SELECT=3(79.8to101.5 tok/s),GGML_HEXAGON_PROFILE=1showed59.5%of total prefill time (2,709 msout of4,860 ms) stuck on one tiny[16, 1025]attn_rel_biasmatmul. BecauseK = 16failed Hexagon HMX’sne00 % 32 == 0check, it fell back tohvx-flat. Zero-paddingKfrom16to32(100% bit-exact) moved all 48 layers onto HMX and jumped prefill to233.1 tok/s(247.7 tok/sat-b 1024).
Measured GGML_HEXAGON_PROFILE=1 on 491 tokens (before zero-pad)
Measured GGML_HEXAGON_PROFILE=1 on 491 tokens (247.7 tok/s at -b 1024)
Things I Tried That Made It Slower
5 ideas I benchmarked and reverted
- Using all 18 cores (
-t 18): Decode dropped from22.3down to7.30 tok/sbecause of 3-cluster barrier thrash and slower3.61 GHzPerf cores. Pinningtaskset -c 6-17 -t 12(12 Prime cores,GGML_OPENMP=OFF) is much faster.- Caching weights in Oryon FlexCache (
PRFM PLDL1KEEP):NVFP4bandwidth dropped from145.2to136.1 GB/s.2.7 GBof weights is 85× larger than the 32 MB L2 FlexCache, so caching weights just evicts activations and KV cache. Streaming (PLDL1STRM) won.- ARM64
ldxr + wfebarriers: Wakeup latency (~1.5 µs) across 4,500 barriers per token doubled barrier overhead (6.1to13.0 ms, dropping decode from28.8to24.6 tok/s). Hot-spinyieldwon.- Running CPU and NPU concurrently on the same layer (Fiddler style):
0.242 ms(CPU) and0.314 ms(NPU) slowed down to0.492 to 0.573 mstogether because 12 Prime cores already saturate the shared bus.- Speculative decoding on a 128-expert sparse MoE: Verifying
mtokens activates3.6× to 10×more experts (13.46down to7.7 to 12.9 tok/s). It does work well on dense models: onLlama-3.2-1B-Q4_0, Hexagon HMX verified 49 tree nodes in24.36 ms(2,011 tok/s), only+1.13 msmore than 32 nodes.
How to Run This on Linux (Snapdragon X2 Elite)
- Allow non-root Hexagon NPU access (omacom/omarchy#21464):
sudo tee /etc/udev/rules.d/70-qualcomm-hexagon-npu.rules <<'EOF' KERNEL=="fastrpc-cdsp", TAG+="uaccess" SUBSYSTEM=="dma_heap", KERNEL=="system", TAG+="uaccess" EOF sudo udevadm control --reload-rules && sudo udevadm trigger - Build
libggml-cpu.sowithout OpenMP (-DGGML_OPENMP=OFF -DGGML_NATIVE=ON) and launch pinned to the 12 Prime cores:LLAMA_UNIFIED_CPU_DECODE=1 LLAMA_FA_FOLD_BIAS=1 \ GGML_HEXAGON_DEVICES=4 GGML_HEXAGON_OPBATCH=512 \ GGML_HEXAGON_MM_SELECT=3 GGML_HEXAGON_FA_SELECT=3 \ taskset -c 6-17 llama-completion -m Inkling-2-Mini-NVFP4-Q8_0.gguf \ --device HTP0,HTP1,HTP2,HTP3 -ngl 99 -ts 6,6,6,7 \ -fa on -ctk f16 -ctv f16 --no-host -b 1024 -ub 1024 -t 12
Warning
Never
kill -9(SIGKILL) a running Hexagon FastRPC process orrmmod fastrpc. It leaks kerneldma_bufpages until reboot.