ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

MoE disk offload

Open kisasexypantera94 opened this issue 6 months ago • 3 comments

Hi! I've been working on MoE disk offload for llama.cpp and got some promising results. Managed to run a model nearly 2x larger than available RAM at ~9 tok/s.

The approach is pretty simple: keep N expert slots in memory and page missing ones from GGUF via pread with LRU eviction. The natural integration point in ds4 would be tensor_expert_bytes(), instead of returning a raw mmap pointer, check an LRU slot pool first and pread on miss. Don't have a 96GB machine to test myself, but thought you might be interested.

kisasexypantera94 avatar May 19 '26 15:05 kisasexypantera94

Cool idea. I would love to see it implemented.

CobraSoftware avatar May 28 '26 02:05 CobraSoftware

I did some experiments trying to adapt the same approach I used for llama.cpp. Managed to squeeze around 4–5 tok/s from q2-imatrix on my M3 Pro 36GB. The bottleneck is obviously RAM and SSD bandwidth, so there might be some improvement on 48-64GB macs. To be fair, the vanilla cpu-only version already runs at around 2 tok/s, haha.

kisasexypantera94 avatar May 28 '26 13:05 kisasexypantera94

oh cool

CobraSoftware avatar Jun 01 '26 03:06 CobraSoftware