KatInterview

Design a Job Scheduler for a Distributed Rendering Cluster

System DesignModel answer
HardModel answerSystem Designschedulingdistributed-systemsgpu

Last updated

Design a distributed scheduling service that assigns variable-length rendering jobs to a heterogeneous GPU cluster while balancing priority tiers, resource fit, and fault tolerance.

Design a Job Scheduler for a Distributed Rendering Cluster

A media platform runs computationally intensive rendering jobs on a cluster of hundreds of GPUs. Each job consumes a significant chunk of GPU memory and runs for anywhere from a few seconds to several minutes, depending on what was requested. Your task is to design the scheduling service that sits between incoming user requests and the GPU worker fleet.

Context

The platform has two user tiers — paid subscribers and free users — and the scheduler must treat them differently without letting free users wait forever. The GPU fleet is heterogeneous: two or more hardware generations with different memory capacities and throughput characteristics. Model weights are large (tens of gigabytes) and loading them from scratch is slow enough to matter.

Functional Requirements

  • Accept job submissions carrying a declared memory requirement and an estimated runtime.
  • Route each job to a GPU that can satisfy its memory requirement.
  • Support priority tiers: paid jobs should get lower queue latency than free jobs.
  • Allow high-priority jobs to preempt lower-priority work already running on a GPU, with the displaced job resumable from a checkpoint.
  • Let clients poll or stream progress updates for a submitted job.

Non-Functional Requirements

  • GPU utilization should stay above 85% under normal load.
  • Paid users should see p95 queue wait under 10 seconds.
  • Free users must never starve: provide a bounded worst-case wait even at peak.
  • The scheduler itself must survive a single-node failure with under 10 seconds of disruption.
  • The system must handle thousands of jobs queued or running simultaneously.

What to Cover

  1. API — submission, status, cancellation, and streaming progress.
  2. Architecture — how the orchestrator, scheduler, and worker agents fit together and communicate.
  3. Data model — how you track GPU state, job state, and model cache state.
  4. Scheduling algorithm — how you score and match jobs to GPUs, handle cold starts, and decide when to preempt.
  5. Fairness vs. throughput trade-off — how you prevent starvation without sacrificing cluster efficiency.

Assumptions

  • Individual job runtimes range from 5 seconds to 2 minutes, with a heavy-tailed distribution.
  • GPUs have fixed VRAM; a job cannot run if its requirement exceeds available VRAM on a candidate GPU.
  • Model weights for a job variant range from 20 GB to 60 GB; loading from local NVMe takes 10–20 seconds, from remote object storage 1–2 minutes.
  • The fleet has roughly 500 GPUs across two hardware generations.

Hints

Hint 1

Start by deriving concrete numbers: jobs per second, average running jobs (Little's Law), and queue depth at peak. These numbers expose which components need to be durable and which can be in-memory.

Hint 2

Cold start is not a minor detail here — loading weights can take as long as running the job. Think about where weights are cached, how you predict demand, and how the scheduler prices a cold GPU versus waiting for a warm one.

Hint 3

Pure priority queuing maximizes throughput for paid users but starves free users; strict partitioning is fair but wastes idle capacity. The interesting design space is in how you combine both ideas — think pool borrowing and score aging.