Memory needed per quant at 32K and 256K context (file sizes + KV estimate)

#3
by localllmrig - opened

Fit table from the GGUF file sizes here, mainly for the long context: at 1.7B the weights are small, so at 256K the KV cache is the bigger part.

Need β‰ˆ file + KV cache + ~0.8 GB overhead (estimates). Per config.json only 6 of 24 layers are global attention (4 KV heads Γ— 128), 5 use a 256-token window and the rest are convolutions, so fp16 KV is ~12 KB/token: ~0.4 GB at 32K, ~3.2 GB at 256K.

Quant File Need @32K Need @256K
QAD-Q4_0 1.05 GB ~2.3 GB (4 GB GPU) ~5.1 GB (8 GB GPU)
Q4_K_M 1.10 GB ~2.3 GB (4 GB GPU) ~5.1 GB (8 GB GPU)
Q8_0 1.85 GB ~3.1 GB (4 GB, tight) ~5.9 GB (8 GB GPU)
BF16 3.47 GB ~4.7 GB (6 GB GPU) ~7.5 GB (12 GB GPU)

So up to Q8_0 runs the full 256K window on an 8 GB card; a q8_0 KV cache roughly halves the KV part. Corrections welcome.

Per-GPU table: https://localllmrig.com/can-i-run/lfm3-1.7b?utm_source=huggingface&utm_medium=community&utm_campaign=lfm3-1-7b

Sign up or log in to comment