---
title: You must train a model that doesn't fit in one accelerator's memory. Lay out your options and how you would combine…
url: https://gurkanozkan.ai/learn/questions/research-model-that-doesnt-fit-040/
markdown: https://gurkanozkan.ai/learn/questions/research-model-that-doesnt-fit-040.md
kind: question
role: Research
stage: System design
difficulty: Hard
json: https://gurkanozkan.ai/api/learn/questions/research-model-that-doesnt-fit-040.json
robots: noindex
---

# You must train a model that doesn't fit in one accelerator's memory. Lay out your options and how you would combine them for a model of a few hundred billion parameters.

Research · System design · Hard

Theme reported publicly: [Google DeepMind](https://extrabrain.app/interview-questions/how-i-became-deepmind-research-engineer-without-phd-extrabrain/)

## Answer

*Model answer, written in a candidate's voice*

### In short

- Budget params, gradients, optimiser states and activations: about 16 B/param before activations (300B ≈ 4.8 TB); exact cost depends on precision, optimiser, sequence length and batch.
- Use ZeRO/FSDP-style sharding of parameters, gradients, and optimiser states across data-parallel ranks.
- Use tensor parallelism inside a node and pipeline parallelism across nodes, with micro-batches to reduce the pipeline bubble ((p−1)/(m+p−1)).
- Add sequence/context parallelism for long contexts and activation checkpointing plus mixed precision to cut activation memory.
- Place stages and shards topology-aware, checkpoint frequently, and plan for failures and stragglers.

### In full

I would start by writing the memory budget rather than picking a parallelism mode: for a few hundred billion parameters, fp16 weights alone are hundreds of GB, and Adam-style fp32 moments plus master weights push optimiser state into multiple TB before gradients and activations, so no single accelerator can hold the model.

```calc
Example: 300e9 parameters, bf16 mixed precision + Adam
  bf16 weights          300e9 × 2 B  = 0.6 TB
  bf16 gradients        300e9 × 2 B  = 0.6 TB
  fp32 master + m + v   300e9 × 12 B = 3.6 TB
  total                 300e9 × 16 B = 4.8 TB, before activations
  80 GB devices needed just to hold this, fully sharded: 4.8e12 / 80e9 = 60

Pipeline bubble (GPipe-style schedule), p stages, m micro-batches: (p − 1) / (m + p − 1)
  p = 8, m = 32: 7 / 39 ≈ 0.18, so about 18% idle time
```

I would shard parameters, gradients, and optimiser states with ZeRO/FSDP across data-parallel ranks, then use tensor parallelism inside a node where bandwidth is highest and pipeline parallelism across nodes, feeding each stage with micro-batches so the pipeline bubble, roughly (p−1)/(m+p−1) for p stages and m micro-batches, shrinks as the number of micro-batches grows. For long sequences I would add sequence/context parallelism, and I would use mixed precision with activation checkpointing to trade compute for activation memory. Placement would be topology-aware so tensor-parallel groups stay on fast interconnect and pipeline stages cross slower links, with frequent checkpoints and restart logic for failures and stragglers handled by monitoring, rebalancing, and avoiding over-tight synchronisation. The key is that these are complementary: sharding makes the model fit, tensor/pipeline parallelism make it trainable at scale, and checkpointing/mixed precision/sequence parallelism keep activations and long-context cost manageable.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Memory budget: parameters, gradients, optimiser states, activations.
- Data parallelism with sharded states (ZeRO/FSDP).
- Tensor parallelism inside a node; pipeline parallelism across nodes with micro-batches (pipeline bubble).
- Sequence or context parallelism.
- Activation checkpointing and mixed precision.
- Topology-aware placement, checkpointing for failures, stragglers.

## Common mistakes

- Proposing data parallelism alone.
- Forgetting activation memory.

## Topic guides

- [Distributed training and parallelism](https://gurkanozkan.ai/learn/topics/distributed-training.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
