Gemma 3 27B IT: how much VRAM does it need?

Gemma 3 27B IT has 27.43B parameters in 62 layers. It uses grouped-query attention: 32 query heads share 16 key-value heads, so its KV cache is 2× smaller than full multi-head attention would need. It takes up to 131,072 tokens of context; one user at that length needs 12.35 GiB of KV cache at FP16 on top of the weights. Its repository is gated on Hugging Face, so LLMScale ships its architecture in a bundled database.

BF16 · 8k context · one user
56.53 GiB

51.10 GiB of weights, 2.98 GiB of KV cache and 2.46 GiB of vLLM's overhead. At INT4 the same workload needs 20.93 GiB.

  • 62 layers
  • hidden 5376
  • 32/16 heads
  • head_dim 128
  • 128k max context

Gemma 3 27B IT memory by precision and context

Precision8k context32k context128k context
BF1656.53 GiBKV cache 2.98 GiB58.41 GiBKV cache 4.85 GiB65.91 GiBKV cache 12.35 GiB
FP832.29 GiBKV cache 2.98 GiB34.17 GiBKV cache 4.85 GiB41.67 GiBKV cache 12.35 GiB
INT420.93 GiBKV cache 2.98 GiB22.81 GiBKV cache 4.85 GiB30.31 GiBKV cache 12.35 GiB

One user, FP16 KV cache and vLLM's overhead on one GPU at its defaults for a card under 70 GB. Quantizing shrinks the weights, not the KV cache, so the saving narrows as the context grows.

Which single GPUs hold it

At 8k context for one user, the smallest cards first. A discrete card is budgeted at vLLM's default 92% of its memory, a unified-memory device at the share its GPU can address, and each carries vLLM's overhead at its own defaults.

How many users fit

GPUBF16FP8INT4
RTX 4090does not fitdoes not fit1
RTX 5090does not fitdoes not fit3
RTX 6000 Adadoes not fit48
H100 SXM 80GB3811
RTX PRO 6000 Blackwell61214
AMD Ryzen AI Max+ 395 (128GB)61215
H200 141GB162124
B200 180GB222831

Users at 8k context each, on one card. ✗: the weights leave no room for even one.

Fine-tuning Gemma 3 27B IT

MethodMemorySmallest GPU
Full fine-tune411.0 GiBseveral GPUs, sharded
LoRA (rank 16, attention)53.84 GiBAMD MI210
QLoRA (rank 16, attention)15.92 GiBNVIDIA L4

Sequence length 2,048, batch size 1, gradient checkpointing on, Adam. Full fine-tuning keeps 16 bytes per parameter before activations; QLoRA stores the frozen base in 4-bit NF4.

Where the numbers come from

Weights are parameters × bytes per parameter. The KV cache is 2 × layers × key-value heads × head dimension × bytes × context × users. For Gemma 3 27B IT that is 496.0 KiB per token at FP16. 52 of its 62 layers attend over a sliding window of the last 1,024 tokens and hold no more than that, so past it each further token adds 80.0 KiB, the other 10 layers' share. These are capacity-planning figures: the serving engine — vLLM, TGI, llama.cpp — and its paged-attention efficiency still move the real number.

More on KV cache size and on GQA, MQA and MLA.

Work with Gemma 3 27B IT

Other Gemma models