Ling-mini-2.0 (16B MoE): iPad Air GGUF (Q2_K experts, experts last, lookup-table layout)

This file runs Ling-mini-2.0 on a 2013 iPad Air. Ling-mini-2.0 has 16.3 B parameters (~1.4 B active) and 256 experts per layer. The iPad has an Apple A7 (2 cores, no dotprod), 1 GB of RAM, and runs iOS 12.5.7 (jailbroken). Speeds:

  • 2.6 tok/s with unchanged routing.
  • 3.3 tok/s with a light cache bias, at +2.6 % perplexity.
  • 4.5 tok/s with a strong cache bias.

Memory stays under 580 MB the whole time. The file is 5.55 GB, more than three times what iOS 12 lets a process map. Only its first 466 MB is mapped. Each layer keeps 14 of its 256 experts in RAM and reads the others from flash when the router picks them.

From the ๐Ÿค smolmaxxing project. The full write-up is in EXPERIMENT.md ยง21.11. The TV-box build of the same model is hyperionaidev/Ling-mini-2.0-tvbox-GGUF. This is a different build, with different experts.

โš ๏ธ This file needs the patched llama.cpp from the smolmaxxing repo (the iOS 12 patch, see Run). It has a pruned output head (60,000 of 157,184 vocabulary rows plus an output_ids tensor). Its experts are repacked for the iPad's lookup-table kernel, so to any other llama.cpp they are scrambled Q2_K and the output is garbage. Stock llama.cpp, LM Studio and Ollama will not run it correctly.

The file

File lm2-q2-h60-lut.gguf, 5,549,932,192 bytes (5.55 GB)
SHA-256 3e464310eaddebc29e03daaf2617661ab3aa002ac84da9d8aa2ddb44a94e50bd
Experts Q2_K from mradermacher/Ling-mini-2.0-i1-GGUF (i1-Q2_K_S, imatrix, quantized from BF16), copied unchanged and then repacked. That file has layer 1's ffn_down_exps in Q4_K, which stays Q4_K and runs on the stock kernel.
Everything else Q4_K: the non-expert tensors of bartowski's Q4_K_M requantized with his imatrix (--pure), the same recipe as the TV build
Output head 60,000 rows (data/head-ids-ling-60k.txt), chosen by token frequency on an English + multilingual corpus. Prompts can use every token, but the model can only generate tokens in the head.
Layout experts last: the non-expert part is the first 466 MB, and each expert (gate, up, down) is 1.03 MB. Each expert's Q2_K blocks are regrouped as 16 rows ร— 256 columns for a vqtbl1q lookup-table kernel (key ipad.expert_layout = "q2lut").
Context 32,768 tokens in the metadata; run at 512 on the iPad

The file was never stored whole while it was built. tools/lm-ipad.sh fetches the two sources' tensors with HTTP range requests, assembles the file in order, and streams it to the device. Rerunning it should reproduce this file byte for byte, as long as the two source files are unchanged (md5 3e630f310261df0daa902a383c25608a).

Measured on the iPad Air (2013)

Speeds are on a story prompt, with pool 14, prefetch and frequency-based eviction. Perplexity is measured on the iPad itself with tinyppl (one token at a time like generation) over 2 chunks of 512 tokens of an English text: 506 scored tokens, so differences under ~10 % are noise.

Cache bias Experts per token iPad tok/s Perplexity vs unbiased
0 (full quality) 8 2.56 13.30 ยฑ0
0.1 (recommended) 8 3.33 13.65 +2.6 %
0.2 8 3.96 15.68 +18 % (noise; see 0.3)
0.3 8 4.43-4.56 14.44 +8.5 %
0 6 3.43 (on the eval text) 14.38 +8.1 %
0.3 6 5.21 15.55 +17 %
  • RAM: peak RSS 556-576 MB.
  • Prompt: 2.8-3.6 tok/s.
  • Output: the story is coherent.
  • Compared with Moon-Beam-8B-A1B: this model is bigger but not better. Moon-Beam scores 12.89 on the same two chunks, against 13.30 here (+3 %), and runs at 3.5 tok/s at full quality. The TV build found the same.

Best model per size class on the iPad Air, first run to now

This model is the 16B MoE row.

Speed against quality for the MoE models on the iPad Air

Run

On a jailbroken iOS 12 device:

  1. Cross-compile llama.cpp at 1945793 with ipad-air/patches/llama.cpp-ios12.patch applied, using ipad-air/build.sh from the repo. ipad-air/README.md has the steps: Xcode 15.4's iPhoneOS SDK, signing with ldid -Sent.xml, and SSH over USB.
  2. Copy the file over (it needs 5.6 GB free) and run:
GGML_MOE_PAGER=1 GGML_MOE_POOL=14 GGML_MOE_PREFETCH=1 GGML_MOE_LFU=0.95 GGML_MOE_BIAS=0.1 \
  ./smolchat -m lm2-q2-h60-lut.gguf -c 512 -b 64 --repeat-penalty 1.15 --repeat-last 256
# GGML_MOE_BIAS=0 for full quality (2.6 tok/s), 0.3 for 4.5 tok/s; add --experts 6 for 5.2

Settings:

  • No --no-think: Ling-mini-2.0 isn't a reasoning model, and its chat template already sets "detailed thinking off".
  • GGML_MOE_POOL: experts kept in RAM per layer. Don't go past 14 on a 1 GB device: a bigger pool kernel-panicked the iPad with Moon-Beam.
  • GGML_MOE_BIAS: how strongly routing prefers experts already in RAM.
  • GGML_MOE_STATS=1: prints hits, misses and flash time at exit.

To measure perplexity on the device: ./tinyppl -m lm2-q2-h60-lut.gguf -f eval-en.txt -c 512 --chunks 2 --experts 8, with the same environment.

License and credits

Downloads last month
204
GGUF
Model size
16B params
Architecture
bailingmoe2
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for hyperionaidev/Ling-mini-2.0-ipad-GGUF

Quantized
(21)
this model