Skip to main content
← PROBLEMS / SYSTEM-DESIGN
An end-to-end domain learning journey

Design a Distributed LoRA &
Multi-Tenant Fine-Tuning Orchestration Platform.

Full fine-tuning of a 70B foundation model consumes ~1,120 GB of GPU HBM across weights, gradients, and AdamW states, making 10,000+ tenant customizations economically unviable. Designing a multi-tenant LoRA orchestration platform requires pairing QLoRA/FSDP training with <60s async NVMe checkpointing, Merkle-DAG DP-SGD governance, and S-LoRA/Punica serving with <10 ms atomic A/B pointer swaps.
Start the journey3 stages· Last modified Nov 28, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When scaling to 10,000+ adapters and 500+ GPUs, combine QLoRA training with S-LoRA unified paging, Iceberg lineage, and epoch-gated canary rollouts.

TL;DR30-second simplified summary
▾

The platform separates an async Ray/K8s training plane (41.2 GB QLoRA jobs, 2-stage pinned-RAM/NVMe checkpoints) from a low-latency S-LoRA serving plane (129 hot adapters/GPU, <15 ms prefetch, <10 ms A/B swaps).

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
Distributed training parallelism (DDP vs FSDP/ZeRO-3)
Core prerequisite: Distributed training parallelism (DDP vs FSDP/ZeRO-3).
LoRA / QLoRA quantization and S-LoRA / Punica SGMV serving
Core prerequisite: LoRA / QLoRA quantization and S-LoRA / Punica SGMV serving.
Differential privacy (DP-SGD) and KMS envelope encryption
Core prerequisite: Differential privacy (DP-SGD) and KMS envelope encryption.
Full walkthrough · 3 stages
01
L4 · FUNDAMENTALS

R & E: Requirements, Scale Math & VRAM Budgets.

Target scale: 10,000+ tenant LoRA adapters, 500+ H100 80 GB GPUs, 100B+ tokens/day (~1.16M tok/s aggregate), <60s checkpoint recovery MTTR, <15 ms cold adapter prefetch, and <10 ms A/B hot-swap. A rank-16 70B LoRA adapter is ~146.8 MB (10,000 adapters = 1.46 TB total). QLoRA reduces 70B training VRAM from 1,120 GB (FSDP ZeRO-3) to 41.2 GB, fitting on a single H100 with 1,000x less AllReduce traffic.

Training Footprint: FSDP ZeRO-3 vs QLoRA NF4

Before · FSDP ZeRO-3 Full Fine-Tune
  • 1,120 GB HBM (16x H100)
  • Heavy 800 Gbps AllGather
After · QLoRA 4-bit NF4 + BF16 LoRA
  • 41.2 GB HBM (1x H100)
  • 438 MB async checkpoint (<60s)
02
L4 · FUNDAMENTALS

S, H & A: Governance Gate, Async Checkpointing & S-LoRA Serving.

The architecture separates five tiers: (1) Tenant Ingestion & PII/DP Gate (Aho-Corasick + NER, Iceberg Merkle-DAG, Ghost-Clipped DP-SGD), (2) Ray/K8s Scheduler routing QLoRA vs FSDP jobs, (3) 500+ GPU Training Cluster with 2-stage async NVMe checkpointing, (4) S3 + NVMe Safetensors Registry with per-tenant KMS DEKs, and (5) S-LoRA/Punica Serving Tier with Unified Paged HBM and Envoy consistent-hash A/B routing.

End-to-End Fine-Tune, Hot-Swap & Failover Sequence

TenantGovernanceGateRayClusterRegistrySLoRAServing1. Upload dataset -> PII scrub +Iceberg commit2. Dispatch QLoRA job + DP-SGDepsilon budget3. Async NVMe->S3 safetensors +KMS sign4. 5% Canary via routing_epoch(<10 ms swap)
03
L5 · APPLIED DESIGN

D & E & D: Failure Modes, GDPR Crypto-Shredding & Trade-Offs.

On NVIDIA XID/NCCL faults or spot preemption, Ray cordons the node, promotes a warm standby GPU, restores the 438 MB QLoRA checkpoint from NVMe/S3 in <1s, and replays the deterministic dataloader (epoch, shard, offset, rng_state) well under the 60s MTTR SLA. For GDPR Article 17 erasure, a <100 ms Redis tombstone fences inference gateways, GPU HBM pages are zeroed, and the tenant's KMS DEK is crypto-shredded.

2-Stage Async Checkpointing Pipeline (<40 ms GPU Stall)

GPU HBM (438 MBLoRA + AdamW)Training StatePinned Host RAMcudaMemcpyAsync (<40…NVMe RAID-0Local Staging (0.14s…S3 + KMS DEKDurable Safetensors…Async DMA (<40 ms)Background flushEncrypted multipartupload

Interactive Visual Simulation

Spot GPU Preemption & <60s Elastic Recovery

n1

Primary H100 Node

Preempted / XID 79 Fault

30s spot notice / DCGM XID 79
n2

Ray Controller

Cordon & State Machine

Promote standby & seek offset
n3

S3 / NVMe Registry

438 MB Safetensors + Delta

Pull 438 MB checkpoint (0.35s)
n4

Standby H100 Actor

Deterministic Resume

nodeStatus

CORDONING

fault

SPOT_30S_OR_XID_79

lastAsyncCheckpointAge

12s

Spot Termination or XID 79 DetectedDegraded / Fault
AWS/GCP sends 30s spot termination notice or DCGM flags XID 79 ECC error.
Engineering Decision Framework
Problem
How to route 10,000+ tenant fine-tuning jobs across 500+ H100 GPUs without exhausting cluster HBM or violating <60s checkpoint recovery SLAs.
Naive Solution
Run full-parameter FSDP/ZeRO-3 fine-tuning for every tenant job across 16x H100 nodes.
Why It Fails
A 70B full fine-tune consumes ~1,120 GB HBM and saturates 800 Gbps InfiniBand AllGather and Lustre storage, making 10,000+ tenant customizations economically unviable.
Alternatives
Compare (1) FSDP/ZeRO-3 full fine-tuning on 16+ H100s with Lustre POSIX checkpoints vs. (2) 4-bit NF4 QLoRA + BF16 LoRA adapters on a single H100 with 2-stage async NVMe/S3 checkpointing.
Engineering Decision
Route 90% of enterprise domain/style adaptations (rank <= 64) to single-GPU QLoRA (41.2 GB HBM, 438 MB async checkpoints), reserving multi-node FSDP/ZeRO-3 strictly for pretraining or massive new-language/modality shifts.
Trade-Offs
QLoRA achieves 27x lower VRAM and 1,000x less AllReduce traffic in exchange for ~20% slower per-step NF4 dequantization compute.
Decision Exercise · Make the Call

A 5% canary rollout of adapter v2 passes latency SLAs (p99 = 38 ms) but an async Shadow Judge flags a 3.4% perplexity regression and PII leakage from memorized training snippets. What automated sequence should trigger?

ChoiceWhat it buysWhat it costs
2-Stage Async (RAM->NVMe->S3)GPU stall <40 ms via cudaMemcpyAsync to pinned host RAM Recovery MTTR of 0.14s - 0.35s from NVMe RAID-0 or S3 Canonical default for QLoRA (<60s SLA)Requires pinned host RAM reservation per training node Background flush worker must bound NVMe/S3 bandwidth
Synchronous S3 Multipart0.35s recovery MTTR from S3 object store No local NVMe RAID-0 staging tier required15 - 45 s GPU stall per checkpoint Rejected due to severe Model FLOPs Utilization (MFU) loss
Lustre Parallel POSIX<100 ms GPU stall at cluster scale 1 - 3s recovery MTTR for multi-node FSDP jobsHigh shared filesystem cost and operational overhead Restricted to FSDP-Only Tier
Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 4
Score: 0/4

Why does 2-stage async checkpointing copy adapter states to pinned CPU Host RAM before writing to NVMe/S3?

Recommended Learning Flow