ibm-granite · text

granite-8b-code-base-4k

ibm-granite/granite-8b-code-base-4k

granite-8b-code-base-4k at Q4_K_M is exactly 4,882,857,152 bytes (4.55 GiB / 4.88 GB) — an effective 4.850 bits per weight, not the nominal 4. Its KV cache at 32K is 4.50 GiB.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
8.1B
Architecture
llama
36 layers
Context
4,096
native (config.json)
License
apache-2.0

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
I1-IQ1_S1.68 GiB1,805,483,4881.793mradermacher
I1-IQ1_M1.83 GiB1,966,308,8321.953mradermacher
I1-IQ2_XXS2.08 GiB2,234,351,0722.219mradermacher
I1-IQ2_XS2.30 GiB2,467,659,2322.451mradermacher
I1-IQ2_S2.40 GiB2,576,448,9922.559mradermacher
I1-IQ2_M2.60 GiB2,790,882,7842.772mradermacher
Q2_K2.85 GiB3,062,070,4643.041SanctumAI
I1-Q2_K2.85 GiB3,062,070,7523.041mradermacher
I1-IQ3_XXS2.94 GiB3,161,554,4003.140mradermacher
I1-IQ3_XS3.15 GiB3,384,114,6563.361mradermacher
Q3_K_S3.30 GiB3,548,085,4403.524SanctumAI
I1-Q3_K_S3.30 GiB3,548,085,7283.524mradermacher
I1-IQ3_S3.32 GiB3,568,139,7443.544mradermacher
I1-IQ3_M3.43 GiB3,679,550,9443.655mradermacher
Q3_K_M3.67 GiB3,944,840,3843.918SanctumAI
I1-Q3_K_M3.67 GiB3,944,840,6723.918mradermacher
Q3_K_L3.99 GiB4,287,724,7364.258SanctumAI
I1-Q3_K_L3.99 GiB4,287,725,0244.258mradermacher
I1-IQ4_XS4.07 GiB4,369,120,7364.339mradermacher
Q4_04.28 GiB4,590,894,2724.560SanctumAI
I1-Q4_04.29 GiB4,605,574,6244.574mradermacher
Q4_K_S4.30 GiB4,622,351,5524.591SanctumAI
I1-Q4_K_S4.30 GiB4,622,351,8404.591mradermacher
Q4_K_M4.55 GiB4,882,857,1524.850SanctumAI
Q4_K4.55 GiB4,882,857,1524.850SanctumAI
Q4_K_M4.55 GiB4,882,857,1524.850ibm-granite
I1-Q4_K_M4.55 GiB4,882,857,4404.850mradermacher
Q4_14.73 GiB5,081,627,8405.047SanctumAI
Q5_05.19 GiB5,572,361,4085.534SanctumAI
Q5_K_S5.19 GiB5,572,361,4085.534SanctumAI
I1-Q5_K_S5.19 GiB5,572,361,6965.534mradermacher
Q5_K_M5.33 GiB5,722,766,5285.684SanctumAI
Q5_K5.33 GiB5,722,766,5285.684SanctumAI
I1-Q5_K_M5.33 GiB5,722,766,8165.684mradermacher
Q5_15.65 GiB6,063,094,9766.022SanctumAI
Q6_K6.16 GiB6,615,170,2406.570SanctumAI
I1-Q6_K6.16 GiB6,615,170,5286.570mradermacher
Q8_07.98 GiB8,565,521,6008.507SanctumAI
F1615.01 GiB16,115,268,80016.005SanctumAI

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.56 GiB0.56 GiB36 / 0 / 0
8,1921.13 GiB1.13 GiB36 / 0 / 0
16,3842.25 GiB2.25 GiB36 / 0 / 0
32,7684.50 GiB4.50 GiB36 / 0 / 0
65,5369.00 GiB9.00 GiB36 / 0 / 0
131,07218.00 GiB18.00 GiB36 / 0 / 0

Compare with

same modality, comparable size

Will it run on your card?

full quant x context sweep

Why other calculators give a different number

A parameters × bits ÷ 8 estimate puts Q4_K_M at roughly 4.22 GiB. The real file is 4.55 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from config.json
Layers
36
Attention heads
32
KV heads
8
Head dim
128
Hidden size
4096
Vocab
49,152
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does granite-8b-code-base-4k need?
Q4_K_M is exactly 4,882,857,152 bytes (4.55 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is granite-8b-code-base-4k's KV cache?
4.50 GiB at 32K context with an f16 cache, computed per layer. Quantizing the cache to q8_0 roughly halves it, which is often the difference between a context length fitting and not.
Which quantization of granite-8b-code-base-4k should I use?
Q4_K_M is the usual default. Pick the largest quantization that fits your card at the context you actually need — the table above gives exact sizes for every one published.