Gemma 3 12B: GPU memory and which GPUs fit it
Hugging Face: google/gemma-3-12b-it
Gemma 3 12B needs about 22.7 GiB for its weights. In vLLM 0.34 at 32K context it starts on one A100-40 (40 GiB), with room for 2.3 requests at full context (74,066 KV tokens). Change the context, users or GPU in the calculator.
The model
- Weights: 22.7 GiB (from the checkpoint’s files)
- KV cache per token: 64 KiB at 16-bit (full-attention layers)
- Native context: 131,072 tokens
- Sliding window: 8 of 48 layers keep the whole context; the other 40 keep the last 1,024 tokens plus the tokens vLLM schedules per step. Sized from vLLM’s block allocator, not yet measured on a GPU.
- Vision model: vLLM also reserves memory for the image encoder. On vLLM 0.34 this is calibrated on one measured run, so treat these estimates as provisional.
Which GPUs fit it at 32K context
The fewest GPUs of each type that vLLM 0.34 will start on at 32K, with 8 request slots: enough memory for at least one full-length request. “Requests at 32K” is how many full-length requests fit in memory at once on that setup; to serve 8 users at full length you may need more GPUs, which the calculator’s comparison table shows.
| GPU | GPUs to start | KV tokens | Requests at 32K | Longest single request |
|---|---|---|---|---|
| L4 (22 GiB) | 2 | 35,064 | 1.1 | 36,864 |
| A10G (22 GiB) | 2 | 34,956 | 1.1 | 36,672 |
| RTX4090 (24 GiB) | 2 | 62,513 | 1.9 | 85,824 |
| A100-40 (40 GiB) | 1 | 74,066 | 2.3 | 106,432 |
| L40S (45 GiB) | 1 | 119,886 | 3.7 | 131,072 |
| RTX6000-Ada (48 GiB) | 1 | 147,442 | 4.5 | 131,072 |
| A100-80 (80 GiB) | 1 | 441,484 | 13.5 | 131,072 |
| H100 (80 GiB) | 1 | 213,654 | 6.5 | 131,072 |
| H200 (140 GiB) | 1 | 485,716 | 14.8 | 131,072 |
| B200 (179 GiB) | 1 | 401,585 | 12.3 | 131,072 |
GPUs needed by context length
| GPU | 8K | 32K | 128K |
|---|---|---|---|
| L4 | 2 | 2 | 4 |
| A10G | 2 | 2 | 4 |
| RTX4090 | 2 | 2 | 4 |
| A100-40 | 1 | 1 | 2 |
| L40S | 1 | 1 | 1 |
| RTX6000-Ada | 1 | 1 | 1 |
| A100-80 | 1 | 1 | 1 |
| H100 | 1 | 1 | 1 |
| H200 | 1 | 1 | 1 |
| B200 | 1 | 1 | 1 |
Why some bigger GPUs hold fewer requests: vLLM’s default --max-num-batched-tokens is 2,048 below 70 GiB, 8,192 on H100-class cards and 16,384 from 160 GiB, and sliding-window layers keep those in-flight tokens for every request. On those cards, starting vLLM with --max-num-batched-tokens 2048 holds more requests at some cost to prompt throughput.
Suggested start on one A100-40, 32K context, 8 request slots (check it on your hardware):
vllm serve google/gemma-3-12b-it \
--max-model-len 32768 \
--max-num-seqs 8
How these numbers were made
With gpu-fit 1.3.0, an open-source tool that reads the model’s
architecture and mirrors how vLLM budgets GPU memory. Weights come from the checkpoint’s file sizes,
KV per token from the model config, and runtime overhead is calibrated on measured vLLM runs. These
are planning estimates: confirm on your own hardware before you spend money. pip install gpu-fit
and run gpu-fit google/gemma-3-12b-it --context 32768 --max-num-seqs 8 --gpu A100-40
to get the same numbers in your terminal.
Other models
Qwen3 4B · Qwen3 8B · Qwen3 8B FP8 · Qwen3 14B · Qwen3 32B · Qwen3 32B FP8 · Qwen3 32B AWQ · QwQ 32B · Qwen3 30B-A3B · Qwen3 30B-A3B FP8 · Qwen3 Coder 30B-A3B · Qwen3-Next 80B-A3B · Qwen3 235B-A22B · Qwen2.5 72B Instruct · Qwen2.5-VL 7B Instruct · Qwen3.8 27B FP8 · Qwen3.6 35B-A3B FP8 · DeepSeek R1 Distill Qwen 32B · DeepSeek V3 · DeepSeek R1 (0528) · Mistral Small 3.2 24B · Devstral Small (2507) · Mistral Nemo 12B · Phi-4 · Phi-4 mini · gpt-oss-20b · gpt-oss-120b · Llama 3.2 3B Instruct · Llama 3.1 8B Instruct · Llama 3.3 70B Instruct · Gemma 3 4B · Gemma 3 27B