Design an Automated Health and Recovery Platform for a GPU Fleet
System DesignModel answerLast updated
Design a platform that ingests high-rate telemetry from 100,000 GPU servers, detects hardware faults, runs safe repair workflows, and limits how many machines are taken offline at once.
Design a Self-Healing Platform for a Large GPU Fleet
Your team operates 100,000 servers that run demanding AI training and inference jobs. You need to build a platform that continuously watches the health of the GPUs, detects hardware problems, and fixes them automatically where possible.
Typical faults include uncorrectable memory (ECC) errors, overheating that forces clock throttling, and GPUs that hang. Typical fixes include resetting the GPU driver, rebooting, reinstalling the operating system, or marking the machine for physical replacement by data-center staff.
Functional requirements
- Telemetry intake: every server reports health metrics at 10 samples per second.
- Per-GPU state tracking: each GPU is always in one of Healthy, Degraded, Repairing, or Failed.
- Automated recovery: when a fault is detected, a state-machine-driven repair workflow runs.
- Limited blast radius: cap the number of simultaneous repairs so that automation cannot remove too much serving capacity.
Non-functional requirements
- Scalability for both metric ingestion and distributed workflow coordination.
- Idempotency: a repair workflow can be retried safely with no harmful side effects.
- Observability: a global dashboard shows live fleet health and repair progress.
What to cover in your answer
- The overall architecture: components, data flow, and storage choices.
- How the ingestion pipeline copes with the telemetry volume.
- How you enforce guardrails so automated repairs never take down too many machines at once.
- What happens when automated repair keeps failing and the issue must be escalated.
State your assumptions (GPUs per host, bytes per sample, expected failure rate) and show the back-of-envelope numbers that justify your choices.
Hints
Hint 1
Do the arithmetic first: samples per second, bytes per second, and expected incidents per day. Compare telemetry volume with state-change volume and let that gap shape the design.
Hint 2
Do not rely on raw 10 Hz data for urgent faults. Let an on-host agent batch routine samples and push critical events immediately, and keep detectors stateful with windows and hysteresis to avoid flapping.
Hint 3
Model repair as a durable workflow with an escalating ladder of actions. Make every step check-then-act with an idempotency key, and require a token from a hierarchical, lease-based semaphore before any disruptive step.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Size the problem
- 100,000 hosts, assume 8 GPUs each, so about 800,000 GPUs.
- 10 Hz per host gives 1M samples/s. At roughly 1 KB per sample (8 GPUs times about 20 metrics: temperature, power, clocks, utilization, ECC single/double-bit counts, XID codes, NVLink and PCIe errors), raw ingest is about 1 GB/s, or about 86 TB/day.
- Failures are rare. If a few tenths of a percent of hosts have an issue per day, that is hundreds of incidents per day.
Key insight: telemetry is high volume, state changes are low volume. So use a streaming pipeline for metrics and a small, strongly consistent store plus a durable workflow engine for state and repairs.
Targets: under 5 s detection for hard faults, under 1 minute for degradation trends. Automation may remove at most about 1% of the fleet at once.
2. Architecture
Host agent -> Ingest gateways -> Kafka[telemetry] -> Stream detectors -> Kafka[health-events]
| | |
+-- critical events -> Kafka[critical] ---------------------------------->|
v v
TSDB (rollups) + object store (raw) Health State Service
|
Workflow engine <-> Guardrail service
|
Scheduler (drain) / Actuator / Ticketing
3. Ingestion
- Host agent (NVML/DCGM based) samples at 10 Hz but ships one compressed batch per second. This turns 1M msgs/s into 100k msgs/s, roughly 200 MB/s after compression. It also evaluates simple local rules, so a double-bit ECC error or a fatal XID is sent immediately on a separate high-priority topic. Hard-fault detection never waits for a batch.
- Stateless gateways (about 50 behind an L4 load balancer) authenticate, validate, and produce to Kafka.
- Kafka: around 256 partitions keyed by host id for per-host ordering, replication 3, 24-48 h retention, one cluster per region so failure domains match.
- Independent consumers: stream detectors keyed by host; a downsampler writing 10 s rollups to a TSDB (about 100x smaller, kept for months); an archiver writing Parquet to object storage for forensics and model training.
4. Detection
Use windows and hysteresis:
- Any double-bit ECC error: Failed immediately.
- Single-bit error rate above a threshold per hour: Degraded.
- High temperature plus throttled clocks for 60 s: Degraded.
- Full utilization with no progress counters, or a missing heartbeat for 30 s: Suspect (hang).
Detectors emit health events, not state. A single Health State Service is the only writer of host state and applies transitions with compare-and-swap on a version field, so duplicated or reordered events are harmless. Host state is only about 100k rows of roughly 2 KB, so a replicated relational store or etcd is fine; write rate is at most hundreds per second.
5. Repair workflow
HEALTHY -> DEGRADED -> DRAINING -> REPAIRING(step k) -> VALIDATING -> HEALTHY
| fail | fail
+-----> next rung <---+
exhausted -> FAILED -> AWAITING_REPLACEMENT
Repair ladder, cheapest first: GPU or driver reset, host reboot, OS re-image, physical replacement.
Run it on a durable workflow engine (Temporal or Cadence style) that persists each step, so a worker crash resumes instead of restarting.
Idempotency
- Every action carries the key
(incident_id, step, attempt); the actuator stores completed keys and returns the earlier result on replay. - Every step is check-then-act: read real host state first (for example, skip re-imaging if the target image is already installed).
- CAS on state version prevents a stale worker from overwriting newer state.
- Drain through the job scheduler: cordon, wait for a checkpoint or a timeout, then evict. For hard faults skip the wait because the job is already dead.
Validation before return to service is mandatory: a known-answer matrix multiply, a multi-GPU all-reduce, a memory test, and a short thermal soak. A reboot does not prove a fix.
6. Blast-radius guardrails
Before any disruptive step the workflow must obtain a token from a guardrail service.
- Hierarchical semaphores in etcd: global (about 1% of fleet), per region, per cluster (about 5%), and per rack or power domain (for example 2 hosts). Acquire all scopes in a single transaction or none.
- Leases with TTL so a crashed worker's slots free themselves; long steps renew.
- Start-rate token bucket (for example, 50 new repairs per minute per region) to smooth bursts even when slots are free.
- Anomaly circuit breaker: if the failure rate suddenly spikes or many hosts fail at once, the cause is likely systemic (bad driver rollout, power or cooling event, bad config). Pause automation and page a human instead of repairing everything.
- Operator controls to pause, resume, and cordon by scope.
Waiting workflows queue by priority, favoring hosts in clusters with spare capacity and hard faults over soft degradation.
7. Escalation
- Each rung gets a bounded number of attempts (for example 2) with backoff.
- Track repeat offenders: if a host returns to Degraded within a window after passing validation, skip rungs and go straight to a stronger action or replacement.
- When the ladder is exhausted, mark the host Failed, remove it from scheduling, and open a ticket for data-center staff with the incident history attached (faults, steps, validation output, GPU serials).
- Page on-call only for fleet-level signals (circuit breaker tripped, repair backlog growing, guardrail saturation), not for individual hosts.
8. Observability
- Stream state-change events into the TSDB and an OLAP store for the dashboard: counts by state, by cluster, by fault type; repair queue depth; mean time to repair; success rate per ladder rung; guardrail utilization.
- Alert on detection latency, workflow stuck time, and Kafka consumer lag.
9. Trade-offs and common mistakes
- Mistake: pushing all 10 Hz data through the state database. Keep raw data in streams and storage; only state changes touch the strongly consistent store.
- Mistake: alerting on a single sample. Use windows and hysteresis.
- Mistake: no guardrails, so a bad detector or bad rollout drains the fleet. The circuit breaker matters as much as the semaphores.
- Mistake: declaring a host healthy after a reboot without validation.
- Trade-off: lower sampling rates cut cost, but agent-side critical rules preserve fast detection of hard faults.
- Trade-off: per-region clusters improve isolation but complicate the global dashboard, which then reads from aggregated rollups.