llama.cpp tensor override placement

by ggml · Technique · Text & code

Places chosen layers and expert weights of a large mixture-of-experts model on the GPU or CPU through command-line arguments, so it runs faster on a small graphics card.

Latest · Nov 22Needing 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.

Evidence

  1. Nov 22
    Recommended arguments without modifying llama.cpp: -ngl 99 -ot "blk\.([0-5]|1[89]|2[0-3])\.ffn_.*_exps.*=CPU" -ub 64 --no-op-offload; the author took this placement from llama.cpp issues #32778 and #32755.
  2. Nov 22
    --no-op-offload raised prompt processing from 115.6 to 154.8 tok/s; generation stayed 29.4-29.8 tok/s with or without it or with pinned host memory.