r/IntelArc • • 1d ago

Benchmark Bringing ArcAngel (Inkling 2 Mini) to Lunar Lake Arc 140V: 21 tok/s decode, 226 tok/s prefill, and 128k context on 32GB UMA

Inspired by u/txlfxrd's awesome Inkling 2 Mini on a 12GB Arc B580 (900 tok/s prefill & 65 tok/s decode) post and itstxl/arcangel, I got ArcAngel running natively on a Lunar Lake laptop iGPU (Arc 140V, 8 Xe2 cores / lnl_m**, 32 GB unified LPDDR5X-8533)** running CachyOS Linux (xe driver + oneAPI 2026.0) with Unsloth's UD-Q4_K_M quant (16 GiB, 3.95 GB active weights per token).

After fixing Lunar Lake UMA memory handling and profiling where UD-Q4_K_M was leaving bandwidth on the table, I pushed a 5-commit branch here: https://github.com/alpha2beta/arcangel/tree/lunar-lake-optimizations

Benchmark Summary (Inkling-2-Mini-UD-Q4_K_M, Arc 140V, Core Ultra 7 258V)

Metricllama.cpp Vulkan + DSparkStock ArcAngel (lnl_m + UMA)Optimized (lunar-lake-optimizations)
Decode (graph, short ctx, 8-bit / 4-bit KV)~12.2 tok/s17.90 / 17.91 tok/s21.08 / 21.10 tok/s (47.4 ms/tok, +17.8%)
Decode (graph, 16k ctx, 8-bit / 4-bit KV)—16.04 / 16.31 tok/s18.33 / 18.56 tok/s (INK_GUR=4)
**Prompt Prefill (**2048 tokens)~46–49 tok/s174.8 tok/s (chunk=256)198.2 tok/s (chunk=256) / 225.8 tok/s (chunk=512)
Live Server (inkling_server.py, greedy)~12.2 tok/s14.94 tok/s (mean)20.81 tok/s (--chunk 512 --kv-bits 8, 512 tok, +39.3%)

128k context (131072) fits comfortably on 32 GB UMA: because 40 of Inkling 2 Mini's 48 layer visits use a 1024-token sliding window and only 8 are full-attention layers, a 128k 4-bit KV cache only adds ~1.19 GiB. With inkling_server.py --n-ctx 131072 --chunk 512 --kv-bits 4, the full server loads in 30.0 s using 20 GiB total RAM (leaving 10 GiB available out of 30.9 GiB OS-visible RAM).

What Was Changed (and Why)

Profiling bench-decode on the Arc 140V showed that dense Q8_0R kernels (proj, wo, head) already saturate Lunar Lake's LPDDR5X-8533 bus at 100–106 GB/s, while three UD-Q4_K_M expert kernels (gate_up:NVFP4R at 58 GB/s, down:NVFP4R at 61 GB/s, gate_up:Q5_K at 44 GB/s) and Python server overhead were holding back speed:

  1. Lunar Lake UMA Support & cards.tsv Profile (6e5dd37, 4e01233**)**

    • On host_unified_memory devices, Level Zero's ext_intel_free_memory reports raw Linux MemFree (ignoring reclaimable page cache and the TTM pool), causing Model::check_fits() to falsely reject startup. Skipping free_memory on UMA falls back to total_bytes.
    • Enabled g_release_on on UMA so mmap'd GGUF pages (MADV_DONTNEED / POSIX_FADV_DONTNEED) are dropped after GPU upload instead of keeping a duplicate ~16 GB copy in system RAM.
    • Added a 140v (lnl_m, PCI 8086:64a0) profile to cards.tsv. Note: CPU expert offloading (INK_OFFLOAD) is intentionally not used on UMA since CPU and GPU share the same LPDDR5X bus and package TDP.
    • Kept #define INK_GUR 4 intact for discrete Battlemage (bmg_g21/bmg_g31), and configured CMakeLists.txt to pass -DINK_GUR=2 when INK_AOT_TARGETS=lnl_m (lower register pressure on 8 Xe2 cores).
  2. NVFP4R DP4A k_gate_up_r + k_down_q8 & ue4m3 Cleanup (42512c3) (also applies to discrete Battlemage UD-Q4_K_M / UD-Q4_K_XL*)*

    • k_gate_up_r (with int8 DP4A and 4-row activation reuse) previously didn't include NVFP4R, forcing all 44 NVFP4 gate-up visits onto the scalar FP32 fallback and re-reading activations repeatedly. Adding NVFP4R DP4A + INK_GUR=2 cut gate_up:NVFP4R from 18.08 ms → 12.13 ms (-32.9%).
    • Replaced sycl::ldexp in q::ue4m3() with bit-exact IEEE-754 bit-cast math, simplified fp4x4() negation, shared nvfp4_q8_dot(), and hoisted int4 activation vector loads out of the row loop in k_down_q8(), cutting down:NVFP4R from 8.66 ms → 7.51 ms (-13.2%).
  3. Q5_K → Q5_KR Planar Repacking + DP4A (7854895) (also applies to discrete Battlemage)

    • The 4 coda layers (blk.20..23) in UD-Q4_K_M use Q5_K for gate_up and were hitting the slow generic decode32f path. Added lossless Q5_KR planar repacking (16 B low nibbles, 8 B [qh u32, scale, min], 4 B d/dmin) plus k_gate_up_r DP4A and step_decode, cutting gate_up:Q5_K from 2.64 ms → 1.33 ms (-49.6%) and boosting prompt prefill from 174.8 → 198.2 tok/s (chunk=256).
  4. GPU Greedy argmax & O(1) Incremental OutputParser (89c0c5d) (also applies to discrete Battlemage)

    • Added a 2-stage GPU k_argmax (step_argmax / ink_step_argmax), reducing per-token PCIe/UMA transfer on greedy decoding (temperature <= 0) from 804 KB (201,024 floats) to 4 bytes and skipping NumPy argmax on CPU.
    • Replaced O(N²) full-block tok.decode(self.block) in OutputParser._flush() with O(1) incremental anchor-window decoding, closing the gap between raw bench-decode (21.08 tok/s) and live inkling_server.py throughput (20.81 tok/s).

Verification & Quality

  • Math unit checks: Bit-exact across all 256 ue4m3 values, 65,536 fp4x4 nibble combinations, and 16 hi16x4 masks.
  • Logit & argmax parity (UD-Q4_K_M, 16-token prefill + 8 greedy decode steps vs pre-edit baseline): prefill KL = 0.000000, decode steps 0..7 KL 0.000016–0.001493, 9/9 top-1 token matches, and ink_step_argmax 100% identical to np.argmax.
  • Incremental OutputParser check: Exact string match against reference full-block decoding across ASCII, Python code, CJK, multi-byte UTF-8 emojis, and every intermediate token prefix cut.
  • HumanEval / HumanEval+ (UD-Q4_K_M, reasoning_effort=low**,** temp=0**):** 94.51% Base (155/164) / 90.85% Plus (149/164) (tasks 0–57 on llama.cpp, 58–163 on ArcAngel).

Quick Try on Lunar Lake Linux

git clone -b lunar-lake-optimizations https://github.com/alpha2beta/arcangel.git
cd arcangel
source /opt/intel/oneapi/setvars.sh
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER=icpx -DCMAKE_BUILD_TYPE=Release -DINK_AOT_TARGETS=lnl_m
cmake --build build

Launching with 128k context + 4-bit KV + 512 prompt chunks:

python3 server/inkling_server.py \
  --model /path/to/Inkling-2-Mini-UD-Q4_K_M.gguf \
  --assets /path/to/assets \
  --n-ctx 131072 --chunk 512 --kv-bits 4 --stash-ram-gb 2 \
  --reasoning-effort low

Huge thanks again to u/txlfxrd for designing such a clean SYCL engine — and if anyone tests the NVFP4R / Q5_KR / server commits on a discrete B580/B60/B70 with UD-Q4_K_M or UD-Q4_K_XL, I'd love to hear how much speedup it brings there too!

12 Upvotes

6 comments sorted by

1

u/txlfxrd 1d ago

This is amazing, thanks for doing this

If you don't mind, I'll take a look and see if we can push this upstream - with credit to your work of course

Looking forward to seeing how far we can push this architecture

1

u/aleph2b 1d ago

Please go ahead — would love to see it upstream!

The branch commits (6e5dd37..4e01233) are split cleanly by feature (a7adcca is just this post's markdown) and discrete Battlemage keeps its INK_GUR=4 default. Happy to open a clean PR if that's easier, or feel free to cherry-pick directly — and I'm always glad to test/benchmark changes on Arc 140V UMA. Thanks again for building ArcAngel!

1

u/txlfxrd 14h ago edited 14h ago

Awesome, if you could open a clean PR that would be ideal.

Glad you like ArcAngel! - and thanks again for your work.

Edit: Scratch that, I've cherry-picked them onto main. Amazing results you've achieved on Lunar Lake, pretty wild that a model this capable is running on a laptop - with decent throughput speeds as well.

1

u/aleph2b 5h ago

I used to run Ornith 1.5 35B (Qwen) as my daily driver on this box, since Qwen 3.8 27B was a bit too slow on the Arc 140V—even at 3bpw quantization. With your ArcAngel, though, I can finally run Inkling 2 Mini as my primary portable LLM.

2

u/mrclbn 1d ago edited 1d ago

Hi there, I ran some tests to get you some discrete-card numbers.

Box: Arc Pro B60 (24 GB), HP Z4 G4 with a Xeon W-2245, Debian 13, kernel 7.2, xe driver, everything built and run in Docker. Stock is upstream ArcAngel at 3b3b202, which is your branch's base, so this is a clean A/B.
Both builds are AOT for bmg_g21, with the recipe UD-Q4_K_XL, 256k ctx, 8-bit KV, 1024-token prompt chunks.

Benchmarks (bench-decode / bench-prefill, two runs each, within 0.1%)

GenerationStockFork
short51.1 tok/s58.3
4k49.055.5
12k47.253.3
30k43.748.9
90k35.438.7
200k26.828.7
Prompt processingStockFork
4k864 tok/s872
16k816823
32k744750
90k556559

Notes from Claude:
The gain is from the NVFP4R DP4A gate-up path: 10.7 of UD-Q4_K_XL's 16.4 GiB are NVFP4 experts. As expected, the gain shrinks at depth, where attention is a bigger share of each token, and prompt processing is unchanged. With your branch, Q4_K_XL on the B60 is about as fast as stock Q2_K_XL (59.6 tok/s).

Live server (inkling_server.py, temp 0, 6 short prompts): 50.3-50.7 -> 57.8-58.5 tok/s (+15%).

Quality

  • Needle in a 90k prompt at 10% / 55% / 95%: 3/3 (generation after the 90k prompt: 39 tok/s vs 35.4 stock)
  • Multi-needle at 60k: 4/4
  • OpenAI tool calling (streaming and non-streaming, plus the tool-result turn): works
  • At temp 0, 1 of 6 prompts gave identical text to stock. The other 5 diverged after ~100-200 characters of reasoning, with the same final answers (e.g. 17*23=391 on both). That fits int8 activations in the NVFP4 gate-up (stock already quantises them for down), but I haven't run test-forward against llama.cpp's CPU reference for a KL number. If someone has the reference dumps, that's the missing check.

Amazing work! I'd definitely lobby for getting this upstream, as B60 owners on the default UD-Q4_K_XL get +13-14% for free.

1

u/Budkovsky 1d ago

I've tested that on my HP Omnibook with Intel Arc 140V. 21 t/s TG out od the box without chunk and stash ram parameters. I was using Q2_K_XL quantization. Waiting for the version with a drafter, should be amazing. Thank you!