KatInterview

Build a Cluster Scheduler for Generative Video Rendering on GPUs

System DesignModel answer
HardModel answerSystem Designgpu-schedulinggang-schedulingpreemption

Last updated

Design a fault-tolerant scheduler that places multi-node, all-or-nothing GPU jobs for a video generation platform, with topology-aware placement, tenant fairness and checkpoint-based preemption.

Context

You are designing the scheduling layer for a worldwide service that turns text prompts into video. Each request runs on several GPUs that must communicate over fast links (NVLink inside a node, InfiniBand between nodes). Runtimes range from about 30 seconds for quick low-resolution drafts to about 20 minutes for high-definition final renders. Demand regularly exceeds the available GPUs.

What the system must do

  • Multiple tenants and tiers. Serve interactive previews, paid production renders and internal background fine-tuning, each with its own configurable SLA.
  • All-or-nothing starts. A job needs its full set of GPUs (8 to 64, often across several nodes) running at the same moment. A partial allocation is useless.
  • Preemption with checkpoints. Low-priority batch work must give way to interactive requests while wasting as little computation as possible.
  • Fairness. During bursts, no single organization may monopolize the cluster.

Scale and targets

  • 16,000 GPUs in 2,000 nodes of 8 GPUs, connected with InfiniBand.
  • Up to 50,000 job submissions per hour at peak.
  • Scheduling decision for an interactive draft in under 200 ms.
  • Node and GPU health changes visible to the scheduler in under 1 second.
  • Survives scheduler leader crashes and worker hardware failures without losing running or queued jobs.

What to cover in your answer

  1. API and data model: submit, inspect and cancel endpoints; how a job is represented (GPU count, topology preference, priority tier).
  2. Architecture: centralized versus two-level allocation, queueing, and how gang starts are made atomic.
  3. Topology-aware placement: handling NVLink domains, NUMA and rail-aligned InfiniBand.
  4. Fairness and preemption: the sharing algorithm (for example DRF or weighted fair queueing), the preemption protocol and where checkpoints are stored.
  5. Failure handling: stragglers, heartbeats, and re-queuing aborted jobs.

Hints

Hint 1

Convert the requirements into numbers first: 50k jobs/hour is only about 14 per second, so the hard part is placement quality and fairness, not decision throughput. Also compare estimated GPU demand with the 16,000-GPU supply.

Hint 2

A cluster of 2,000 nodes fits in one process's memory. Ask what that allows for gang scheduling compared with a two-level offer-based design, and how a big multi-node job avoids waiting forever behind small jobs (think reservations plus backfilling).

Hint 3

Treat preemption as a cost-minimization problem: how much work is lost since the last checkpoint, how important the victim is, and how often it has already been evicted. For failures, think about fencing tokens (allocation epochs), launch barriers with timeouts, and a replicated state store with a standby leader.