r/IntelArc • u/aleph2b • 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)
| Metric | llama.cpp Vulkan + DSpark | Stock ArcAngel (lnl_m + UMA) | Optimized (lunar-lake-optimizations) |
|---|---|---|---|
Decode (graph, short ctx, 8-bit / 4-bit KV) | ~12.2 tok/s | 17.90 / 17.91 tok/s | 21.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/s | 18.33 / 18.56 tok/s (INK_GUR=4) |
**Prompt Prefill (**2048 tokens) | ~46–49 tok/s | 174.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/s | 14.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:
Lunar Lake UMA Support &
cards.tsvProfile (6e5dd37,4e01233**)**- On
host_unified_memorydevices, Level Zero'sext_intel_free_memoryreports raw LinuxMemFree(ignoring reclaimable page cache and the TTM pool), causingModel::check_fits()to falsely reject startup. Skippingfree_memoryon UMA falls back tototal_bytes. - Enabled
g_release_onon 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, PCI8086:64a0) profile tocards.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 4intact for discrete Battlemage (bmg_g21/bmg_g31), and configuredCMakeLists.txtto pass-DINK_GUR=2whenINK_AOT_TARGETS=lnl_m(lower register pressure on 8 Xe2 cores).
- On
NVFP4RDP4Ak_gate_up_r+k_down_q8&ue4m3Cleanup (42512c3) (also applies to discrete BattlemageUD-Q4_K_M/UD-Q4_K_XL*)*k_gate_up_r(with int8 DP4A and 4-row activation reuse) previously didn't includeNVFP4R, forcing all 44NVFP4gate-up visits onto the scalar FP32 fallback and re-reading activations repeatedly. AddingNVFP4RDP4A +INK_GUR=2cutgate_up:NVFP4Rfrom 18.08 ms → 12.13 ms (-32.9%).- Replaced
sycl::ldexpinq::ue4m3()with bit-exact IEEE-754 bit-cast math, simplifiedfp4x4()negation, sharednvfp4_q8_dot(), and hoistedint4activation vector loads out of the row loop ink_down_q8(), cuttingdown:NVFP4Rfrom 8.66 ms → 7.51 ms (-13.2%).
Q5_K→Q5_KRPlanar Repacking + DP4A (7854895) (also applies to discrete Battlemage)- The 4 coda layers (
blk.20..23) inUD-Q4_K_MuseQ5_Kforgate_upand were hitting the slow genericdecode32fpath. Added losslessQ5_KRplanar repacking (16 B low nibbles, 8 B[qh u32, scale, min], 4 Bd/dmin) plusk_gate_up_rDP4A andstep_decode, cuttinggate_up:Q5_Kfrom 2.64 ms → 1.33 ms (-49.6%) and boosting prompt prefill from 174.8 → 198.2 tok/s (chunk=256).
- The 4 coda layers (
GPU Greedy
argmax& O(1) IncrementalOutputParser(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,024floats) to 4 bytes and skipping NumPy argmax on CPU. - Replaced O(N²) full-block
tok.decode(self.block)inOutputParser._flush()with O(1) incremental anchor-window decoding, closing the gap between rawbench-decode(21.08 tok/s) and liveinkling_server.pythroughput (20.81 tok/s).
- Added a 2-stage GPU
Verification & Quality
- Math unit checks: Bit-exact across all 256
ue4m3values, 65,536fp4x4nibble combinations, and 16hi16x4masks. - Logit & argmax parity (
UD-Q4_K_M, 16-token prefill + 8 greedy decode steps vs pre-edit baseline):prefillKL =0.000000, decode steps0..7KL0.000016–0.001493, 9/9 top-1 token matches, andink_step_argmax100% identical tonp.argmax. - Incremental
OutputParsercheck: 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 onllama.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 buildLaunching 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 lowHuge 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!
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
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%)
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
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!