Memory needed per quant (file sizes + looped KV cache estimate)

#2
by localllmrig - opened

Quick fit table from the published file sizes, in case it helps people pick a quant once the patched llama.cpp lands.

Need β‰ˆ file + KV cache at 32K context + ~0.8 GB overhead (estimate). One thing the loop changes: from config.json, 8 of the 32 stored layers are full attention, but 6 of those (layers 7, 11, 15, 19, 23, 27) sit inside the looped region 4–27 and each visit keeps its own KV, so there are 14 KV layer-visits rather than 8. At 14 Γ— 4 KV heads Γ— 256 head_dim Γ— 2 (K+V) Γ— fp16, that's 57,344 bytes/token: ~1.9 GB at 32K, ~15 GB at the full 262K. The Gated-DeltaNet recurrent state is ~0.1 GB (fp32), so it barely matters.

Quant File Need @32K (est.) Fits (est.)
Q4_K_M 5.6 GB ~9 GB 12 GB GPU / 16 GB Mac
Q5_K_M 6.5 GB ~10 GB 12 GB GPU / 16 GB Mac
Q6_K 7.4 GB ~11 GB 12 GB GPU (tight)
Q8_0 9.5 GB ~13 GB 16 GB GPU / 32 GB Mac
BF16 17.9 GB ~21 GB 24 GB GPU / 32 GB Mac (tight)

(Sizes here are GB = 10^9 bytes from the file list; the card's table looks like GiB, e.g. 5.2 GiB = 5.6 GB.)

So the "8 GB-class" note for Q4_K_M holds at short context (7 GB at 8K), but at 32K a 12 GB card is the comfortable floor, because the looped KV costs 1.75Γ— what the layer count suggests. Corrections welcome, especially if the patched build shares KV across loop visits.

More per-VRAM numbers: https://localllmrig.com/vram/12gb?utm_source=huggingface&utm_medium=community&utm_campaign=sensenova-loop-9b

Sign up or log in to comment