r/LocalLLaMA • • 8h ago

Question | Help Llama.cpp compute buffer allocation issue

I recently updated llama.cpp for using qwen4. This is on an M3 Pro mac with 36GB memory, earlier I was able to run qwen3.5 0.8B Q8 at full context with q8_0 K and V cache.

However, now when using q8_0 or q4_0 KV Cache, the memory usage has ballooned, f16 cache uses lesser memory than the quantized ones. I tested qwen3.5 9B, gemma4 12B and they too had this weird issue, so it's not the models but some change in llama.cpp itself.

I have created an issue for this, are any of you experiencing this bug?

https://github.com/ggml-org/llama.cpp/issues/33801

5 Upvotes

3 comments sorted by

View all comments

2

u/Mithrandir_First_Age 6h ago

I can try to repro this later today on an M4 Mac mini 16 GB and an M5 Max 128 GB. What build are you on, and does it still happen with -fa on and -ub 512? My guess is the compute buffer sizing changed, since a q8_0 cache shouldn't need more than f16. Worth adding your full command to the GitHub issue too. Tell me :)

1

u/PM_ME_YOUR_ROSY_LIPS 5h ago

Thanks that'd help. I tested this on build 13012, but it is the same on the latest too (i just build it after pulling, not using any files from the git release).

I have the command listed on git and in a comment here as well:

llama-server -m ~/ai/models/Qwen3.5-0.8B-Q8_0.gguf -mm ~/ai/models/mmproj-qwen3.5-0.8B-BF16.gguf -c 262144 -ctk q8_0 -ctv q8_0 -b 2048 -ub 2048 --temp 1.0 --top-p 1.0 --top-k 20 --min-p 0.00 --presence-penalty 2.0 --repeat-penalty 1.0 --spec-type ngram-mod --host 0.0.0.0 --reasoning off -lv 4

-fa is always needed when using quantized kv, so the flag is switched on. It doesn't work with -ub 512 too. I am running it with --parallel 1 which seems to be working as before at the cost of concurrency.

Yeah I agree that some default compute value has changed for the buffer allocation but I haven't kept up with all llama.cpp changes. The kv cache buffer is still less for quantized ones but the Compute buffer allocation is where it's going awry.