r/LocalLLaMA • u/Fancy-Snow7 • 4d ago
Discussion Inkling-2-Mini - Do not quantize your KV cache in llama.cpp - q8_0 uses more VRAM than f16
In unsloth build of llama.cpp I found that quantising KV actually uses more VRAM and not less. Using f16 also gives me up to 50% faster t/g possibly due to having more VRAM to cache experts.
Does anyone else experience this?
I am on Windows 11, with a 5070Ti.
Here is an example using Inkling-2-Mini-UD-Q4_K_XL with dspark-Inkling-2-Mini-Q8_0 no vision and 131072 context and all experts offloaded to CPU:
| KV Quant | Dedicated VRAM KB |
|---|---|
| f16 | 8 778 372 |
| q8_0 | 12 307 620 |
| q4_0 | 11 197 596 |
I picked this up as I was getting CUDA out of memory errors with certain settings (higher context than above) on q8_0 then I switched to f16 and the model loaded.
44
u/Potential_Top_4669 4d ago
I don't get the reason why quantising would EVER need more vram?
116
u/jacek2023 llama.cpp 4d ago
I see that this sub is healing this month, people are starting to experiment with various settings and share their findings instead of just discussing benchmarks
12
u/v01dm4n 4d ago
Something wrong with this model + unsloth. I am also seeing weird issues. More compute buffers for 40k ctx length than 50k! KVcache at q4. No way that should ever be true.
10
u/illcuontheotherside 4d ago
Hopefully they'll all fix. Let them cook. Looks promising if they do.
3
u/Sun77177 4d ago
q8_0 is 32 values plus one fp16 scale. 34 bytes per 32, so 1.06 bytes a value against 2 for f16, about 53%. run it with -v and read the llama_kv_cache lines, k and v print in mib separately. if the cache went down and total vram still went up, it isn't the cache. it's the graph or the expert buffers
2
u/Iron-Over 4d ago
I would wait, to try non-native CUDA. Ran on my DGX worked well. AMD is very slow and buggy at this time.
2
u/lukasgravel 4d ago
Which llama.cpp commit is the Unsloth build based on?
2
u/wFXx 4d ago
I could not reproduce this behavior
2
u/Aubrey_D_Graham 🥔 hardware 4d ago
I need help. Chat told me to use mainline, whih is something I've never needed to do before. I feel like if I wait, it will eventually resolve itself. In the meantime, what do you all recommend I do?
1
u/Pille5 4d ago
Yeah, I found out the hard way.
1
u/Much_Artist_5097 4d ago
that is something weird i’ve noticed, i tried it in sloth and noticed that
anybody know why?
1
u/Vermicelli_Junior 4d ago
is this Unsloth quant problem or unsloth llama cpp pack or something else ?
0
u/Legitimate-Dog5690 4d ago
It's working great in Project Maya, 3090 on a Xeon server with 160gb ddr4, about 90-100 tokens per second.