{"id":52150203,"url":"https://github.com/alpharomercoma/snapdragon-vs-mediatek","last_synced_at":"2026-08-06T20:01:18.779Z","repository":{"id":373401824,"uuid":"1313896635","full_name":"alpharomercoma/snapdragon-vs-mediatek","owner":"alpharomercoma","description":"Reproducible on-device AI benchmark: MediaTek Dimensity 9500s vs Qualcomm Snapdragon 8 Elite — NPU/GPU/CPU inference and training","archived":false,"fork":false,"pushed_at":"2026-07-27T14:29:08.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-27T16:09:51.425Z","etag":null,"topics":["adreno","benchmark","hexagon","llama-cpp","llm","mediatek","npu","on-device-ai","qnn","snapdragon"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alpharomercoma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-27T13:48:28.000Z","updated_at":"2026-07-27T14:33:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alpharomercoma/snapdragon-vs-mediatek","commit_stats":null,"previous_names":["alpharomercoma/snapdragon-vs-mediatek"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/alpharomercoma/snapdragon-vs-mediatek","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpharomercoma%2Fsnapdragon-vs-mediatek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpharomercoma%2Fsnapdragon-vs-mediatek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpharomercoma%2Fsnapdragon-vs-mediatek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpharomercoma%2Fsnapdragon-vs-mediatek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alpharomercoma","download_url":"https://codeload.github.com/alpharomercoma/snapdragon-vs-mediatek/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alpharomercoma%2Fsnapdragon-vs-mediatek/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36347215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"ssl_error","status_checked_at":"2026-08-06T04:43:02.660Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adreno","benchmark","hexagon","llama-cpp","llm","mediatek","npu","on-device-ai","qnn","snapdragon"],"created_at":"2026-08-06T20:01:17.232Z","updated_at":"2026-08-06T20:01:18.772Z","avatar_url":"https://github.com/alpharomercoma.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mobile SoC AI Benchmark — Dimensity 9500s vs Snapdragon 8 Elite\n\nA reproducible, chip-to-chip comparison of what **unprivileged user code** can\nactually do for AI on two flagship mobile SoCs: MediaTek's **Dimensity 9500s**\n(`mt6991`, POCO X8 Pro Max) and Qualcomm's **Snapdragon 8 Elite** (SM8750, QRD\nreference device on the Qualcomm Device Cloud). Same workloads on both sides:\nNPU reachability + int8/fp16 throughput, LLM inference on CPU and GPU\n(llama.cpp, Gemma-3 1B Q4_K_M), raw GPU matmul, and on-device training\n(ggml, MLP + AdamW). Every number was measured on real silicon; every raw\noutput is committed under each chip's `results/`.\n\n## The comparison\n\n| Test | Snapdragon 8 Elite | Dimensity 9500s |\n|------|--------------------|-----------------|\n| **NPU** | Hexagon HTP V79 | MDLA (NPU 890) |\n| NPU runtime access | QNN 2.48 from Maven Central + public FastRPC — no SDK gate | NeuroPilot 8.2.26 preinstalled as public system libs |\n| int8 8-layer FC (32×2048×2048) | **4307 GOPS, 0.50 ms** | 1100–1470 GOPS, 1.46 ms |\n| NPU fp16 inference | ✅ 1089 GFLOP/s | ✅ runs (unquantified) |\n| NPU vs its own CPU (same graph) | 4.4× | n/a (CPU int8 ref not measured) |\n| NPU training | ❌ architecturally impossible | ❌ architecturally impossible |\n| **CPU** | 2× Oryon @4.09 + 6× @2.78 GHz | 1× X925 @3.73 + 3× X4 + 4× A720 |\n| Gemma-3 1B Q4 prefill / decode (8T) | **171–173 / 62–64 tok/s** | 58–74 / 22–31 tok/s |\n| **GPU** | Adreno 830 | Immortalis-G925 MC11 |\n| Working GPU compute API | **OpenCL** (public lib; Vulkan broken for quantized inference) | **Vulkan** (OpenCL namespace-blocked) |\n| Gemma-3 1B Q4 prefill / decode (GPU) | **717–723 / 41.5–42.5 tok/s** (OpenCL) | ~39 / ~27 tok/s (Vulkan) |\n| matmul 4096³ f32 | **479 GFLOP/s = 6.9× CPU** | 67 GFLOP/s = 1.69× CPU (coopmat+f32 acc only) |\n| transformer-layer training step (GPU vs CPU) | **403 vs 62.5 GFLOP/s = 6.5×** (OpenCL) | ~50 vs 37 GFLOP/s = 1.1–1.4× |\n| GPU training (ggml MLP+AdamW) | ✅ Vulkan, no flags, converges **identically to CPU** | ✅ Vulkan with `GGML_VK_DISABLE_COOPMAT=1`, converges worse |\n| GPU training via the \"fast\" API | ❌ OpenCL lacks `SUM`/`OPT_STEP_ADAMW` kernels ([patch started](snapdragon-8-elite/patches/)) | ❌ OpenCL blocked entirely |\n| Best local-LLM recipe | GPU-OpenCL prefill + CPU decode | CPU prefill + GPU-Vulkan decode |\n\nBoth chips tell the same top-level story — **the NPUs are real, reachable, and\ninference-only; the gaps are software** — but they invert on every axis of\nopenness: on MediaTek the GPU compute door is Vulkan and OpenCL is walled off;\non Qualcomm OpenCL is public and tuned while Vulkan quantized inference is\nbroken. The Snapdragon platform is the more open of the two (public OpenCL,\npublic FastRPC, redistributable QNN), and its silicon leads every measured\nworkload: ~3× on NPU int8, ~2.5× on CPU LLM throughput, ~7× on GPU matmul.\n\nFull evidence and per-chip narratives:\n\n- **[dimensity-9500s/](dimensity-9500s/)** — [README](dimensity-9500s/README.md) · [REPORT](dimensity-9500s/REPORT.md)\n- **[snapdragon-8-elite/](snapdragon-8-elite/)** — [README](snapdragon-8-elite/README.md) · [REPORT](snapdragon-8-elite/REPORT.md)\n\n## Repository layout\n\n```\n.\n├── README.md                # you are here — the comparison\n├── LICENSE                  # MIT\n├── dimensity-9500s/         # MediaTek side (POCO X8 Pro Max, Termux, no root)\n│   ├── README.md, REPORT.md\n│   ├── docs/ scripts/       # provisioning + on-phone toolchain setup\n│   ├── npu/                 # NeuroPilot probes + MDLA benches\n│   ├── inference/           # llama.cpp build+bench, LiteRT-LM status\n│   ├── gpu-matmul/          # Vulkan matmul + backward-pass investigation\n│   ├── training/            # CPU (PyTorch) + GPU (ggml Vulkan) training\n│   └── results/             # raw captured outputs (12 files)\n├── snapdragon-8-elite/      # Qualcomm side (QDC QRD, adb, cross-compiled)\n│   ├── README.md, REPORT.md\n│   ├── docs/ scripts/       # QDC provisioning + one-shot build/run scripts\n│   ├── npu/                 # QNN/HTP probes + ONNX-Runtime NPU bench\n│   ├── training/            # ggml training + matmul + trainstep benches\n│   ├── patches/             # ggml OpenCL memset_tensor kernel\n│   └── results/             # raw captured outputs (14 files)\n└── third_party/             # dependency checkouts (gitignored; scripts populate)\n```\n\n## Reproducing\n\nEach side is reproducible with its own harness, matching how each device is\nreachable:\n\n- **Dimensity 9500s** (on-phone, Termux): provision per\n  [dimensity-9500s/docs/PROVISIONING.md](dimensity-9500s/docs/PROVISIONING.md),\n  run `scripts/setup_phone.sh`, then the per-experiment commands in each\n  directory README (`npu/`, `inference/llama-cpp/`, `gpu-matmul/`, `training/`).\n- **Snapdragon 8 Elite** (cross-compiled, adb): provision per\n  [snapdragon-8-elite/docs/PROVISIONING.md](snapdragon-8-elite/docs/PROVISIONING.md),\n  then two commands:\n  ```bash\n  export ANDROID_NDK=/path/to/android-ndk-r27d\n  snapdragon-8-elite/scripts/build_host.sh    # deps + all cross-builds\n  snapdragon-8-elite/scripts/run_device.sh    # push + run the full suite\n  ```\n\n## Bonus experiment: performance mode vs. thermals\n\nThe Dimensity phone was re-benchmarked with HyperOS **Ultimate mode + charging**\n([dimensity-9500s/results-ultimate/](dimensity-9500s/results-ultimate/SUMMARY.md)):\nCPU gains modestly (prefill 74 → 79 t/s, retrain steps ~25% faster when cool),\nbut GPU throughput *regresses* under a 17-minute back-to-back suite (matmul\n67 → 45 GFLOP/s) — passive cooling throttles regardless of the mode toggle,\nand charging adds heat. The Snapdragon QRD reproduced its numbers within\n~4–7% across a comparable suite. For sustained on-device AI, thermal headroom\nmatters more than peak-clock modes.\n\n## Methodology \u0026 caveats (read before quoting numbers)\n\n- **Shared workloads:** NPU = 8 chained int8 FC layers, M=32 K=N=2048 (+ a\n  single fp16 FC); LLM = llama.cpp `llama-bench -p 128 -n 64` on Gemma-3 1B\n  Q4_K_M; matmul = ggml f32 `mul_mat` at 1024/2048/4096³; training = the same\n  385-param MLP, AdamW, MSE, 60 epochs. Benchmarks are run twice and reported\n  as ranges.\n- **Different access paths by necessity:** retail phone via Termux (MediaTek)\n  vs QRD via adb/NDK (Qualcomm). Both execute as unprivileged user code; the\n  QDC shell happens to be root but nothing measured here uses root-only\n  facilities (the loaded libraries are on each device's public-libraries list).\n- **Different NPU drivers by necessity:** MediaTek's Neuron Adapter is called\n  raw (NNAPI-like C API); Qualcomm's QNN is driven through ONNX Runtime's QNN\n  EP (with CPU fallback disabled) because raw QNN graph composition needs the\n  gated SDK headers. Both measure the same thing: a quantized graph fully\n  resident on the NPU.\n- **Different llama.cpp builds:** MediaTek numbers were taken 2026-07-13 on\n  the then-current llama.cpp; Snapdragon numbers on commit `8e8681e`\n  (2026-07-27, pinned in `build_host.sh`). Tokens/s at this model size are\n  dominated by hardware, but treat small cross-chip deltas accordingly.\n- **Thermals:** the phone was benched warm-and-cold (ranges reported); the\n  QDC QRD idles cool and varied \u003c4% across runs.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falpharomercoma%2Fsnapdragon-vs-mediatek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falpharomercoma%2Fsnapdragon-vs-mediatek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falpharomercoma%2Fsnapdragon-vs-mediatek/lists"}