KatInterview

Multi-Cloud GPU Scheduler for Machine Learning Workloads

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsresource-managementscheduling

Last updated

Build a resource manager that schedules ML training jobs across on-premises and public cloud GPU clusters with fairness, cost optimization, and reliability.

Problem Statement

You need to architect a platform that manages GPU compute resources for machine learning training across both private datacenters and public cloud providers. The system must intelligently allocate resources, handle long-running workloads, and balance cost against availability.

What the System Must Do

Resource Management Across Environments

  • Decide whether to place each job in your own datacenter or rent cloud GPUs
  • Consider availability, cost, data location requirements, and user preferences when choosing

Job Submission Interface

  • Accept training workloads with their container images or code repositories
  • Understand resource requests: GPU model, quantity, CPU, memory
  • Support optional constraints like geographic restrictions, budget limits, urgency level

Workload Lifecycle

  • Track jobs through their lifecycle: waiting, executing, finished, failed, stopped
  • Surface progress through logs and metrics
  • Implement retry logic for transient failures

What to Consider

Multi-Tenancy: How do you share limited GPUs fairly across many teams while preventing one team from monopolizing resources?

Fault Tolerance: Training jobs run for hours or days. What happens when a machine dies or a cloud API becomes unavailable?

Data and Code Security: How do you isolate workloads? How do you handle authentication and prevent teams from accessing each other's data?

Scale: The system serves hundreds of teams submitting dozens of jobs per minute with thousands of jobs in various states.

What to Produce

  • Component architecture showing how pieces interact
  • API contracts for submitting, monitoring, and canceling work
  • Scheduling algorithm that decides placement and order
  • Storage strategy for code, training data, and artifacts
  • Approach to monitoring, debugging, and operating the system

Make explicit assumptions about scale, workload characteristics, and SLOs. Discuss trade-offs in your design choices.

Hints

Hint 1

Start by clarifying scale: how many GPUs, how many teams, typical job sizes, and what availability target you're designing for.

Hint 2

The scheduling problem has two levels: choosing which cluster (on-prem vs cloud), then allocating specific machines within that cluster.

Hint 3

Multi-GPU jobs need all their resources simultaneously—partial allocation creates deadlock. Think about atomic reservations.

Hint 4

Consider the cost model: owned hardware has fixed costs while cloud charges by the hour. How does this affect placement decisions?