A practical guide to building scalable training, inference, and serving systems for production AI
Fuheng Wu

#AI
#ML
#GPU
#PyTorch
#LLM
#SLURM
#SGLang
#FSDP
#DDP
#DevOps
#DeepSpeed
🤖 هوش مصنوعی توزیعشده رو با تجربه دستبهکار یاد بگیر؛ از فریمورکهای آموزش و موتورهای Inference گرفته تا ابزارهای Orchestration، تا بتونی سیستمهای آماده پروداکشن برای آموزش، Inference و Serving مدلهای مدرن AI در مقیاس بزرگ بسازی.
✨ ویژگیهای کلیدی
🖥️ سختافزار GPU، Interconnectهای پرسرعت و استراتژیهای Parallelism رو درک میکنی
🧪 در پایان هر فصل، تمرینهای عملی انجام میدی
⚙️ آموزش توزیعشده رو با تکنیکهای بهینهشده برای مصرف منابع یاد میگیری
🚀 Inference با پرفورمنس بالا رو با بهینهسازیهای پیشرفته و مدیریت حافظه دیپلوی میکنی
🏗️ استکهای Serving آماده پروداکشن رو با Job Schedulerها، Orchestration و Observability میسازی
📘 توضیح کتاب
🧠 با بزرگ شدن مدلهای AI تا مقیاس میلیاردها و تریلیونها پارامتر، سیستمهای توزیعشده برای آموزش و Serving اونها ضروری شدهاند. منابع زیادی بخشهایی از این حوزه رو پوشش میدن، اما هیچکدوم مسیر کاملی از آموزش توزیعشده تا Inference و دیپلوی در پروداکشن ارائه نمیدن. این کتاب با مثالهای عملی و متمرکز بر پروداکشن، این فاصله رو پر میکنه.
🖥️ کتاب با تخمین GPU و حافظه، آمادهسازی داده، و مروری بر معماری GPU، Interconnectها و استراتژیهای اصلی Parallelism شروع میشه. تکنیکهای آموزشی مختلفی یاد میگیری؛ از Data Parallelism برای پیکربندیهای تکنودی و چندنودی گرفته تا Parameter Sharding برای اسکیل کردن با مصرف حافظه بهینه، و روشهایی برای کاهش مصرف حافظه در مدلهای بزرگ.
⚡ بخش بعدی، Inference توزیعشده و دیپلویمنت رو پوشش میده. سیستمهای High-Performance رو با استفاده از Attention بهینهشده، Caching، Operator Fusion و طراحیهای مبتنی بر Router میسازی. سیستمها رو روی Schedulerها و پلتفرمهای کانتینری با Orchestration آگاه از GPU دیپلوی میکنی و استکهای پروداکشنی میسازی که روی Reliability، مقیاسپذیری و Observability تمرکز دارن.
📊 بخش پایانی سراغ Benchmarking، تنظیم پرفورمنس و ترندهایی مثل مدلهای MoE، هماهنگی Edge-Cloud و Parallelism پیشرفته میره. هر فصل شامل کدهای تستشده و راهنمای دیباگه.
🚀 تا پایان کتاب، میتونی سیستمهای AI توزیعشدهای بسازی که از یک GPU تا کلاسترهای بزرگ اسکیل میشن.
🎯 چیزهایی که یاد میگیری
🧮 نیازهای حافظه و Compute رو برای آموزش و Inference تخمین میزنی
🖥️ سختافزار GPU، Interconnectها و استراتژیهای Parallelism رو درک میکنی
⚙️ آموزش توزیعشده رو با تکنیکهای Parallel و Sharded پیادهسازی میکنی
🚀 سیستمهای Inference آماده پروداکشن رو با Batching و مدیریت حافظه میسازی
☁️ سیستمها رو با Cluster Orchestration و زمانبندی بهینه GPU دیپلوی میکنی
🏗️ استکهای Serving آماده پروداکشن رو با Routing و Observability میسازی
📊 سیستمهای توزیعشده رو با متدولوژیهای استاندارد صنعت Benchmark میکنی
🔭 ترندهای نوظهور مدلها، استراتژیهای اسکیلینگ و مسیرهای آینده رو بررسی میکنی
👤 این کتاب برای چه کسانیه؟
👨💻 این کتاب برای مهندسهای ML، پژوهشگرهای AI و متخصصهای DevOps طراحی شده که باید مدلهای بزرگ AI رو در مقیاس بالا آموزش بدن یا Serve کنن. مهندسهای پلتفرم، ادمینهای کلاسترهای HPC و معمارهای Cloud هم میتونن برای ارتقای مهارتهاشون از این کتاب استفاده کنن.
📌 برای شروع، داشتن درک پایه از Python و PyTorch لازمه. تجربه قبلی در سیستمهای توزیعشده، Cluster Schedulerها یا Container Orchestration مفیده، اما ضروری نیست؛ چون کتاب این کانسپتها رو از پایه معرفی میکنه و از تخمین منابع، آمادهسازی داده و مبانی سختافزار شروع میشه.
📖 فهرست مطالب
فصل ۱. مقدمهای بر هوش مصنوعی توزیعشده مدرن
فصل ۲. سختافزار GPU، شبکه و استراتژیهای Parallelism
فصل ۳. آموزش توزیعشده با PyTorch DDP
فصل ۴. اسکیل کردن با Fully Sharded Data Parallel یا FSDP
فصل ۵. فراتر از State Sharding با DeepSpeed و Megatron
فصل ۶. Inference توزیعشده و vLLM
فصل ۷. بهینهسازی بین Requestها با SGLang
فصل ۸. اجرای آموزش توزیعشده با SLURM
فصل ۹. استک Serving مدلهای LLM در پروداکشن
فصل ۱۰. Benchmarking توزیعشده و بهینهسازی پرفورمنس
فصل ۱۱. چشمانداز در حال تحول هوش مصنوعی توزیعشده
فصل ۱۲. فعال کردن مزایای اختصاصی
👤 درباره نویسنده
👨💻 هنری فوهِنگ وو، Principal Machine Learning Tech Lead در سازمان Generative AI شرکت Oracle است و روی آموزش توزیعشده، Inference بزرگمقیاس و سیستمهای GPU تخصص داره. او کامپوننتهای اصلی سرویسهای Vision و Document Understanding AI در Oracle رو تحویل داده و همنویسنده یک مقاله فنی مشترک بین Microsoft و Oracle درباره Deep Learning با پرفورمنس بالا بوده.
🛠️ او در پروژههای متنبازی مثل SGLang، genai-bench، pyLLaMA، chatLLaMA و سیستم Observability شرکت Oracle با نام HiQ مشارکت داشته. هنری با تجربه عملی در PyTorch Distributed، DeepSpeed، کلاسترهای GPU مبتنی بر Kubernetes و Serving مدلهای LLM در پروداکشن، روی ساخت سیستمهای AI عملی، مقیاسپذیر و قابلاستفاده در Workloadهای واقعی Enterprise تمرکز داره.
Learn distributed AI through hands-on experience with training frameworks, inference engines, and orchestration tools to build production-ready training, inference, and serving systems for modern large-scale AI.
As AI models grow to billions and trillions of parameters, distributed systems are essential for training and serving them. Many resources cover fragments of this domain, but none provide a full path from distributed training to inference and production deployment. This book fills that gap with practical, production-focused examples.
It starts with GPU and memory estimation, data preparation, and an overview of GPU architecture, interconnects, and core parallelism strategies. You’ll learn training techniques including data parallelism for single and multi-node setups, parameter sharding for memory-efficient scaling, and methods to reduce memory usage in large models.
The next section covers distributed inference and deployment. You’ll build high-performance systems using optimized attention, caching, operator fusion, and router-based designs. You’ll deploy on schedulers and container platforms with GPU-aware orchestration and assemble production stacks emphasizing reliability, scalability, and observability.
The final section covers benchmarking, performance tuning, and trends like MoE models, edge-cloud coordination, and advanced parallelism. Each chapter includes tested code and debugging guidance.
By the end, you’ll be able to build distributed AI systems that scale from a single GPU to large clusters.
This book is designed for ML engineers, AI researchers, and DevOps professionals who need to train or serve large AI models at scale. Platform engineers, HPC cluster administrators, and cloud architects will also find it valuable for advancing their skill sets.
A basic understanding of Python and PyTorch is required to get started. Prior experience with distributed systems, cluster schedulers, or container orchestration is helpful but not necessary - the book introduces these concepts from the ground up, beginning with resource estimation, data preparation, and hardware fundamentals.
Chapter 1. Introduction to Modern Distributed AI
Chapter 2. GPU Hardware, Networking, and Parallelism Strategies
Chapter 3. Distributed Training with PyTorch DDP
Chapter 4. Scaling with Fully Sharded Data Parallel (FSDP)
Chapter 5. Beyond State Sharding with DeepSpeed and Megatron
Chapter 6. Distributed Inference and vLLM
Chapter 7. Cross-Request Optimization with SGLang
Chapter 8. Running Distributed Training with SLURM
Chapter 9. Production LLM Serving Stack
Chapter 10. Distributed Benchmarking and Performance Optimization
Chapter 11. The Evolving Landscape of Distributed AI
Chapter 12. Unlock Your Exclusive Benefits
About the Author
Henry (Fuheng) Wu is a Principal Machine Learning Tech Lead at Oracle's Generative AI organization, specializing in distributed training, large-scale inference, and GPU systems. He has delivered core components of Oracle's Vision and Document Understanding AI services, and co-authored a Microsoft and Oracle blog on high-performance deep learning. He has contributed to open-source projects including SGLang, genai-bench, pyLLaMA, chatLLaMA, and Oracle's HiQ observability system. With hands-on experience across PyTorch Distributed, DeepSpeed, Kubernetes GPU clusters, and production LLM serving, he focuses on building practical, scalable AI systems used in real-world enterprise workloads.









