Home / use case

Predicting MoE experts for a 35B model on an 8 GB laptop, and why it didn't speed anything up

At a glance
Hardware
8 GB laptop
Models & engines
Qwen3.6 35B MoE model, also tested at Q4
llama.cpp with the custom expert predictor wired in
Key gotcha
Prefetching moves the same data earlier rather than less of it, and wrong guesses evict experts that are still needed (his best explanation; he hasn't measured bytes per token directly).

What they built

Running a 35B MoE model (Qwen3.6) on an 8 GB laptop, the experts don't fit on the GPU, so they get moved in from RAM or SSD. The usual fix in recent papers is to guess the next experts and fetch them early.

The author first looked inside the model to see what changes the expert choice between layers and found that the top 10% of components account for 49 to 71% of it. That led to a lookup-table predictor, which he wired into llama.cpp.

He then profiled the result to see why a better predictor did not make decoding faster.

Setup

  • 8 GB laptop
  • Qwen3.6 35B MoE model, also tested at Q4
  • llama.cpp with the custom expert predictor wired in

How it works

  1. A lookup-table predictor guesses the next layer's experts from the small set of components that drive expert choice, so they can be prefetched.
  2. He reports it is as accurate as a trained adapter at 1/4 to 1/8 the compute and works unchanged on Q4.

Results & numbers

  • Experts ready in time went from 65% to 87%.
  • Decode speed did not improve, and some setups got 15 to 28% slower.
  • Profiling showed the GPU idle about 90% of the time, waiting on data copies, CPU expert compute and CPU-GPU hand-offs rather than on the right expert.
  • Going from 8 to 24 CPU threads gave +23%, and RAM cache at 4 GB, 8 GB and everything gave 11, 19 and 28 tok/s; --cpu-moe or a static layer split gave 33 to 39 tok/s.

Gotchas

  • Prefetching moves the same data earlier rather than less of it, and wrong guesses evict experts that are still needed (his best explanation; he hasn't measured bytes per token directly).
  • Laptop power mode swung the same config by 40%, more than every other effect.
“Hit rate went way up. Speed didn’t move.”— Oyama Mahiro

Do it yourself

  1. If the model fits in RAM, use --cpu-moe or a static layer split and skip expert caches.
  2. Try more CPU threads and a larger RAM cache before anything clever.
  3. Pin the laptop's power mode before you benchmark.
Source: Oyama Mahiro on X · Published 2026-11-10 · Added 2026-11-11. This write-up summarizes the original source; see it for full details.

Similar setups

Faster local Qwen on an AMD eGPU with the llama-cpp-rdna-boosts patches

A developer running a Qwen3.8-27B fine-tune on an AMD R9700 eGPU swapped vanilla llama.cpp for a small set of AMD-specific patches in a Podman image and roughly doubled prefill speed.

devnull.land · 2026-11-27

LM Studio vs Ollama on an RTX 5080: memory settings mattered more than the app

LK Wood IV ran LM Studio and Ollama on the same RTX 5080 with identical GGUF files and found the apps within 14% of each other, while one wrong offload or context setting cost up to 3.4x.

LK Wood IV (DEV Community) · 2026-11-01

Letting a coding agent tune llama.cpp on an 8 GB AMD GPU: 3x faster prompt reading for OpenCode

Cliff K had his coding agent benchmark llama.cpp backends and flags for a Qwen3.6 35B MoE on a Radeon RX 6600 XT, at the context depths OpenCode really uses, and turned the process into an open-source skill.

Cliff K (DEV Community) · 2026-11-01

Selective MoE offloading in llama.cpp on a 16 GB laptop GPU: faster for some models, much slower for others

Jessica Doering benchmarked five Mixture-of-Experts models too big for her 16 GB RTX 4090 laptop GPU, comparing llama.cpp's --n-cpu-moe expert offloading against plain layer offloading.

Jessica Doering (DEV Community) · 2026-10-31