Folks with smaller VRAM but enough RAM - Token per second almost doubled for Q3 (unsloth)

#15
by nizoai - opened

https://github.com/nizoai/NTransformer
Try this. The test was done on RTX pro 5000 blackwell + 190 GB ram with Ryzen 9000

image

Have similar hardware. Would appreciate full command-line invocation you used.

Have similar hardware. Would appreciate full command-line invocation you used.

Sure β€” heads-up first: GLM-5.3-Flash isn't in upstream llama.cpp yet (see PR #27917), so a plain clone won't load the model. My patch is against that glm5next work (base d0132a680 + the GLM commits), not master. Easiest path:

git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
gh pr checkout 27917
git apply /path/to/NTransformer/expert-cache.patch # expect small conflicts if the PR moved since I cut it
cmake -B build -DGGML_CUDA=ON && cmake --build build --target llama-server -j

Model: Unsloth GLM-5.3-Flash-UD-Q3_K_XL (4 shards). Put it on NVMe β€” --no-mmap reads all ~158 GB into RAM at load.

GGML_CUDA_EXPERT_CACHE=29 ./build/bin/llama-server
-m /path/to/GLM-5.3-Flash-UD-Q3_K_XL-00001-of-00004.gguf
-ot 'ffn_(gate|up|down)_exps.weight=CUDA_ExpertCache'
--no-mmap -fit off --no-warmup
-ngl 99 -c 4096 --threads 16
--cache-type-k q8_0 --cache-type-v q8_0
--ubatch-size 8 --host 127.0.0.1 --port 8092 --jinja

Only the env var and the -ot line are cache-specific (keep the single quotes β€” the parens are a regex). Re-ran this today: 27.6 and 27.3 tok/s decode on two 300-token completions, ctx 4096, greedy, from the server's timings field.

Things that bit me:

  • --ubatch-size 8 and --no-warmup are mandatory in v1: the cache only hooks the decode kernel, anything bigger per matmul crashes. Also why prefill is ~9 tok/s β€” decode is where the win is.
  • 29% is the ceiling for Q3 on 48 GB; 30% fails cleanly at load. Start at 15% (~22 tok/s) and walk up. Q2_K_XL reaches 35% (33.6 tok/s).
  • ~130 GB host RSS per server. One at a time; let free -g recover before relaunching.

Curious what your DDR5 config does to the 14.3 tok/s CPU baseline β€” that's what the speedup is measured against.

Sign up or log in to comment