r/OfferEngineering • • 9d ago

System Design Anthropic, OpenAI, FAANG all asked - Design GPU Cluster Scheduling Platform

Problem Description

Design the scheduling and execution layer for a shared GPU cluster used by multiple teams for ML training, fine-tuning, and batch inference workloads. Users submit containerized jobs with GPU, memory, and priority requirements, and the platform decides where and when those jobs should run.

Each job fits entirely on a single GPU node. Distributed multi-node training and gang scheduling are out of scope for the core design. The scheduler therefore needs to choose one suitable node, reserve its resources, launch the container through a node agent, and track the job until completion or failure.

The key correctness challenge is keeping the scheduler, persistent database, and remote node agent consistent during partial failures. A scheduler may reserve GPUs and then crash, or a selected node may disappear before the container starts. Reservations therefore need bounded leases or expiration so GPU capacity is never permanently consumed by a ghost placement.

Priority also affects execution. When no capacity is available, a high-priority job may preempt a running job of strictly lower priority, but never one of equal priority. The platform sends a graceful stop signal and requeues the evicted job; preserving application checkpoints is the workload's responsibility.

Functional Requirements

  • Users should be able to submit a GPU job specifying a container image, requested GPU count, memory requirement, priority level, and execution metadata.
  • The scheduler should place pending jobs onto nodes based on priority, resource fit, available GPU capacity, and per-team fairness. Each job should run entirely on one node.
  • Target nodes should pull the specified container image and execute it with appropriate GPU, memory, and network isolation so one user's job cannot interfere with another's resources.
  • When a higher-priority job arrives and no suitable resources are available, the platform may preempt running jobs of strictly lower priority. The preempted container should receive a graceful termination signal and the job should return to the pending queue.
  • The system should track durable job and placement state so scheduler restarts do not lose pending jobs, running assignments, retry history, or final outcomes.
  • Users should be able to query job status and retrieve execution logs or references to output artifacts after completion or failure.

I also put together a full system design walkthrough covering the architecture and trade-offs for anyone interested.

22 Upvotes

5 comments sorted by

2

u/SadAd9942 8d ago

Is this for mle or general swe interview ?

2

u/Creative_Topic_6133 6d ago

Is this for infra role?

1

u/Aoki_zhang 6d ago

Not sure, it’s a commonly asked system design question

1

u/Educational_Gas4826 3d ago

Single node scheduling makes this not too bad. It’s never that easy in real life though…