Awesome-ML-SYS-Tutorial
My learning notes for ML SYS.
I’ve been writing this blog series intermittently for over a year now, and it’s almost become an RL Infra Learning Note 😂
I often see discussions about whether ML SYS or AI Infra is worth getting into, and how to start. Everyone’s choice is different. For me, I simply want to pursue the truth in algorithms:
A large number of RL conclusions derived from papers are based on RL infrastructure in the open-source community that may be extremely flawed. I’ve been involved in RL infra development for over a year, and I’ve seen numerous community experts diligently working, but the fact is that RL infra, whether open-source or within major companies, still has many problems. It is absolutely worth questioning whether the high-level conclusions drawn from this flawed infrastructure are correct. When I was reviewing for ICLR this year, I often asked the papers assigned to me, “If the framework you are using has implementation issues itself, can your conclusions still hold?” Although I never deducted points for this reason, no one could provide an answer that resolved my fundamental doubt.
Therefore, some excellent researchers I know are keen to participate in infra development, spending most of their time on foundational work to rigorously ensure that the algorithm they plan to develop next has a correct basis. I greatly admire them and agree with such rigor—they are my role models. The same is true for our SGLang RL community. With so much human power and time, we all hope to provide the most correct and concise RL foundation possible, whether it’s for companies training models or researchers developing new algorithms, with the goal of genuinely serving everyone in the community. Thank you for your recognition, and I look forward to hearing from interested friends who wish to contact me and join us!
After a year of going around in circles, this is the resolve that keeps me going in Infra: to make a contribution to the community by building a correct foundation, thereby helping to ensure correct conclusions.
Coming back to the topic, this series of podcasts started in August 2024, when I began learning ML SYS notes following the opportunity to use SGLang during my research. It’s largely written by me, with content focusing on RL infra, online/offline inference systems, and some fundamentals of AI Infra. Over the past year, starting from two or three articles and thirty to fifty Github Stars, to now exceeding 4.5K Stars, I have become a minor technical influencer. I am deeply honored and grateful for the support.
I would like to thank my advisors, Professor Quanquan Gu, Dr. Ying Sheng, and Dr. Linmin Zheng, for the immense help and guidance they gave me in my study of AI Infra, career choices, and life path. Although I am no longer pursuing a Ph.D. at UCLA due to personal reasons, this journey after my undergraduate graduation has been an incredibly valuable experience. I have now joined RadixArk full-time, continuing my research in RL Infra. We will continue to share AI Infra-related technology and thoughts through my blog, via unofficial channels. I also hope readers interested in AI Infra reach out to us, join the SGLang open-source community, and together build open-source AI Infra that changes the world and is worth being proud of for a lifetime!
Omni Model Inference Notes
- Codec、RVQ、Dual AR、Thinker-Talker——A Deep Dive into Omni Model Inference for Qwen3-Omni and S2 Pro: available in Chinese version and Zhihu.
- When SGLang OOMs, What Exactly Runs Out of Memory?: available in Chinese version and Zhihu.
- SGLang Omni: Redesigning the Inference Framework for Multi-Stage Generative Models from Decoding Computation Characteristics: why multi-stage decoding is the right axis to slice the model landscape, what computational characteristics multi-stage decoding models share, and how SGLang Omni’s scheduling decoupling / layered communication / memory isolation map to these characteristics. Available in Chinese version and Zhihu.
- Optimizing TTS Inference: Engineering Lessons from Profiling to Streaming in SGLang Omni: how we made Higgs and MOSS-TTS-Local TTS serving 1.9–3.4× faster on SGLang-Omni — encoder LRU caching, delay-pattern / backbone+inner codec scheduling, CUDA Graph + async CPU–GPU decode, and vocoder batching / windowed streaming. Available in Chinese version and Zhihu.
- Lifecycle Management and Framework Abstractions: Refactoring TTS Serving in SGLang Omni: how six architecturally different TTS backends were refactored around shared contracts for engine startup, state transport, caching, vocoder lifecycles, and scheduling; and how the refactor removed a net 2,840 non-test lines while simplifying new-model onboarding. Available in Chinese version.
- Revisiting CPU Resources as a First-Class Citizen in Speech Model Serving: how a 4x cross-run throughput swing in CI traced back to host CPU contention rather than any code change; PSI vs per-request CPU-ms tells cycle inflation from SMT siblings apart from run-queue queueing, and a topology-aware CPU allocator retains 92-100% of clean throughput under heavy contention while yielding essentially nothing on an uncontended production box. Available in Chinese version.
- A Batch Size Debate: Performance Validation and Scheduling Trade-offs in SGLang Omni: controlled MiniCPM-o Code2Wav experiments on collection policies, batch limits, and early result emission; why reducing local waiting can hurt end-to-end performance, and how CPU controls, repeated runs, and quality gates guide default settings. Available in Chinese version and Zhihu.
RLHF System Development Notes
slime Framework
- One Rollout to Rule Them All: Seamless Multi-Turn RL for LLM and VLM: Introduces the seamless multi-turn RL for LLM and VLM, including the technical details and the implementation of the seamless multi-turn RL for LLM and VLM. Also available in Chinese version and Zhihu.
- Squeezing 1TB Model Rollout into a Single H200: INT4 QAT RL End-to-End Practice: Introduces the INT4 QAT RL end-to-end practice, including the technical details and the implementation of the INT4 QAT RL end-to-end practice. Also available in Chinese version and Zhihu.
- 【Not finished】Let Speed Be With Stability: All-In-One Solution to Training-Inference Mismatch with Miles: Introduces two solutions provided by the Miles framework for the train-inference mismatch problem: achieving perfect True On-Policy training through kernel-level alignment, and mitigating the mismatch using algorithms like TIS/MIS. Also available in Chinese version.
- Support FSDP2 as A Training Backend for slime: Added FSDP as a training backend to slime, and aligned it with Megatron. FSDP is more flexible in supporting models with architectural innovations like Qwen3-Next/gpt-oss and helps us further support VLM RL. Also available in Chinese version and on Zhihu.
- Unified FP8: Moving Beyond Mixed Precision for Stable and Accelerated MoE RL: Fully utilizing FP8 for both sampling (Rollout) and training (Training) in RL. Also available in Chinese version and on Zhihu.
- Power Up Speculative Decoding In Reinforcement Learning: Introduces speculative decoding into the RL sampling process, significantly boosting sampling speed when the batch size is appropriate; moreover, the draft model is updated during training. Compared to freezing the draft model, the accepted length remains consistently high, yielding long-term stable positive returns. Also available in Chinese version.
- An In-Depth Look at the Elegant Design and Source Code of the slime RL Framework: slime source code appreciation. Also available on Zhihu and in Chinese version.
- [Pending Review] slime FSDP Setup Guide: Records how to test FSDP on slime, including H-cards and B-cards, and both Colocate and Disaggregated placement methods.
- [Pending Review] Chunked Parallel Computation of GAE in PPO (slime Implementation): Rewrites the standard backward recurrence of GAE into chunk-based parallel prefix scanning, significantly mitigating the GAE computation bottleneck in long sequence scenarios, achieving about $100\times–300\times$ acceleration in slime. Also available on Zhihu.
AReal Framework
System Design and Optimization
verl Framework
OpenRLHF Framework
Algorithms and Theory
SGLang Learning Notes
SGLang Diffusion Learning Notes
Core Architecture and Optimization
- Walk Through SGLang Scheduler
- [Pending Review] KV Cache Code Walkthrough: Overview of KV cache management implementation, starting from the Scheduler component, detailing the update process of KV cache and memory pool during prefill and decode stages.
- [Pending Review] SGLang Multimodal Request Lifecycle: A Deep Architectural Analysis with Qwen2.5-VL as an Example: Provides a detailed analysis of the multimodal request processing flow within the SGLang framework, using Qwen2.5-VL as a reference model.
- [Pending Review] How A Model is Loaded in Hugging Face and SGLang: Documents the process of loading models in Hugging Face and SGLang to help understand the weight loading mechanism.
- [Pending Review] Speculative Decoding: Introduces the speculative decoding optimization technique, which uses a smaller draft model to predict the next $K$ tokens, achieving up to $K$-fold acceleration.
- [Pending Review] Zero-Overhead Batch Scheduler: Introduces the zero-overhead batch scheduler, which solves the GPU Bubble problem caused by serial execution of CPU scheduling and GPU computation in traditional inference systems.
- [Pending Review] Data Parallelism Attention: Detailed introduction to the principles and implementation of DP Attention, specifically for models like DeepSeek that use MLA and only have one KV head, to avoid KV cache duplication caused by tensor parallelism.
- Brief Analysis of SGLang Framework’s Quantization Design and Ideas: Also available on Zhihu: Brief Analysis of SGLang Framework’s Quantization Design and Ideas and in Chinese version.
- Constraint Decoding: Concepts, Methods, and Optimization: Also available on Zhihu: Understanding Constraint Decoding: Concepts, Methods, and Optimization in one article.
- [Pending Review] Online Update Weights: Introduction to the implementation of the
online_update_weights interface in SGLang. Unlike update_weights which reads weights from the disk, this interface broadcasts new weights directly from the training engine via NCCL.
- [Pending Review] SGLang Verl Engine Optimization Analysis: Analysis of optimizations in the SGLang verl engine, including the implementation of interfaces like
update_weights_from_tensor.
- Latency Accelerate For Weight Updates
Usage and Practice
Scheduling and Routing
ML System Fundamentals
CUDA & GPU
Distributed Training & Communication
Quantization
Developer Guide
评论