GGUF is very slow for some reason

#12
by ineersa - opened

Hi there, thanks for great job!

I was trying to utilize 2 GPUs and swapped to this GGUFs from LM Studio MXFP4, and it's surprisingly slow.

I guess something is wrong with my setup but i can't figure it out.

I'm running llama.cpp:

llama-server --device CUDA0 --model ~/models/unsloth/gpt-oss-120b/Q8_0/gpt-oss-120b-Q8_0-00001-of-00002.gguf \
  --host 0.0.0.0 \
  --port 8052 \
  --jinja \
  --ctx-size 65536 \
  --threads 1 \
  --n-cpu-moe 30 \
  --flash-attn \
  --temp 1.0 \
  --top-p 1.0 \
  --min-p 0.0 \
  --top-k 0 \
  --n-gpu-layers 99 \
  --chat-template-kwargs '{"builtin_tools":["python", "browser"], "reasoning_effort":"high"}'

Test with single GPU first.
Q8_0 GGUF gives me 6 tk/s, when MXFP4 from LM Studio gives around 25 tk/s with exaclty same run command.

I was trying with both GPUs with -ot ".ffn_(up|down)_exps.=CPU" but it's also around 7 tk/s.

llama-server version: 6257 (b1afcab8)

cmake -B build -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_CUDA_F16=ON -DCURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so -DGGML_CUDA_MMQ=ON

Could you help me to understand what is not working properly?

https://docs.unsloth.ai/basics/gpt-oss-how-to-run-and-fine-tune#run-gpt-oss-120b

Inside this guide there is an option --threads 1 which pretty much same as default.
But if i don't pass --threads 1 I'm getting 22-23 tokens/sec, when i pass --threads 10 I'm getting 23-24 tokens/sec, but if i pass --threads 1 I get 6 tokens/sec.

That's some black magic going on here.

Now it works, Q8_0 runs at pretty much same speed as MXFP4.

llama-server --device CUDA0,CUDA1 \
  --model ~/models/unsloth/gpt-oss-120b/Q8_0/gpt-oss-120b-Q8_0-00001-of-00002.gguf \
  --host 0.0.0.0 \
  --port 8052 \
  --jinja \
  --threads 10 \
  --ctx-size 65536 \
  --batch-size 4096 \
  --ubatch-size 2048 \
  -ot ".ffn_(up|down)_exps.=CPU" \
  --flash-attn \
  --temp 1.0 \
  --top-p 1.0 \
  --top-k 0 \
  --n-gpu-layers 999 \
  --chat-template-kwargs '{"builtin_tools":["python", "browser"], "reasoning_effort":"high"}'

Gives around 26 tokens/sec, difference is minimal with 1 GPU, so I guess i will stick to 1 GPU and run other models on 2nd one.

hi @ineersa will the following command also work for https://huggingface.co/unsloth/gpt-oss-safeguard-20b-GGUF ?

llama-server --device CUDA0,CUDA1
--model ~/models/unsloth/gpt-oss-safeguard-20b-GGUF /gpt-oss-safeguard-20b-Q2_K_L.gguf
--host 0.0.0.0
--port 8052
--jinja
--threads 10
--ctx-size 65536
--batch-size 4096
--ubatch-size 2048
-ot ".ffn_(up|down)_exps.=CPU"
--flash-attn
--temp 1.0
--top-p 1.0
--top-k 0
--n-gpu-layers 999
--chat-template-kwargs '{"builtin_tools":["python", "browser"], "reasoning_effort":"high"}'

Sign up or log in to comment