Skip to content
RED SAGSkills
hardMachine Learning Engineer interview question

You need to train a model that is too large for one GPU and takes weeks on one machine. How do you scale training?

What the interviewer wants to hear

  • Data parallelism for speed when the model fits
  • Sharding (FSDP/ZeRO), tensor and pipeline parallelism when it does not
  • Mixed precision and activation checkpointing for memory
  • Communication overhead, interconnect and batch size effects
  • Checkpointing and fault tolerance

Model answer

I first profile to find the real bottleneck: compute, memory or input pipeline. For memory, mixed precision with bf16 and activation checkpointing are cheap wins. If the model still does not fit, I use fully sharded data parallel or ZeRO, which shards parameters, gradients and optimizer states across GPUs. For very large models I add tensor parallelism within a node, where interconnect is fast, and pipeline parallelism across nodes. For speed, data parallelism across many GPUs scales throughput, but a larger global batch may need learning rate warmup and tuning to keep quality. Communication becomes the limit at scale, so I overlap it with compute and use fast interconnects. Long runs fail, so I save sharded checkpoints regularly, make jobs resumable, and track loss and gradient norms to catch instability early.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Machine Learning Engineer questions