meta-llama · text

Llama-2-13b-chat-hf

meta-llama/Llama-2-13b-chat-hf

Llama-2-13b-chat-hf at Q4_K_M is exactly 7,865,956,224 bytes (7.33 GiB / 7.87 GB) — an effective 4.835 bits per weight, not the nominal 4. Its KV cache at 32K is 25.00 GiB.

From the file· summed from 1 file(s)From the file· KV from mirror (mirror:NousResearch/Llama-2-13b-chat-hf)
Parameters
13.0B
Architecture
llama
40 layers
Context
4,096
native (config.json)
License
llama2

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
Q2_K5.06 GiB5,429,348,2243.337TheBloke
Q2_K5.06 GiB5,429,349,1843.337second-state
Q3_K_S5.27 GiB5,658,980,2243.478TheBloke
Q3_K_S5.27 GiB5,658,981,1843.478second-state
Q3_K_M5.90 GiB6,337,769,3443.895TheBloke
Q3_K_M5.90 GiB6,337,770,3043.895second-state
Q3_K_L6.45 GiB6,929,559,4244.259TheBloke
Q3_K_L6.45 GiB6,929,560,3844.259second-state
Q4_06.86 GiB7,365,834,6244.527TheBloke
Q4_06.86 GiB7,365,835,5844.527second-state
Q4_K_S6.91 GiB7,414,331,2644.557TheBloke
Q4_K_S6.91 GiB7,414,332,2244.557second-state
Q4_K_M7.33 GiB7,865,956,2244.835TheBloke
Q4_K_M7.33 GiB7,865,957,1844.835second-state
Q5_K_S8.36 GiB8,972,285,8245.515TheBloke
Q5_08.36 GiB8,972,285,8245.515TheBloke
Q5_08.36 GiB8,972,286,7845.515second-state
Q5_K_S8.36 GiB8,972,286,7845.515second-state
Q5_K_M8.60 GiB9,229,924,2245.673TheBloke
Q6_K9.95 GiB10,679,140,2246.564TheBloke
Q6_K9.95 GiB10,679,141,1846.564second-state
Q8_012.88 GiB13,831,319,4248.501TheBloke
Q8_012.88 GiB13,831,320,3848.501second-state
Q5_K_M2 shards17.19 GiB18,459,849,40811.346second-state
F1624.25 GiB26,033,304,35216.001second-state

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0963.13 GiB3.13 GiB40 / 0 / 0
8,1926.25 GiB6.25 GiB40 / 0 / 0
16,38412.50 GiB12.50 GiB40 / 0 / 0
32,76825.00 GiB25.00 GiB40 / 0 / 0
65,53650.00 GiB50.00 GiB40 / 0 / 0
131,072100.00 GiB100.00 GiB40 / 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 6.82 GiB. The real file is 7.33 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from mirror:NousResearch/Llama-2-13b-chat-hf
Layers
40
Attention heads
40
KV heads
40
Head dim
128
Hidden size
5120
Vocab
32,000
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does Llama-2-13b-chat-hf need?
Q4_K_M is exactly 7,865,956,224 bytes (7.33 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is Llama-2-13b-chat-hf's KV cache?
25.00 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 Llama-2-13b-chat-hf 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.