llama.cpp layer-wise offload

by ggml · Technique · Text & code

Keeps the expert weights of mixture-of-experts language models in system memory while the rest runs on the graphics card, so large models fit on small GPUs.

Alternatives

llama.cpp MoE expert cacheUnmodified cache (7296 MiB, pinned host memory, -ub 32) gave 28.31 tok/s with CPU share 0.95, 1.36x layer-wise offload in the same run; mmap with no share gave 20.13.
llama.cpp tensor override placementNeeding only extra arguments, placing the looped layers' experts on the GPU was 1.39x faster than layer-wise offload for Inkling 2 Mini on a 12GB GPU.
Works with