Quality loss in smaller 4 bit?

#7
by neptronix - opened

Hey unsloth.
I was wondering - deepseek flash v4 model weights came in MXFP4 or some other quantized 4bit format, right?
For a quant like IQ4_NL, can we expect some added quality loss because we're not quantizing from 16bit, as with most models?

Have 128gb and trying to figure out how much extra VRAM i need to have a good time with DS4 flash

Unsloth AI org

UD-Q8_K_XL is full precision but it's not technically 8-bit, but rather 4-bit. Yes there will be some quality loss with IQ4_NL and UD-Q4_K_XL but very very less.

I'm finding the IQ3_XXS quant to be quite useful, so far not a lot of issues. Sometimes it makes malformed tool calls but that may be related to my use of opencode, and telling the model to try again has succeeded every time so far.

Running with an RTX Pro 6000 Blackwell and 128GB of DDR5, with a 327680 context window I get around 20tg and 400pp starting out. The token generation stays around 17 into 200k+ context lengths, but prompt processing slows down and gets below 200 at ~100K tokens.

For reference, I'm running it with this command:

llama-server \
    --model <path>/DeepSeek-V4-Flash-UD-IQ3_XXS-00001-of-00004.gguf \
    --threads 24 \
    --temp 1.0 \
    --top-p 1.0 \
    --min-p 0.0 \
    --ctx-size 327680 \
    --alias "DeepSeek-V4-Flash" \
    --host 0.0.0.0 \
    --no-mmap \
    -np 1 \
    -ngl auto \
    -fa on\
    --cache-type-k q8_0 \
    --cache-type-v q8_0 \
    --jinja --reasoning on --reasoning-format deepseek

My system can handle the full 1M context length, but so much of the model is offloaded to CPU (so KV cache can stay resident in VRAM) that there's a big hit to processing speeds. It's still usable if you're willing to wait, but not great.

I was under the impression that the KV cache was supposed to be smaller, so perhaps there's still some tinkering to be done with llama.cpp.

UD-Q8_K_XL is full precision but it's not technically 8-bit, but rather 4-bit. Yes there will be some quality loss with IQ4_NL and UD-Q4_K_XL but very very less.

Thanks pardner!

I'm finding the IQ3_XXS quant to be quite useful, so far not a lot of issues. Sometimes it makes malformed tool calls but that may be related to my use of opencode, and telling the model to try again has succeeded every time so far.

I'm surprised at that because the source material is 4 bit and you'd think the rounding errors could get harsh coming from 4 bit.

Running with an RTX Pro 6000 Blackwell and 128GB of DDR5....

Getting 20 tokens/sec on so much CPU offloading is impressive actually. Maybe you'd have some fun with a low 4 bit quant of Step 3.5 flash on this setup.
Adding a RTX PRO 5000 48gb for 144gb total might yield a good time with these quants.

I hear some performance aspects are not implemented in llama.cpp yet. But, flash is super cheap online. I'm hopeful that it will rip once the support is there!

Sign up or log in to comment