KatInterview

Design a Scalable ML Model Weight Distribution System

System DesignModel answer
MediumModel answerSystem Designmachine-learningsystem-designdistributed-systems

Last updated

Design a robust, distributed infrastructure to distribute, version, and activate multi-gigabyte machine learning model weights across thousands of regional GPU inference instances safely.

In modern AI platforms, modern LLMs and foundation models range from tens to hundreds of gigabytes in size. These models are split into multiple tensor-parallel or pipeline-parallel shards and must be deployed rapidly to thousands of GPU inference nodes distributed across multiple cloud regions.

Design an end-to-end architecture to manage the publication, distribution, verification, and zero-downtime activation of large ML model weight files across thousands of inference servers.

System Scope & Requirements

  1. Scale & Performance:

    • Model weights range from 20 GB to 500 GB per release, partitioned into 8 to 64 shards (e.g., 2 GB to 15 GB per shard).
    • The fleet consists of 10,000 GPU hosts spread across 4–6 geographic regions, organized by hardware capabilities (e.g., A100 vs. H100 hosts).
    • Target update frequency: up to 5 model releases per day.
    • Rollout completion time target: under 15 minutes for full fleet deployment without overloading cross-region network links or storage backends.
  2. Core Functionality:

    • Publication & Storage: Ingest model artifacts as immutable, versioned objects with chunking and cryptographic signatures.
    • Distribution & Caching: Efficient multi-tier distribution (e.g., regional caches, peer-to-peer, or origin offloading) supporting content deduplication and chunk-level resumable downloads.
    • Worker Orchestration: Pull-based or hybrid worker agents handling state machines: target discovery, background downloading, integrity verification, local caching, and seamless memory activation.
    • Rollout & Control: Canary deployment stages (e.g., 1% -> 10% -> 50% -> 100%), automated health monitoring, and instant (<30 second) metadata-driven rollbacks.
    • Security & Integrity: End-to-end cryptographic checksum verification, per-host access authorization via short-lived credentials, and strict isolation.

Required Deliverables

Your design should cover:

  • High-level architecture and component interaction.
  • Data structures and schemas for manifests, releases, and deployment targets.
  • API definitions for publishing, client discovery, and download flow.
  • Weight distribution and local activation strategies (avoiding serving downtime and disk exhaustion).
  • Handling edge cases (network drops, corrupt disk blocks, host restarts mid-download, rollbacks).
  • Operational trade-offs (e.g., push vs. pull, P2P vs. CDN/regional origin servers, eager loading vs. lazy loading).

Hints

Hint 1

Calculate the bandwidth required to push a 200 GB file to 10,000 nodes simultaneously from a single storage bucket to illustrate the necessity of hierarchical caching or P2P fan-out.

Hint 2

Distinguish clearly between downloading weights to local host storage and activating weights into GPU/VRAM memory. Think about host disk constraints and blue/green warm loading.

Hint 3

Consider how content-addressable storage (using SHA-256 block hashing) allows deduplicating unchanged transformer layers across incremental fine-tunes or release iterations.