#4922·MNN

CPU decode collapsed on Snapdragon 8 Elite Gen 5 (2x S26 Ultra, 1.6 tok/s) while prefill/OpenCL are healthy; same build does 8.9 tok/s on S25 Ultra

Author: Mr-J-369Created Oct 1, 2026Updated Oct 1, 2026

CPU decode collapsed on Snapdragon 8 Elite Gen 5 (2x S26 Ultra, 1.6 tok/s) while prefill/OpenCL are healthy; same build does 8.9 tok/s on S25 Ultra

Summary

MNN CPU decode runs ~6x slow on the Snapdragon 8 Elite Gen 5 while prefill on the same runs is healthy - and faster than our healthy reference phone. Same model, same build, same settings on a Snapdragon 8 Elite (S25 Ultra) decodes at 8.9 tok/s. Reproduced on 2 separate S26 Ultra units, across three model architectures and both single-file and external-weight packages. MNN OpenCL on the same affected phone does 13.8 tok/s with healthy prefill, so this is not silicon, throttling, or power policy - it is the MNN CPU decode path on the new cores.

Environment

  • MNN master 024a946b (2026-09-30), FetchContent build for arm64-v8a: MNN_KLEIDIAI=ON, MNN_KLEIDIAI_DEFAULT_ON=ON, MNN_ARM82=ON, MNN_OPENCL=ON, MNN_LOW_MEMORY=ON, MNN_BUILD_LLM=ON, Vulkan/Hexagon/QNN off
  • Local patches on top (full diff available on request): PLE-embedding refresh across chunked prefill (llm.cpp), Min-P threshold relative to max prob (sampler.cpp), Interpreter external-path routing + temp-mmap unlink on Android, Vulkan/Pipeline/Tensor error-status propagation, OpenCL conv_2d_int_buf symmetric-INT8 dequant fix. None touch CPU GEMM/attention decode kernels.
  • Affected: 2x Samsung S26 Ultra (8 Elite Gen 5). Reference: Samsung S25 Ultra (8 Elite). Additional weak data point below: Snapdragon 8 Gen 1 phone.
  • Models (all ours, downloadable): https://huggingface.co/Mr-J-369/MNN-LLMs/tree/main - Hermes-3-Llama-3.1-8B-MNN-int4, Mistral-7B-Instruct-v0.3-abliterated-MNN-int4, plus a Qwen-based single-file package with baked embeddings. Exported with MNN master llmexport.py: --quant_bit 4 --hqq --embed_bit 4, sanity-checked post-export via MNN.llm create/load/response.

How our app drives the engine (to help narrow it)

Direct C++ Llm API per turn: createLLM(config.json) -> set_config(options) -> load() once; per request apply_chat_template(messages) -> response(messages, stream, "", maxTokens); syncPromptCache after each turn. Exact options passed for the runs below:

json
{"backend_type":"cpu","thread_num":6,"precision":"low","reuse_kv":true,
 "prompt_cache":true,"async":false,"chunk":128,"attention_mode":8,
 "max_all_tokens":4096,"use_mmap":false,"kvcache_mmap":false,
 "use_cached_mmap":false,"sampler_type":"mixed",
 "mixed_samplers":["penalty","topK","tfs","typical","topP","min_p","temperature"],
 "temperature":0.7,"top_k":40,"top_p":0.9,"min_p":0.05,
 "repetition_penalty":1.1,"presence_penalty":0.0,"frequency_penalty":0.0,
 "penalty_window":0,"speculative_type":"","timeout_ms":-1,"ngram_factor":1.0}

Results (pp512 x tg128, Hermes 8B unless noted)

Run Decode Prefill TTFT Cold ready
S26U CPU, Hermes 8B (unit 1) 1.6 44-48 ~20 s ~19-22 s
S26U CPU, Hermes 8B (unit 2) 1.6 - - -
S25U CPU, Hermes 8B 8.9 31 14.9 s 26 s
S26U OpenCL, Hermes 8B 13.8 ~140 3.4 s ~5 s
S26U CPU, Mistral 7B abl. 1.5-1.6 30-45 ~20-30 s ~24-27 s
S26U CPU, Qwen single-file (baked embeddings) slow (same class) - - -

Thermals Nominal on all S26U runs; no power-saver involvement (2 units).

Ruled out

  • Power/thermal policy (clean thermals, 2 units, OpenCL fast on the same phone)
  • Memory mapping (A/B on/off: 1.6 vs 1.5 decode - no effect)
  • Thread count (4/6/8 across runs)
  • Model architecture (Llama, Mistral sliding-window, Qwen - all affected on S26U)
  • Packaging (external-weight multi-file and baked single-file both affected, not the external-weight/mmap path)
  • Chat template (packages carry correct Mistral [INST] / Llama templates; rendered prompts verified byte-level)

Additional data point (different signature, for completeness, not the core complaint)

Snapdragon 8 Gen 1 phone, Hermes 8B, CPU, 8 threads, mmap on: decode 0.2 tok/s, prefill 9.5 tok/s, TTFT 49 s, cold 70 s, thermals Normal. Both phases slow there (old weak SoC running 8 threads across 4 little A510 cores may be scheduling, not the same bug) - including it so it's on record, but the fileable defect is the S26U decode-only collapse.

Read

Prefill (batched GEMM) is faster on the broken phone than on the healthy one, so build flags, threading, clocks, and dispatch for the GEMM path are all fine. Only per-step decode collapses - which points at the decode-only code: int4 GEMV decode kernels (KleidiAI/SME2 paths touched recently), CPUAttention decode, or per-step KV handling on the Gen 5 cores. Works on 8 Elite, fails on 8 Elite Gen 5, smells like new-core dispatch/selection rather than a general regression.

Ask

  1. Is there a runtime knob to force-disable KleidiAI (or select the decode GEMM path) so we can bisect on-device and confirm/deny the suspect?
  2. Any CPU-feature dump you'd like from the affected SoC (we can ship whatever CpuInfo/hwcap readout helps)?