google · text

gemma-2b

google/gemma-2b

gemma-2b at Q4_K_M is exactly 1,495,245,728 bytes (1.39 GiB / 1.50 GB) — an effective 4.773 bits per weight, not the nominal 4. Its KV cache at 32K is 0.56 GiB.

From the file· summed from 1 file(s)From the file· KV from mirror (mirror:unsloth/gemma-2b)
Parameters
2.5B
Architecture
gemma
18 layers
Context
8,192
native (config.json)
License
cc-by-nc-4.0

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
Q2_K0.84 GiB899,965,8562.873brittlewis12
Q3_K_S1.01 GiB1,083,296,6723.458brittlewis12
Q2_K1.08 GiB1,157,923,9683.696MaziyarPanahi
Q2_K1.08 GiB1,157,962,3043.696NexaAI
Q3_K_M1.10 GiB1,179,118,4963.764brittlewis12
Q3_K_L1.17 GiB1,260,907,4244.025brittlewis12
Q3_K_S1.20 GiB1,287,980,1604.111MaziyarPanahi
Q3_K_S1.20 GiB1,288,018,4964.112NexaAI
Q3_K_M1.29 GiB1,383,801,9844.417MaziyarPanahi
Q3_K1.29 GiB1,383,840,3204.417NexaAI
Q3_K_M1.29 GiB1,383,840,3204.417NexaAI
Q4_K_S1.33 GiB1,424,823,2004.548brittlewis12
Q3_K_L1.36 GiB1,465,590,9124.678MaziyarPanahi
Q3_K_L1.36 GiB1,465,629,2484.678NexaAI
Q4_K_M1.39 GiB1,495,245,7284.773brittlewis12
Q4_01.44 GiB1,551,227,4564.952NexaAI
Q4_K_S1.45 GiB1,559,839,8724.979MaziyarPanahi
Q4_K_S1.45 GiB1,559,878,2084.979NexaAI
Q4_K_M1.52 GiB1,630,262,4005.204MaziyarPanahi
Q4_K1.52 GiB1,630,300,7365.204NexaAI
Q4_K_M1.52 GiB1,630,300,7365.204NexaAI
Q4_11.56 GiB1,675,090,4965.347NexaAI
Q5_K_S1.61 GiB1,729,467,2965.521brittlewis12
Q5_K_M1.65 GiB1,770,202,0165.651brittlewis12
Q5_K_S1.68 GiB1,798,915,2005.742MaziyarPanahi
Q5_K_S1.68 GiB1,798,953,5365.742NexaAI
Q5_01.68 GiB1,798,953,5365.742NexaAI
Q5_K_M1.71 GiB1,839,649,9205.872MaziyarPanahi
Q5_K1.71 GiB1,839,688,2565.872NexaAI
Q5_K_M1.71 GiB1,839,688,2565.872NexaAI
Q5_11.79 GiB1,922,816,5766.138NexaAI
Q6_K1.92 GiB2,062,124,1606.582MaziyarPanahi
Q6_K1.92 GiB2,062,162,4966.583NexaAI
Q6_K1.92 GiB2,062,343,0726.583brittlewis12
Q8_02.49 GiB2,669,069,4408.520MaziyarPanahi
Q8_02.49 GiB2,669,118,6888.520NexaAI
Q8_02.49 GiB2,669,351,8408.521brittlewis12
F164.67 GiB5,018,626,52816.020NexaAI

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.07 GiB0.07 GiB18 / 0 / 0
8,1920.14 GiB0.14 GiB18 / 0 / 0
16,3840.28 GiB0.28 GiB18 / 0 / 0
32,7680.56 GiB0.56 GiB18 / 0 / 0
65,5361.13 GiB1.13 GiB18 / 0 / 0
131,0722.25 GiB2.25 GiB18 / 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 1.31 GiB. The real file is 1.39 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from mirror:unsloth/gemma-2b
Layers
18
Attention heads
8
KV heads
1
Head dim
256
Hidden size
2048
Vocab
256,000
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does gemma-2b need?
Q4_K_M is exactly 1,495,245,728 bytes (1.39 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-2b's KV cache?
0.56 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-2b 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.