Choose Data, Tensor or Fully Sharded Parallelism for Large Model Training

Last updated: November 29, 2026

Quick Overview

You must train a 30B-parameter language model on a cluster of GPUs that each have 80 GB of memory. Explain data parallelism, tensor and pipeline parallelism, and fully sharded data parallelism, and how you would combine them.

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


You must train a 30B-parameter language model on a cluster of GPUs that each have 80 GB of memory. Explain data parallelism, tensor and pipeline parallelism, and fully sharded data parallelism, and how you would combine them.

Training foundation models on large AWS clusters requires picking a parallelism strategy that fits memory and keeps accelerators busy. This onsite deep dive checks memory arithmetic and an understanding of communication costs.

What the Interviewer Expects
  • Estimate memory for weights, gradients and optimizer state
  • Explain why pure data parallelism does not fit
  • Describe ZeRO or FSDP sharding stages
  • Explain tensor and pipeline parallelism and their communication patterns
  • Propose a combined layout tied to network topology
Key Topics to Cover
Distributed training
Data parallelism
FSDP
Tensor parallelism
Pipeline parallelism
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • Where does activation checkpointing fit and what does it cost?
  • Why is tensor parallelism usually kept within a node?
  • How do pipeline bubbles arise and how do micro-batches reduce them?
  • How would you recover quickly from a node failure mid-run?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Ask number of GPUs, interconnect (fast within a node, slower across nodes), sequence length and global batch size. Assume mixed precision with AdamW....

Approach

Memory per parameter with mixed-precision Adam: 2 bytes bf16 weights, 2 bytes gradients, 4 bytes fp32 master weights, 8 bytes for two Adam moments, about 16 bytes total. For 30B parameters that is abo...


Submit Your Answer
Markdown supported