Choosing between SGLang and vLLM for RL rollouts only matters once a profile shows that rollout generation, not the trainer, is eating the step. When it is, SGLang’s main draw is RadixAttention, which reuses the KV cache of a prompt shared across many sampled completions. That advantage shrinks to almost nothing when outputs are long and decoding dominates. The switch is also cheap to test. In verl, the rollout engine changes with a single configuration flag (actor_rollout_ref.rollout.name=sglang). So the honest way to settle SGLang vs vLLM is to measure it on your own rollouts rather than argue it from launch benchmarks.
TechnoLynx profiles your serving path to establish whether rollout generation is costing the wall-clock time, then ranks which serving-path levers to pull first. The work sits within TechnoLynx’s GPU performance engineering practice, and the first step is the audit on-ramp of the Inference Cost-Cut Pack.
The engine is also only one lever. Where work is placed, how far generation and training run asynchronously, and how load is balanced across rollout workers also move wall-clock time.
How Does SGLang Fit into an RL Training Loop Next to the Trainer?
An RL training loop has two phases with different demands. Generation needs low latency, and training needs high throughput. In the decoupled designs that published RL studies describe, vLLM produces rollouts and Megatron handles training; SGLang can fill that same generation role. It has a frontend language and a runtime that speeds up execution through RadixAttention for KV cache reuse and compressed finite state machines for faster structured-output decoding. The trainer computes the gradient updates. SGLang’s job is to turn the current policy weights into sampled rollouts.
The RL-specific features SGLang exposes cover the handoffs between those two roles:
- Sleep/wake. This releases the KV cache and weights while keeping the server process alive. A co-located setup can then resume rollout without repeated disk I/O or CUDA graph recapture on each step.
- Pause/resume. Slow, long-tail requests can be parked and continued later, so a few stragglers do not stall every GPU.
- The SGLang Model Gateway. It dispatches individual turns of a multi-turn rollout across servers, which balances uneven sequence lengths.
Running two separate engines brings a numerical problem of its own. Rollout and training use different kernels and batching, so token probabilities can drift even when the weights are identical. That silently breaks the on-policy assumption. In lower precision, extra quantisation and dequantisation logic makes these numerical differences grow cumulatively. The authors of one hundred-billion-scale MoE study report that the mismatch between a vLLM rollout and a Megatron trainer occasionally led to catastrophic RL collapse.
SGLang offers a deterministic inference mode that reduces non-determinism across batch shapes. The SGLang documentation is explicit that truly on-policy training also requires the training engine to use the same deterministic kernels. The GLM-5 team (2026) found that replacing a non-deterministic CUDA top-k in SGLang’s DSA indexer with plain torch.topk ran slightly slower but gave substantial RL gains. For MoE models there is one more source of drift. Inference and training frameworks each implement the router themselves, and rounding differences in the gating function can pick different experts for the same input.
Disaggregated designs also put inference and training on separate GPU pools, with the inference pool running vLLM or SGLang continuously. That topology choice belongs to the pipeline design rather than to the engine choice, so we leave it to the slime restructuring discussion.
How Do I Tell Whether Rollout Generation, Not the Trainer, Is My RL Bottleneck?
Time each stage of one RL step separately: generation, reward computation, reference and log-prob passes, actor update and weight sync. Then read which one dominates, and do this before changing anything. In the published profiles below, generation dominates. CompassMax-V3-Thinking was trained on 256 H100s with 1k-token inputs, 32k-token outputs, batch size 512 and n = 8, and its profile showed rollout taking the majority of runtime, followed by actor update and reward computation. The Seer authors (2025) likewise describe rollout as the phase that dominates end-to-end iteration time in synchronous RL systems. Hugging Face’s 2025 survey of 16 RL libraries gives a sense of scale: a single batch of 32K-token rollouts on a 32B model can take hours while the training GPUs sit idle.
These profiles do not prove your pipeline behaves the same way; profile your own run before optimising. Whether a lever pays off depends on context that only a profile of your own run supplies.
In verl, the built-in profiler system makes this concrete. You select which steps to profile with global_profiler.steps. Role-level profiling follows the nsys pattern, and selecting the torch_memory tool adds CUDA memory snapshots, including best-effort dumps on out-of-memory errors. Rollout, reference and reward roles follow the actor’s profiler configuration by default. For kernel-level reading of the generation phase itself, our guide to profiling GPU kernels for occupancy and bandwidth covers the next layer down.
Diagnostic Checklist: Is the Engine the Constraint?
Once generation clearly dominates the step, it is worth checking what inside generation costs the time, because several of the fixes have nothing to do with the engine:
- Prefix cache hit rate. SGLang defines it as cached prompt tokens divided by prompt tokens, and the order in which queued requests run affects it.
- Effective decode batch size. If GPU cache utilisation in the logs is low, the verl tuning guide suggests raising
max_num_seqsormax_num_batched_tokensto allow more concurrent requests per batch. - Long-tail completion. A few slow samples can stall the whole batch, and that long-tail behaviour also makes profiling and monitoring harder. In the MoE study’s internal benchmarks, length-based load balancing raised rollout speed by about 8% and cut the GPU idle ratio by more than 12%.
- CPU-side work. LMSYS (2024) states that an unoptimised inference engine can spend as much as half its time on CPU overhead such as batch scheduling, memory allocation and prefix matching. In reasoning rollouts with large group sizes, detokenisation alone can account for 20–30% of total pipeline latency.
- Reward stage overlap. Starting reward computation as each response finishes, instead of after the whole batch, cut reward-stage time by about 85% in the same study.
If items 3 to 5 dominate, switching engines is the wrong first lever. The fix is in scheduling and pipeline structure.
RadixAttention: Why Many Samples per Prompt Suit It, and Where the Reuse Runs Out
The KV cache depends only on the tokens before it, so sequences with the same prefix can reuse the prefix’s cached keys and values instead of recomputing them. In the engines the SGLang paper compared against, a request’s KV cache was discarded once it finished. RadixAttention instead keeps the KV cache of all requests in a radix tree under LRU eviction, and pairs it with a cache-aware scheduler. On the SGLang paper’s benchmarks, cache hit rates ranged from 50% to 99%, and the scheduler reached on average 96% of the optimal hit rate. When nothing can be reused, the cost is small: the radix tree used 0.2 seconds of a 74.3-second ShareGPT run, under 0.3%.
RL sampling fits this pattern well. GRPO-style algorithms typically draw groups of 8 to 32 completions per prompt. Agent loops resend a growing transcript at every turn, so almost every request reuses a long prefix. SGLang’s HiCache extends the cache beyond GPU memory, using host memory as a second tier and distributed storage as a third. HiCache’s documentation adds that larger caches give diminishing returns once the hot tokens are already cached.
The catch is in what gets shared. In a single-turn reasoning rollout, the group shares the prompt, and in the CompassMax configuration the output (32k tokens) is far longer than the input (1k tokens). The SGLang paper itself states that KV cache reuse mostly reduces prefix time, so when decoding time dominates there is almost no speedup. Multi-turn agentic rollouts, where whole transcripts repeat, are the case where prefix reuse earns the most.
vLLM also caches prefixes, so this is not a choice between caching and no caching. vLLM’s automatic prefix caching hashes each KV block by its own tokens and the tokens before it, and reuses only blocks that match completely. A partly matching block is recomputed. The SGLang paper’s statement that vLLM did not cover multi-level tree-structured sharing comes from work whose vLLM baseline was v0.2.5. It should be read as a statement about that release, not about vLLM today.
Both engines’ implicit, LRU-based caches also have limits in large batches. The BatchLLM authors measured a shared prefix of 16,000 tokens with a share degree of 16. The token reuse ratio was 6.3% for vLLM and 5.2% for SGLang, against 92.6% for BatchLLM’s explicit, ahead-of-time prefix identification. Their explanation is that an LRU cache can evict KV contexts just before they would be reused, while keeping unused ones for a long time. BatchLLM’s authors also note that its own gains are limited to token batching when prompts share no common prefixes.
Across data-parallel workers, routing decides how much reuse survives. SGLang v0.4’s cache-aware load balancer reported up to 1.9x throughput and a 3.8x higher hit rate. LMSYS measured this on a workload of long prefix groups that were perfectly balanced, and says results vary with workload characteristics. GLM-5 solved the same problem by pinning each rollout ID to one DP rank with consistent hashing.
How Does SGLang’s Continuous Batching Raise Rollout Throughput Without Changing the Model?
Continuous batching schedules work one iteration at a time. When one sequence finishes, a new one takes its slot straight away instead of waiting for the whole batch to drain, and that keeps the GPU busier than static batching. This matters because LLM decoding is limited by memory bandwidth, so throughput depends largely on how big a batch fits in GPU memory. In Anyscale’s 2023 measurements, continuous batching gave 8x the throughput of naive batching, and Anyscale expected the advantage to grow as sequence lengths vary more within a batch. RL rollouts show that spread, with completion times uneven across workers within one step.
Continuous batching is not unique to SGLang. vLLM was the strongest system in the Anyscale tests, and Anyscale attributed that to vLLM allocating KV memory dynamically rather than ahead of time. What SGLang adds is a scheduler that runs one batch ahead of the GPU, so CPU work such as radix cache operations overlaps with computation. LMSYS reports a 1.1x throughput gain from this, measured by the SGLang team on its own benchmark. RadixAttention is designed to work alongside continuous batching and paged attention.
Two limits are worth keeping in view. Continuous batching is still capped by available GPU memory. Memory settings also do not carry over between engines. In SGLang, gpu_memory_utilization is the share of free memory used for weights and KV cache, and verl’s guide says a value tuned for one engine can cause out-of-memory errors in another.
The second limit is that higher aggregate throughput does not fix a synchronous step that waits for its slowest sample. The GLM-5 report argues that for rollouts the real target is end-to-end latency, set by the long tail. Seer, a separate synchronous RL system, reported cutting long-tail latency by 72–94% through load balancing, context-aware scheduling and speculative decoding.
Prefill/decode disaggregation is the other SGLang tool aimed at that tail. In a single engine, incoming prefill batches interrupt ongoing decodes. Running prefill and decode on separate instances removes that interference. SGLang’s own documentation warns that related allocation policies are not a general throughput improvement and should be compared on your workload. The hub article on restructuring RL pipelines around slime covers how that fits into the wider system design.
How Does SGLang Compare with vLLM and Other Inference Runtimes as the Rollout Engine for RL Workloads?
Read the headline speedups as figures from SGLang’s own authors. The SGLang paper reports up to 6.4x higher throughput than existing systems including vLLM v0.2.5. The often-quoted “5x over vLLM” comes from the SGLang authors’ January 2024 launch post. It was measured on chained tasks with heavy prefix sharing, so read it as the upper bound for prefix-heavy work.
On features, the two are close. The verl documentation states that SGLang as a rollout engine provides the same feature coverage as vLLM, including memory saving and multi-node rollout. vLLM documents its own RLHF path, with pluggable weight transfer over NCCL and IPC and a pause/resume API for updating weights mid-flight. Where they differ is in ecosystem detail. slime integrates SGLang exclusively. At the time of the 2025 Hugging Face survey, vLLM already served per-expert LoRA on MoE models, while SGLang support was still an open PR. verl also supports TensorRT-LLM as a rollout backend, so the runtime question is wider than two engines.
Decision Table: What Decides the Rollout Engine
| Your rollout workload | Leaning | Why |
|---|---|---|
| Multi-turn agentic rollouts resending long transcripts | Try SGLang first | Long shared prefixes on almost every request are where RadixAttention reuse pays |
| Single-turn reasoning, short prompt, very long outputs | Expect little RadixAttention gain; choose on integration | Decoding dominates and KV reuse gives almost no speedup |
| Framework built around one engine (slime) | Use that engine | slime integrates SGLang exclusively and passes SGLang parameters through |
| verl pipeline, undecided | A/B both on the same step | The engine switches with one flag |
| MoE with LoRA and expert-parallel adapters | Check current LoRA support per engine | Support differed between engines as of 2025 |
How Are Updated Policy Weights Pushed into a Running SGLang Engine, and What Does It Cost?
After each training step, SGLang can refit the rollout engine in three ways:
- From disk. The engine loads a saved checkpoint. This trades I/O overhead for simplicity, and new rollout instances can join by pointing at the same checkpoint.
- From tensor. This suits co-located setups that pass in-memory tensors. The model must stay on the GPU, and co-location may limit some MoE and attention-kernel optimisations.
- From distributed. Training workers broadcast over NCCL or InfiniBand to a dedicated communication group. This avoids disk I/O, at the cost of managing that group.
The cost is real, because a synchronous transfer halts the whole run: neither trainer nor inference makes progress while weights move. SGLang’s peer-to-peer RDMA weight update cut the transfer for the 1T-parameter Kimi-K2 from 53 seconds to 7.2 seconds. The price is one extra inference-engine replica (32G) in CPU memory per training rank. Its authors add that the gain shows mainly on large MoE models with high expert parallelism. At small expert-parallel sizes, loading tensors onto the CPU replica costs more than P2P saves.
Several factors change this picture:
- LoRA. With adapter-only sync, the Hugging Face survey estimates that a rank-32 adapter is about 50 MB and transfers in under a millisecond, compared with roughly 100–500 ms to broadcast a full 7B+ model over NCCL.
- Disaggregated pools. An atomic swap pauses generation for at most one forward-pass gap of a few milliseconds. Slower sync does not stall inference outright, but it leaves inference running on stale weights for longer.
- FP8 KV cache. In NVIDIA’s NeMo RL, using FP8 for the KV cache adds a per-step recalibration of the query, key and value scales, about 2–3% of total step time.
On the vLLM side, the survey points to the packed, bucketed NCCL broadcast in vLLM’s weight transfer engine as a large sync speedup. So weight sync, too, is a question of topology and transport more than of engine brand.
What Gain to Expect, and How to Measure It
Measure against these numbers:
- rollout tokens per second at a fixed GPU count
- end-to-end iteration wall-clock time
- GPU idle ratio during generation
- cost per rollout
Do not rely on a microbenchmark. Cost per rollout is the RL version of a load-aware cost-per-request model, and it keeps the comparison honest when GPU counts change.
Rollout studies report how large other levers can be. In one MoE RL study, FP8-quantised rollout cut rollout time by 30% at 32k-token generation and total training time by nearly 20%. In NeMo RL, FP8 for linear layers, the KV cache and attention together gave about a 48% speedup over BF16. None of those gains required switching engines. If you A/B SGLang against vLLM, tune memory settings per engine.
When Switching to SGLang Is Not Worth It
Switching is unlikely to pay when:
- Prompts share little prefix. KV cache reuse depends on shared prompt prefixes, so there is little to reuse.
- Outputs are long and decoding dominates. This is the paper’s own “almost no speedup” case.
- The profile points elsewhere. If time goes to reward computation, detokenisation, long-tail stragglers or weight sync, a faster engine leaves the bottleneck where it is.
- Migration means a new source of drift. A new engine brings different kernels and batching, so the probabilities the trainer sees change. The train–inference mismatch needs re-checking against the trainer.
- Your framework is built around vLLM features you depend on. MoE LoRA serving, as of the 2025 survey, is one example.
Who a Rollout-Path Audit Suits, and Who It Does Not
A TechnoLynx audit of the rollout path suits teams that want to cut inference cost and latency on the RL workload they actually run. It suits teams still choosing an RL algorithm or reward design less well, because that research question comes before serving-path tuning. A team with in-house inference engineers and time to run an A/B in verl can often settle the engine question itself, using the checklist above.
Restructure First, Then Pick the Engine
Several RL speedups in the sources come from changing what the pipeline does rather than how fast one engine runs: overlapping reward with rollout, balancing by predicted length, scheduling around the long tail, decoupling generation from training. That matches how we approach performance work generally, asking what can be restructured before tuning how it is computed. Once that work is done (the account of slime and algorithmic restructuring for GPU RL training covers it), the engine question becomes narrower. The open question is how much of your rollout is shared prefix and how much is unique decode, since that decides the gain.