Maple-Preview is DeepGrove's 20B mixture of experts with ternary weights: only about 1B weights are read per token. Its official code needs CUDA. Working with an AI coding agent, I built a runtime for the machine at hand: an Intel CPU with AVX2 and an AMD Radeon from 2014. On the same iMac it writes 1.9× faster than DeepGrove's own llama.cpp fork, and with the prompt on the old Radeon it reads 4.4× faster.
I worked with an AI coding agent. I set the direction and the checkpoints; the agent wrote the converter, the runtime and the GPU kernels, and measured. Every speed-up had to match a plain numpy reference before it counted. The dead ends stay in the picture.
The official code needs CUDA. The machine at hand: a 2014 iMac, i5-4690, 16 GB DDR3, Radeon R9 M290X with 2 GB.
"Let's build the runtime ourselves."
The converter streams the 40 GB BF16 checkpoint into 5.8 GB. AVX2 multiplies 32 weights per instruction. Against a numpy reference: same top-1 and top-5 tokens, logits within 0.7%.
The output head runs on the Radeon in BF16, one pass for a whole pack of conversations.
Every GPU idea had to win a small benchmark first.
Exact, but no faster: the card needs ~0.25–0.3 ms per layer just to answer, about what the CPU takes for all 8 experts.
More weights per token, worse answers on an extraction test. The model was trained with 8.
Norms, attention, projections and experts run on the card; the CPU chooses 8 of 256 experts per token in ~1 ms per layer. An 843-token prompt: 11.8 s → 2.7 s.
They run at 35–40% of the card's peak. Decoding the 2-bit codes in registers, 1.5 instructions per weight instead of 3: 6–7% faster.
8.7 GB/s over PCIe, but the kernels got only 9% faster. Two other kernel layouts ran 1.4× and 2.3× slower.
A video-capture service holds part of one core. A spinning pool of four waits for the worker that got pushed aside.
DeepGrove's own fork and official GGUF, the same token counts, the same background load.
Fork 7e30f3a, TQ2_0 with an FP16 head, 3 threads. Writing: 29.4–30.8 vs 15.9 t/s. A 2,048-token prompt: 321 t/s on the card vs 73.7. On the CPU both read prompts at the same speed.
MIT, like the model.
8 Nov 2026. deepgrove-ai/llama.cpp at 7e30f3a with the official maple-preview-TQ2_0-head-F16.gguf; this runtime v1.2. Same token counts, 3 threads. A video-capture service used ~64% of one core during both runs.
| 3 threads | GPU prompt | CPU | llama.cpp |
|---|---|---|---|
| Prompt, 2,048 tokens | 320.7 | 73.0 | 73.7 |
| Prompt, 512 tokens | 184.6 | 78.6 | 78.0 |
| Writing, 128 tokens | 27.7–31.5 | 29.4–30.8 | 15.9 |
| 4 threads | GPU prompt | CPU | llama.cpp |
|---|---|---|---|
| Prompt, 2,048 tokens | 330.1 | 44.1 | 64.0 |
| Prompt, 512 tokens | 187.9 | 51.4 | 68.2 |
| Writing, 128 tokens | 15.9–19.1 | 16.8–19.6 | 8.8 |
Same raw prompt, greedy: both begin with "Rayleigh scattering." and then part ways. llama.cpp falls into a loop, this runtime keeps writing coherent text. That is a numerical difference after a few tokens, not proof that either is more exact.
Each token goes through 8 of 256 experts per layer. The weights are ternary: −1, 0 or +1.
The BF16 checkpoint is streamed and packed: 40 GB in, 5.8 GB out, memory-mapped at run time.
Activations go to int8; maddubs on AVX2 multiplies 32 weights per instruction. Attention keeps an fp16 cache.
The hidden state stays in VRAM. The CPU only reads the router's logits and picks the 8 experts per token, ~1 ms per layer.
The 2-bit codes are read over PCIe straight from the mapped shards and unpacked in registers: 1.5 instructions per weight.