gpt-oss 120B: how much VRAM does it need?

gpt-oss 120B has 116.83B parameters in 36 layers. It uses grouped-query attention: 64 query heads share 8 key-value heads, so its KV cache is 8× smaller than full multi-head attention would need. It is a Mixture-of-Experts model with about 5.10B of its 116.83B parameters active per token: memory has to hold all of them, while each token passes through only the active share. It takes up to 131,072 tokens of context; one user at that length needs 4.65 GiB of KV cache at FP16 on top of the weights.

BF16 · 8k context · one user
220.1 GiB

217.6 GiB of weights, 437 MiB of KV cache and 2.04 GiB of vLLM's overhead. At INT4 the same workload needs 63.24 GiB.

  • 36 layers
  • hidden 2880
  • 64/8 heads
  • head_dim 64
  • 128k max context
  • MoE

gpt-oss 120B memory by precision and context

Precision8k context32k context128k context
BF16220.1 GiBKV cache 437 MiB220.9 GiBKV cache 1.27 GiB224.3 GiBKV cache 4.65 GiB
FP8112.4 GiBKV cache 437 MiB113.2 GiBKV cache 1.27 GiB116.6 GiBKV cache 4.65 GiB
INT463.24 GiBKV cache 437 MiB64.08 GiBKV cache 1.27 GiB67.46 GiBKV cache 4.65 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 fitdoes not fit
RTX 5090does not fitdoes not fitdoes not fit
RTX 6000 Adadoes not fitdoes not fitdoes not fit
H100 SXM 80GBdoes not fitdoes not fit15
RTX PRO 6000 Blackwelldoes not fitdoes not fit32
AMD Ryzen AI Max+ 395 (128GB)does not fitdoes not fit29
H200 141GBdoes not fit27114
B200 180GBdoes not fit88166

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

Fine-tuning gpt-oss 120B

MethodMemorySmallest GPU
Full fine-tune1742.3 GiBseveral GPUs, sharded
LoRA (rank 16, attention)219.1 GiBAMD MI325X
QLoRA (rank 16, attention)57.68 GiBAMD MI210

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 gpt-oss 120B that is 72.0 KiB per token at FP16. 18 of its 36 layers attend over a sliding window of the last 128 tokens and hold no more than that, so past it each further token adds 36.0 KiB, the other 18 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 gpt-oss 120B

Other OpenAI models