r/LocalLLaMA • • 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 QuantDedicated VRAM KB
f168 778 372
q8_012 307 620
q4_011 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.

128 Upvotes

36 comments sorted by

44

u/Potential_Top_4669 4d ago

I don't get the reason why quantising would EVER need more vram?

8

u/Fancy-Snow7 4d ago

They claim the model was trained on fp8 KV. So I assumed q8_0 would be fine. I also tried f8_e4m3 which is an option in the unsloth build but that did not fix it.

6

u/maternion 4d ago

They claimed it was trained on MXFP8 KV Cache  Llama.cpp afiak only supports e4m3 and not scaled FP8 or MXFP8 by itself.  But quanting using more memory seems like it might be falling back to some higher precision quant? 

1

u/Fancy-Snow7 4d ago

That was actually my thinking too, that it's falling back to higher precision or something.

→ More replies (1)
→ More replies (1)

1

u/TokenLearner 4d ago

No Llama Master became slower with KV on F8.

1

u/TokenLearner 4d ago

Better kv in q8

91

u/CommonPurpose1969 4d ago

Probably a bug. The Inkling 2 Mini implementation in llama.cpp seems buggy.

17

u/Choice_Celery9481 4d ago

have you ever heard the word "bug"?
it can create a whole new exp that you wont ever expect XD
i made some myself XD

4

u/feudalle 4d ago

Wait that isnt a feature????

2

u/is-this-a-nick 4d ago

llama sometimes does not support data types natively and just converts them into common ones on the fly...

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

37

u/LunaticSongXIV 4d ago

Anthropic's IPO is live and botting and astroturfing has subsided

14

u/jacek2023 llama.cpp 4d ago

Unfortunately bots will be active again after any release from big budget labs (Kimi, GLM, DeepSeek or Qwen)

4

u/KURD_1_STAN 4d ago

How we supposed to showcase benchmarks when we cant run the model correctly yet? Pls fix so we showcase our animals on bikes pls.

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.

9

u/Choice_Celery9481 4d ago

its moe partial looped. new arch so bugs are expected. should be more stable next week.

2

u/OttoRenner 4d ago

UD definitely was buggy tonight and earlier today. Having Q4 running (f16KV) right now on the pagoda test-prompt and it looks like it's working...

Decode:auto Parallel slots:1 TensorSplit: off Reasoning unlimited Temp:1, Top p: 1(= off), Top k: off, Min P:0, repetition penalty: off, Presence Penalty:1, Max Tokens:Max

The (new?) weird thing is how to loadd the model with these settings.

Set the top k etc in the sidepanel BEFORE loading the model and save that profile. Then set the other settings in the model loader in chat and then load the model. Make sure it shows all settings correctly.

I have 2x3090 and 128GB DDR4, Ubuntu 24.04.

Context is at 135k, getting 40-55 tok/s

But it hasn't finished the task yet and I'm worried that it will fail (like the last three times I tried)

Uh oh...it survived compacting...still going...I'm somewhat hopeful 🤣

1

u/v01dm4n 2d ago

Much better today. With 5060Ti, I was getting ~30k context at q4 and ~50k at f16 on 16G VRAM. Today, it's ~200k on q4 and ~75k on f16. Speed also improved from 50tps to 60tps.

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?

1

u/maternion 4d ago

Unsloth is based on their own fork and this model's implementation is totally different on master and unsloth fork. Even the UD GGUFs don't work directly on main they have a separate folder. 

3

u/lukasgravel 4d ago

I meant the specific revision this build uses from their fork.

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.