Intro At my previous job I ran into a problem: our JAX trainer in an RL job would OOM after running for a while, which is pretty rare. Most of my OOM debugging experience came from Torch, where there are basically two moves: The careful way: use the Torch Memory Visualizer to break down where memory goes and optimize from there. Often it’s just a tensor you forgot to free, or an allocation that…
Authored by Biao He Zilin Zhu Ji Li 1. What is slime? slime is a LLM post-training framework aiming for RL Scaling, it was designed to be: Versatile – with a fully customizable rollout interface and flexible training setups (colocated or decoupled, synchronous or asynchronous, RL or SFT cold start). Performant - integrating SGLang for inference and Megatron-LM for training, natively. Maintainable…
Authored by Biao He Ata Fatahi 1. Introduction Reinforcement learning (RL) for large language models (LLMs) presents unique challenges due to its integration of inference and training in each step, demanding significant scalability and resource efficiency. The verl library, designed for RL training of LLMs, combines advanced training strategies like Fully Sharded Data Parallel ( FSDP ) and…
Authored by Biao He Qingquan Song 0x0. Introduction In the past few weeks, we’ve implemented the Flash Attention Backend end-to-end in SGLang, which is now the default attention backend as of SGLang 0.4.6 release . Throughout this journey, we learned a lot about how Attention Backend functions in modern LLM serving engines and developed a deeper understanding of Flash Attention itself. In this…
Introduction Flash Attention 1 is an IO-aware exact attention algorithm that uses tiling to reduce the number of memory reads/writes between GPU high bandwidth memory (HBM) and GPU on-chip SRAM. It has been widely used in LLM inference and training, and is the default attention backend in modern serving engines like SGLang, vLLM, etc. Naive Attention Calculation Before we figure out how Flash…
Authored by Binyao Jiang This guide explains how to calculate the parameter size of a Mixture of Experts (MoE) large language model (LLM) using its architecture and configuration file. We’ll use the Qwen3-30B-A3B model as an example to demonstrate the process. 1. Understand the Model Architecture To calculate a model’s parameter size, you first need to understand its architecture. Initially, I…
This guide explains how to calculate the parameter size of a dense large language model (LLM) using its architecture and configuration file. We’ll use the Qwen3-32B model as an example to demonstrate the process. 1. Understand the Model Architecture To calculate a model’s parameter size, you first need to understand its architecture. Initially, I considered technical reports as a primary source,…
Knowledge distillation is a model compression technique whereby a small network (student) is taught by a larger trained neural network (teacher). I. What is model distillation? Model distillation is a technique used to transfer knowledge from a larger, more complex model (the “teacher” model ) to a smaller, simpler model (the “student” model ) in order to improve the performance of the smaller…
NOTE: This markdown cheatsheet is a typography demo for this theme. Check out this post to learn more about this markdown usage when you want to get started with this theme. Enjoy! Typography Elements in One Let’s start with a informative paragraph. This text is bolded. But not this one! How about italic text? Cool right? Ok, let’s combine them together. Yeah, that’s right! I have code to…