Design a Distributed Model Training Platform — System Design Interview Practice
Design a platform that enables distributed training of large ML models across multiple GPUs and nodes, handles data parallelism and model parallelism, and optimizes training throughput and cost. Work through the requirements, architecture trade-offs, and an interactive design review.
Concepts and architecture decisions to consider
- mlopsConcept to explore
- distributed trainingConcept to explore
- gpu clusterConcept to explore
- deep learningConcept to explore
- data parallelismConcept to explore
- model parallelismConcept to explore
Interview prompt
Design Design a platform that enables distributed training of large ML models across multiple GPUs and nodes, handles data parallelism and model parallelism, and optimizes training throughput and cost. so users can Support data-parallel and model-parallel training reliably at scale.
- Define the source of truth for Support data-parallel and model-parallel training; Manage multi-node GPU clusters dynamically and make retries idempotent.
- Use bounded, partitioned state to meet Manage training job queues and priorities and Linear scaling efficiency above 80%.
- Separate the critical request path from Use PyTorch FSDP or DeepSpeed for distributed training, Implement ZeRO optimization for memory efficiency, Use NCCL for high-performance GPU communication.
- Explain consistency, failure recovery, authorization, observability, and a degraded mode.
Requirements and scale assumptions
- Support the core workflow to Support data-parallel and model-parallel training.
- Expose status, results, and freshness appropriate to Design a platform that enables distributed training of large ML models across multiple GPUs and nodes, handles data parallelism and model parallelism, and optimizes training throughput and cost..
- Support authorization, validation, updates, deletion, and recovery semantics.
- Meet Linear scaling efficiency above 80% under normal load.
- Scale to Manage training job queues and priorities without a single hot key or unbounded synchronous work.
- Do not lose committed state; make retries and duplicate events safe.
- Degrade safely when downstream workers, caches, or external dependencies fail.
- Manage training job queues and priorities
- Partition by the primary tenant, user, item, or geographic key and isolate hot partitions.
- Keep serving state bounded; retain raw events or durable records for replay and auditing.
- Peak scale: Manage training job queues — Capacity assumption that drives partitioning and backpressure.
- Latency target: Linear scaling efficiency above 80% — User-facing budget for the primary request or read path.
- Durable boundary: Committed before async — The source of truth is Support data-parallel and model-parallel training; Manage multi-node GPU clusters dynamically.
- Async boundary: At-least-once workers — Keep Use PyTorch FSDP or DeepSpeed for distributed training, Implement ZeRO optimization for memory efficiency, Use NCCL for high-performance GPU communication off the synchronous path.
Key entities
- DatasetVersiondatasetId, version, schemaHash, qualityStatus, lineage, createdAt
Immutable distributed model training platform input version used for reproducible training, evaluation, or replay.
- FeatureSnapshotentityId, featureSetVersion, eventTime, values, sourceWatermarks
Point-in-time distributed model training platform features with source watermarks so online and offline values can be compared.
- TrainingRunrunId, datasetVersion, codeVersion, metrics, artifactUri, status
Audited distributed model training platform run that records data, code, dependency, and evaluation lineage.
- ModelVersionmodelId, version, stage, schema, qualityGates, endpoint
A promotable distributed model training platform model version with rollout state, contract, and rollback metadata.
Data flow
- 1. Register and validate training dataThe distributed model training platform gateway records an immutable dataset version, schema, lineage, quality status, and privacy disposition.
- 2. Build point-in-time featuresFeature workers join distributed model training platform inputs using event-time watermarks, prevent leakage, and publish the same feature contract for training and serving.
- 3. Train and evaluate asynchronouslyThe orchestrator schedules distributed model training platform runs with checkpointed artifacts, reproducible environments, and metrics tied to the exact input versions.
- 4. Gate and serve a model versionA registry compares distributed model training platform quality, bias, safety, and compatibility gates before canary or production rollout with an immediate rollback pointer.
- 5. Monitor drift and learn from feedbackOnline inference records latency, errors, drift, and delayed labels so distributed model training platform retraining is evidence-driven rather than triggered by guesswork.
Deep dives and trade-offs
- Reproducibility and leakage preventionPin distributed model training platform data, feature, code, dependency, and model versions for every run. Use point-in-time joins and quarantine failed quality or privacy checks before training. Keep raw inputs and artifacts immutable so a result can be replayed after a dependency changes.
- Safe promotion and serving contractsSeparate distributed model training platform model registration from deployment and require signed artifacts plus schema compatibility. Use shadow traffic, canaries, rollback pointers, and per-version latency/error budgets. Return model version and feature freshness so clients can explain or reproduce a prediction.
- Drift, feedback, and costMeasure feature drift, prediction drift, label delay, and segment-level quality for distributed model training platform rather than only aggregate accuracy. Sample expensive inference and cap retraining concurrency with an explicit GPU or compute budget. Keep human corrections and delayed labels linked to the original prediction and model version.
- Batch versus online featuresPrefer a shared feature contract with batch backfills and a low-latency online serving path for decisions that need freshness. Two independently defined transformations create training-serving skew and hard-to-debug regressions.
- Synchronous versus asynchronous inferenceKeep interactive distributed model training platform inference synchronous within a strict budget and queue large or expensive jobs. A request path that waits for model loading, enrichment, or retraining turns downstream slowness into an outage.
- Global model versus segment modelsStart with one versioned model and add segment-specific models only when quality or policy evidence justifies the operational cost. Many simultaneously active versions multiply monitoring, rollback, and data-lineage burden.