gpt-oss-120b VRAM requirements
Fine-tuning gpt-oss-120b takes about 66 GB of GPU memory with QLoRA, 238 GB with LoRA on 16-bit weights and 1,873 GB for full fine-tuning, at 2,048 tokens per sequence. Running it takes 234 GB in 16-bit or 66 GB in 4-bit with a 8K-token context. It is a mixture of experts: 5.1B of its 116.8B parameters work on each token, but all of them must be in memory.
Fine-tuning memory
| Method | Weights | Training state | Activations | Total | Smallest single GPU | 80 GB GPUs needed |
|---|---|---|---|---|---|---|
| QLoRA (4-bit base) | 62 GB | 0.2 GB | 4.0 GB | 66 GB | A100 80GB (80 GB) | 1 |
| LoRA (16-bit base) | 234 GB | 0.2 GB | 4.0 GB | 238 GB | None | 4 |
| Full fine-tuning | 234 GB | 1,636 GB | 4.0 GB | 1,873 GB | None | 27 |
On a 24 GB card such as the RTX 4090: QLoRA: no, it needs about 66 GB at 2K tokens, more than the 24 GB available.
Inference memory
| Precision | Weights | KV cache at 8K | Total | At 128K context | Smallest single GPU |
|---|---|---|---|---|---|
| 16-bit (BF16/FP16) | 234 GB | 0.3 GB | 234 GB | 238 GB | None |
| 8-bit | 117 GB | 0.3 GB | 117 GB | 122 GB | H200 (141 GB) |
| 4-bit | 65 GB | 0.3 GB | 66 GB | 70 GB | A100 80GB (80 GB) |
Which GPUs fit gpt-oss-120b
One GPU unless a count is shown. Follow a GPU's name for its maximum sequence length, batch size, LoRA rank and rental cost.
| GPU | QLoRA | LoRA | Full fine-tuning | Run, fp16 | Run, int8 | Run, int4 |
|---|---|---|---|---|---|---|
| RTX 3090 24 GB | 4× | 12× | 87× | 11× | 6× | 4× |
| RTX 4090 24 GB | 4× | 12× | 87× | 11× | 6× | 4× |
| RTX 5090 32 GB | 3× | 9× | 66× | 9× | 5× | 3× |
| L40S 48 GB | 2× | 6× | 44× | 6× | 3× | 2× |
| A100 40GB 40 GB | 2× | 7× | 53× | 7× | 4× | 2× |
| A100 80GB 80 GB | Yes | 4× | 27× | 4× | 2× | Yes |
| H100 SXM 80 GB | Yes | 4× | 27× | 4× | 2× | Yes |
| H200 141 GB | Yes | 2× | 15× | 2× | Yes | Yes |
| B200 180 GB | Yes | 2× | 12× | 2× | Yes | Yes |
What's specific to gpt-oss-120b
- Ships quantised: MXFP4 expert weights make a 65.3 GB checkpoint, which is how it runs on a single 80 GB GPU.
- 128 experts with 4 active per token: 5.1B active of 116.8B total, so it is fast for its size but memory-hungry.
- Upcasting to 16-bit for LoRA needs about 234 GB of weights, so single-GPU fine-tuning means keeping the weights in 4-bit, which just fits an 80 GB H100 at short sequences.
| Architecture | gpt-oss-120b |
|---|---|
| Parameters | 116.8B total, 5.1B active per token |
| Experts | 128 per layer, 4 used per token |
| Layers | 36 |
| Hidden size | 2,880 |
| Expert MLP width | 2,880 |
| Attention heads / KV heads | 64 / 8 (head dim 64) |
| Vocabulary | 201,088 tokens |
| Context | 128K tokens; 18 of 36 layers use a 128-token sliding window |
| License | Apache 2.0 |
| Released | August 2025 |
Try other settings
Pre-filled for gpt-oss-120b. Change the sequence length, batch, LoRA rank, context or GPU.
| Job | Memory | RTX 4090 (24 GB) | Smallest single GPU |
|---|---|---|---|
| QLoRA (4-bit base)2K tokens × batch 1, rank 16 | 66 GB | 4 GPUs | A100 80GB (80 GB) |
| LoRA (16-bit base)2K tokens × batch 1, rank 16 | 238 GB | 12 GPUs | None: needs several |
| Full fine-tuning2K tokens × batch 1 | 1,873 GB | 87 GPUs | None: needs several |
| Inference, 16-bit (BF16/FP16)8K-token context × 1 sequence | 234 GB | 11 GPUs | None: needs several |
| Inference, 8-bit8K-token context × 1 sequence | 117 GB | 6 GPUs | H200 (141 GB) |
| Inference, 4-bit8K-token context × 1 sequence | 66 GB | 4 GPUs | A100 80GB (80 GB) |
A job fits when the estimate is within 90% of the card's memory. Training assumes gradient checkpointing and FlashAttention; multi-GPU counts assume the memory splits evenly (FSDP, ZeRO-3 or tensor parallelism).
How we estimate it
Every figure comes from the model's published architecture (layers, hidden size, attention and KV heads, vocabulary) rather than a rule of thumb, using the same functions as the calculator above. Sizes are in GB (10⁹ bytes).
- Full fine-tuning: 16 bytes per parameter for mixed-precision Adam (bf16 weights and gradients, fp32 master weights and two moments), as in the ZeRO paper.
- LoRA: frozen bf16 weights (2 bytes per parameter) plus 16 bytes per adapter parameter, rank 16 on every linear layer. For mixture-of-experts models, adapters go on attention only and the experts stay frozen.
- QLoRA: NF4 weights with double quantisation (4.127 bits per parameter); embeddings and the output head stay in bf16, as bitsandbytes leaves them.
- Activations: gradient checkpointing and FlashAttention. Each layer's bf16 input is kept, one layer is recomputed at a time, and the output logits take 8 bytes per vocabulary entry per token (fp32 values and gradients). Chunked cross-entropy, as in Unsloth or Liger kernels, cuts that last term.
- Inference: 2, 1 or about 0.56 bytes per weight (4-bit with group-wise scales), plus an fp16 KV cache of 2 × layers × KV heads × head dim × 2 bytes per token; sliding-window layers only cache their window.
- Fits means the estimate is within 90% of the card's listed memory; the rest covers the CUDA context, kernels and fragmentation. Multi-GPU counts assume memory splits evenly.
Frequently asked questions
- Can I fine-tune gpt-oss-120b on a 24 GB GPU?
- On an RTX 3090 or 4090 (24 GB): QLoRA: no, it needs about 66 GB at 2K tokens, more than the 24 GB available. LoRA: no, it needs about 238 GB at 2K tokens, more than the 24 GB available. Estimates use gradient checkpointing and leave 10% of memory free.
- How much VRAM do you need to run gpt-oss-120b?
- About 234 GB in 16-bit and 66 GB in 4-bit, at 8K tokens of context. The smallest single GPU here for 4-bit is the A100 80GB (80 GB); 16-bit needs several GPUs.
- How many GPUs does full fine-tuning gpt-oss-120b take?
- About 1,873 GB with mixed-precision Adam at 2K tokens, so at least 27 × 80 GB H100s with the training state sharded (FSDP or ZeRO-3). LoRA needs 238 GB and QLoRA 66 GB.
- Why does gpt-oss-120b need so much memory if only 5.1B parameters are active?
- It is a mixture of experts: each token uses 4 of 128 experts per layer, but which ones changes token to token, so all 116.8B parameters stay in GPU memory. Speed follows the active parameters; memory follows the total. Our LoRA figures adapt attention only; adapting every expert at rank 16 adds about 21 GB of adapter training state.
- How long a context can gpt-oss-120b handle on an 80 GB GPU?
- Its KV cache costs 4.8 GB at the full 128K tokens (fp16 cache). On one 80 GB GPU: 16-bit weights don't fit, 128K tokens with 4-bit weights.
Related
- gpt-oss-120b on RTX 509032 GB · max settings and cost
- gpt-oss-120b on H100 SXM80 GB · max settings and cost
- gpt-oss-120b on H200141 GB · max settings and cost
- gpt-oss-120b on B200180 GB · max settings and cost
- gpt-oss-20b VRAMOpenAI
Terms used on this page: LoRA, QLoRA, KV cache, gradient checkpointing, quantization, mixture of experts. For any model size, use the fine-tuning VRAM calculator; for the method in depth, the Academy lesson Memory first: what hardware can train what.
Sources
- Hugging Face. openai/gpt-oss-120b config.json
- OpenAI. openai/gpt-oss-120b model card
- OpenAI. gpt-oss-120b & gpt-oss-20b Model Card (arXiv:2508.10925)
- Dettmers et al., 2023. QLoRA: Efficient Finetuning of Quantized LLMs (arXiv:2305.14314)
- Hu et al., 2021. LoRA: Low-Rank Adaptation of Large Language Models (arXiv:2106.09685)
- Rajbhandari et al., 2019. ZeRO: Memory Optimizations Toward Training Trillion Parameter Models (arXiv:1910.02054)
- Korthikanti et al., 2022. Reducing Activation Recomputation in Large Transformer Models (arXiv:2205.05198)
- Chen et al., 2016. Training Deep Nets with Sublinear Memory Cost (arXiv:1604.06174)
Architecture read from config.json and parameter count from the Hugging Face safetensors metadata on 15 November 2026.
Find out if you need to fine-tune at all.
Kojen's prompt tuning and model search run for real on your own test cases, on hosted models. Measure the cheaper levers before you rent a GPU.
Start training free