ibm-granite · text

granite-8b-code-instruct-4k

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

granite-8b-code-instruct-4k at Q4_K_M is exactly 4,882,858,528 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,9361.793mradermacher
I1-IQ1_S1.68 GiB1,805,484,8321.793mradermacher
I1-IQ1_M1.83 GiB1,966,309,2801.953mradermacher
I1-IQ1_M1.83 GiB1,966,310,1761.953mradermacher
I1-IQ2_XXS2.08 GiB2,234,351,5202.219mradermacher
I1-IQ2_XXS2.08 GiB2,234,352,4162.219mradermacher
I1-IQ2_XS2.30 GiB2,467,659,6802.451mradermacher
I1-IQ2_XS2.30 GiB2,467,660,5762.451mradermacher
I1-IQ2_S2.40 GiB2,576,449,4402.559mradermacher
I1-IQ2_S2.40 GiB2,576,450,3362.559mradermacher
I1-IQ2_M2.60 GiB2,790,883,2322.772mradermacher
I1-IQ2_M2.60 GiB2,790,884,1282.772mradermacher
I1-Q2_K2.85 GiB3,062,071,2003.041mradermacher
Q2_K2.85 GiB3,062,071,8403.041mradermacher
I1-Q2_K2.85 GiB3,062,072,0963.041mradermacher
I1-IQ3_XXS2.94 GiB3,161,554,8483.140mradermacher
I1-IQ3_XXS2.94 GiB3,161,555,7443.140mradermacher
I1-IQ3_XS3.15 GiB3,384,115,1043.361mradermacher
IQ3_XS3.15 GiB3,384,115,7443.361mradermacher
I1-IQ3_XS3.15 GiB3,384,116,0003.361mradermacher
I1-Q3_K_S3.30 GiB3,548,086,1763.524mradermacher
Q3_K_S3.30 GiB3,548,086,8163.524mradermacher
I1-Q3_K_S3.30 GiB3,548,087,0723.524mradermacher
I1-IQ3_S3.32 GiB3,568,140,1923.544mradermacher
IQ3_S3.32 GiB3,568,140,8323.544mradermacher
I1-IQ3_S3.32 GiB3,568,141,0883.544mradermacher
I1-IQ3_M3.43 GiB3,679,551,3923.655mradermacher
IQ3_M3.43 GiB3,679,552,0323.655mradermacher
I1-IQ3_M3.43 GiB3,679,552,2883.655mradermacher
I1-Q3_K_M3.67 GiB3,944,841,1203.918mradermacher
Q3_K_M3.67 GiB3,944,841,7603.918mradermacher
I1-Q3_K_M3.67 GiB3,944,842,0163.918mradermacher
I1-Q3_K_L3.99 GiB4,287,725,4724.258mradermacher
Q3_K_L3.99 GiB4,287,726,1124.258mradermacher
I1-Q3_K_L3.99 GiB4,287,726,3684.258mradermacher
I1-IQ4_XS4.07 GiB4,369,121,1844.339mradermacher
I1-IQ4_XS4.07 GiB4,369,122,0804.339mradermacher
IQ4_XS4.10 GiB4,405,821,9844.376mradermacher
I1-Q4_04.29 GiB4,605,575,0724.574mradermacher
I1-Q4_04.29 GiB4,605,575,9684.574mradermacher

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-instruct-4k need?
Q4_K_M is exactly 4,882,858,528 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-instruct-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-instruct-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.