google · text

gemma-2-2b-it

google/gemma-2-2b-it

gemma-2-2b-it at Q4_K_M is exactly 1,708,582,752 bytes (1.59 GiB / 1.71 GB) — an effective 5.228 bits per weight, not the nominal 4. Its KV cache at 32K is 1.85 GiB, not the 3.25 GiB a flat formula predicts.

From the file· summed from 1 file(s)From the file· KV from mirror (mirror:unsloth/gemma-2-2b-it)
Parameters
2.6B
Architecture
gemma2
26 layers
Context
8,192
native (config.json)
License
gemma

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ1_S0.78 GiB832,159,5842.546MaziyarPanahi
IQ1_M0.81 GiB873,797,4722.674MaziyarPanahi
IQ2_XS0.93 GiB1,002,544,9923.068MaziyarPanahi
Q2_K1.15 GiB1,229,829,9843.763MaziyarPanahi
IQ3_XS1.22 GiB1,314,211,6804.021MaziyarPanahi
Q3_K_S1.27 GiB1,360,660,3204.164MaziyarPanahi
IQ3_M1.30 GiB1,393,561,4404.264lmstudio-community
IQ3_M1.30 GiB1,393,561,4404.264bartowski
Q3_K_M1.36 GiB1,461,667,6804.473288MaziyarPanahi
Q3_K_L1.44 GiB1,550,436,1924.744bartowski
Q3_K_L1.44 GiB1,550,436,1924.744lmstudio-community
Q3_K_L1.44 GiB1,550,436,1924.744MaziyarPanahi
IQ4_XS1.46 GiB1,566,250,8484.793288bartowski
IQ4_XS1.46 GiB1,566,250,8484.793288lmstudio-community
IQ4_XS1.46 GiB1,566,250,8484.793MaziyarPanahi
Q4_K_S1.53 GiB1,638,651,7445.014bartowski
Q4_K_S1.53 GiB1,638,651,7445.014MaziyarPanahi
Q4_K_M1.59 GiB1,708,582,7525.228288lmstudio-community
Q4_K_M1.59 GiB1,708,582,7525.228MaziyarPanahi
Q4_K_M1.59 GiB1,708,582,7525.228288bartowski
Q5_K_S1.75 GiB1,882,543,9685.761bartowski
Q5_K_S1.75 GiB1,882,543,9685.761MaziyarPanahi
Q5_K_M1.79 GiB1,923,278,6885.885MaziyarPanahi
Q5_K_M1.79 GiB1,923,278,6885.885288bartowski
Q5_K_M1.79 GiB1,923,278,6885.885288lmstudio-community
Q6_K2.00 GiB2,151,393,1206.583288lmstudio-community
Q6_K2.00 GiB2,151,393,1206.583MaziyarPanahi
Q6_K2.00 GiB2,151,393,1206.583288bartowski
Q6_K_L2.14 GiB2,294,241,1207.021bartowski
Q8_02.59 GiB2,784,495,4568.521288lmstudio-community
Q8_02.59 GiB2,784,495,4568.521288bartowski
Q8_02.59 GiB2,784,495,4568.521MaziyarPanahi
F329.74 GiB10,463,413,85632.019bartowski
F329.74 GiB10,463,413,85632.019lmstudio-community

KV cache by context

computed per layer — this model uses sliding-window attention
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.41 GiB0.41 GiB13 / 13 / 0
8,1920.63 GiB0.81 GiB1.28×13 / 13 / 0
16,3841.04 GiB1.63 GiB1.56×13 / 13 / 0
32,7681.85 GiB3.25 GiB1.75×13 / 13 / 0
65,5363.48 GiB6.50 GiB1.87×13 / 13 / 0
131,0726.73 GiB13.00 GiB1.93×13 / 13 / 0

13 of 26 layers cache only a 4,096-token window rather than the full context, on a period of 2. Figures assume the default configuration; --swa-full disables the saving entirely.

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 1.37 GiB. The real file is 1.59 GiB, because a quantization is a mixture and some tensors are always kept at higher precision. The larger discrepancy is the cache: a flat formula gives 3.25 GiB at 32K context where the real figure is 1.85 GiB, because most of this model's layers cache a fixed window rather than the whole context.

Architecture

from mirror:unsloth/gemma-2-2b-it
Layers
26
Attention heads
8
KV heads
4
Head dim
256
Hidden size
2304
Vocab
256,000
Sliding window
4096
SWA period
2
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does gemma-2-2b-it need?
Q4_K_M is exactly 1,708,582,752 bytes (1.59 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is gemma-2-2b-it's KV cache?
1.85 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 gemma-2-2b-it 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.