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.

Snapdragon X2 Elite AI Inference with Hexagon NPU and Oryon CPU (248 tok/s Prefill, 30.5 tok/s Decode)

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

Stock CPU (Baseline)6.7 tok/s (1×)100% Hexagon NPU92.1 tok/s (13.7×)Hybrid (Same 16G)233.1 tok/s (34.8×)Hybrid (Q4_0 13.9G)247.7 tok/s (37.0×)Hybrid (Q2_K 11.6G)248.0 tok/s (37.0×)

Direct ARM64 NEON Decode on rpcmem · Higher is faster

Stock CPU (Baseline)5.0 tok/s (1×)100% Hexagon NPU13.5 tok/s (2.7×)Hybrid (Same 16G)22.7 tok/s (4.6×)Hybrid (Q4_0 13.9G)28.8 tok/s (5.8×)Hybrid (Q2_K 11.6G)30.5 tok/s (6.2×)

Single Unified rpcmem Buffer · Lower is smaller

Stock CPU (Baseline)22.90 GiB100% Hexagon NPU16.35 GiBHybrid (Same 16G)16.35 GiBHybrid (Q4_0 13.9G)13.90 GiBHybrid (Q2_K 11.6G)11.58 GiB

What stands out from these numbers:

  • Zero extra RAM: One rpcmem buffer (13.9 to 16.35 GiB), 0 ms handoff between NPU and CPU, and about 5.5 s cold load.
  • Full memory bus saturation: ARM64 NEON vdotq_s32 reads Hexagon’s 32×32 HTP tiles directly at 135 to 145 GB/s on a 136 GB/s LPDDR5X bus.
  • Upstreamed fixes: omacom/omarchy#21464 (NPU udev permissions), ggml-org/llama.cpp#33604 (NVFP4 HMX accuracy fix), and ggml-org/llama.cpp#33606 (fused HVX SiTU).

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

RTX PRO 6000125.2 tok/sNVIDIA B200110.8 tok/sApple M4 Max*80.0 tok/sNVIDIA A10067.0 tok/sNVIDIA L442.9 tok/sApple M4 Pro*38.0 tok/sAMD Strix Halo32.8 tok/sX2 Elite (Q2_K 12G)30.5 tok/sNVIDIA T423.9 tok/sX2 Elite (Same 16G)22.7 tok/sX2 Elite (Baseline)5.0 tok/s

tok/s per Watt · Higher is cooler

Apple M4 Max*1.07 /WX2 Elite (Q2_K 12G)0.87 /WApple M4 Pro*0.84 /WX2 Elite (Same 16G)0.65 /WNVIDIA L40.60 /WNVIDIA T40.34 /WAMD Strix Halo0.27 /WRTX PRO 60000.21 /WNVIDIA A1000.17 /WX2 Elite (Baseline)0.14 /WNVIDIA B2000.11 /W

tok/s per $1,000 · Higher is better value

Apple M4 Max*20.0 /$1kX2 Elite (Q2_K 12G)18.5 /$1kNVIDIA L417.2 /$1kNVIDIA T415.9 /$1kApple M4 Pro*15.8 /$1kRTX PRO 600014.7 /$1kX2 Elite (Same 16G)13.8 /$1kAMD Strix Halo11.7 /$1kNVIDIA A1006.7 /$1kX2 Elite (Baseline)3.0 /$1kNVIDIA B2002.8 /$1k

tok/s per 100 GB/s RAM · Software efficiency (#1 overall)

X2 Elite (Q2_K 12G)22.4X2 Elite (Same 16G)16.7Apple M4 Max*14.7NVIDIA L414.3Apple M4 Pro*13.9AMD Strix Halo12.8NVIDIA T47.5RTX PRO 60007.0NVIDIA A1004.3X2 Elite (Baseline)3.6NVIDIA B2001.4

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, hitting 247.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 reads 3.63 GB of active weights (2.71 GB in Q4_0, 2.34 GB in Q2_K). 12 Prime Oryon cores (cpu6 to cpu17 at 4.45 GHz) saturate the shared 136 GB/s bus (135 to 145 GB/s measured), beating 8 Hexagon HVX threads by 1.7× (22.7 vs 13.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

  1. OPBATCH=2048 corruption on looped layers: Standalone unit tests showed that real blk.12 NVFP4 weights and SiTU were accurate on their own. The !!!! garbage came from GGML_HEXAGON_OPBATCH=2048 overflowing on Inkling’s 3× looped middle layers. Lowering it to GGML_HEXAGON_OPBATCH=512 fixed it completely.
  2. FP16 HMX NVFP4 underflow (6.6% down to 0.38% RMS): Small per-expert scales (~4e-5 to 2e-4) pushed dequantized weights into FP16 subnormals. Boosting vtcm_scale by 256× and compensating with HMX’s hardware column scale 0x1c00 (1/256) cut RMS error 17× with zero extra DSP cycles (llama.cpp#33604).
  3. The 2,709 ms prefill cliff (K = 16 to 32): After enabling MM_SELECT=3 (W8A8 INT HMX) and FA_SELECT=3 (79.8 to 101.5 tok/s), GGML_HEXAGON_PROFILE=1 showed 59.5% of total prefill time (2,709 ms out of 4,860 ms) stuck on one tiny [16, 1025] attn_rel_bias matmul. Because K = 16 failed Hexagon HMX’s ne00 % 32 == 0 check, it fell back to hvx-flat. Zero-padding K from 16 to 32 (100% bit-exact) moved all 48 layers onto HMX and jumped prefill to 233.1 tok/s (247.7 tok/s at -b 1024).

Measured GGML_HEXAGON_PROFILE=1 on 491 tokens (before zero-pad)

attn_rel_bias (K=16)2,709 ms (59.5%)MoE MUL_MAT_ID (HMX)792 msGET_ROWS + CONT + SUB294 msFLASH_ATTN_EXT (HMX)186 msSiTU + Norms + Other739 ms

Measured GGML_HEXAGON_PROFILE=1 on 491 tokens (247.7 tok/s at -b 1024)

attn_rel_bias (K=32)~95 ms (HMX!)MoE MUL_MAT_ID (HMX)792 msGET_ROWS + CONT + SUB294 msFLASH_ATTN_EXT (HMX)186 msSiTU + Norms + Other739 ms

Things I Tried That Made It Slower


How to Run This on Linux (Snapdragon X2 Elite)

  1. 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
  2. Build libggml-cpu.so without 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 or rmmod fastrpc. It leaks kernel dma_buf pages until reboot.