Design Topology-Aware Gang Scheduling for TPU Training Jobs

Last updated: November 29, 2026

Quick Overview

Design a scheduler for a shared fleet of TPU pods where training jobs need a contiguous slice of chips (for example a 16x16 block) all at once, with priorities, preemption, and fair sharing across research teams.

Google
System Design
Machine Learning Engineer
Google
November 29, 2026
Machine Learning Engineer
Onsite
System Design
Hard

0

0

0 solved


Design a scheduler for a shared fleet of TPU pods where training jobs need a contiguous slice of chips (for example a 16x16 block) all at once, with priorities, preemption, and fair sharing across research teams.

Large-model training at Google runs on TPU pods whose interconnect topology makes placement a geometric problem, not plain bin packing. Interviewers use this to see if you can combine gang scheduling, fragmentation control, and checkpoint-aware preemption.

What the Interviewer Expects
  • Explain why all-or-nothing (gang) allocation is required
  • Model the pod as a topology and allocate contiguous slices
  • Control fragmentation so large slices remain available
  • Make preemption checkpoint-aware to limit lost work
  • Share capacity fairly across teams with quotas and borrowing
Key Topics to Cover
gang scheduling
topology-aware placement
fragmentation
checkpoint-aware preemption
fair share
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you avoid a large job waiting forever while small jobs keep filling gaps?
  • How would you handle a single failed chip inside an allocated slice?
  • How do you decide which job to preempt?
  • How would multi-slice jobs over the data center network change things?
Sharpen Your Skills on Codemia

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

Practice System Design Problems
Sample Answer
Requirements
  • Jobs request a slice shape (2x2 up to full pod) and a priority. All chips start together or not at all.
  • Slices must be contiguous in the interconnect torus for performance.
  • Teams have guaranteed...
High-Level Design
  • Capacity model: per pod, a grid of chip states (free, allocated, broken).
  • Queue manager: per-team queues with quota accounting (guaranteed plus borrowed chips).
  • Placement engine: fin...

Submit Your Answer
Markdown supported