SGLang v0.4.0stable Released Dec 04, 2024
Impact Score: 9/10

SGLang: Release v0.4.0

Source available - automated, not human-reviewed

Component: sglang · Channel: stable. Automated analysis, not a compatibility certification. How this works.

Analysis updated: 2026-11-26.

Automated impact estimate - compatibility not verified
$ python -m pip install 'sglang==0.4.0'
📄 .MD
⚡ Executive Summary (TL;DR)

SGLang v0.4 introduces major architectural performance improvements, including a zero-overhead batch scheduler, cache-aware load balancer, and data parallelism attention for DeepSeek models. These enhancements collectively deliver significant throughput gains and up to 10x faster structured outputs using xgrammar.

Who Does This Impact? (Role-Based Analysis)

💻 Software Engineers & Devs

Leverage new support for xgrammar for fast structured outputs, LoRA in the Completion API, GGUF format support, and input embeds.

📊 Product & Engineering Leads

Deploy DeepSeek models more efficiently and offer customers faster structured outputs with up to 1.9x decoding throughput improvements.

⚙️ DevOps & Security

Benefit from a cache-aware load balancing router, initial Intel Gaudi accelerator support, and optimized AMD GPU configurations.

✨ New Features & Capabilities (9)

  • Zero-overhead batch scheduler
  • Cache-aware load-balancing router v1
  • Data parallelism attention for DeepSeek models
  • Fast structured outputs with xgrammar (up to 10x faster)
  • Initial support for Intel Gaudi accelerators
  • Simple CPU offloading support
  • Support for GGUF format
  • Support LoRA in Completion API
  • Online weight updates from torch.distributed

⚡ Performance & Enhancements (5)

  • Up to 1.1x increase in throughput via zero-overhead batch scheduler
  • Up to 1.9x increase in throughput with 3.8x higher cache hit rate via cache-aware load balancer
  • Up to 1.9x decoding throughput improvement for DeepSeek models
  • Merged three native APIs into one: get_server_info
  • Support session control for vision language models

🔧 Bug Fixes & Patches (4)

  • Fix mixed chunked prefill in overlap mode
  • Fix memory leak during abort
  • Fix hash collision for multi modal models
  • Fix gptq for moe layers

❓ Frequently Asked Questions

Does SGLang v0.4.0 contain breaking changes?

No explicit breaking changes or migration requirements are documented in the release notes.

What is the primary highlight of v0.4.0?

The primary highlights include substantial throughput increases driven by a zero-overhead batch scheduler, a cache-aware load balancer, data parallelism for DeepSeek models, and up to 10x faster structured outputs using xgrammar.

How should teams prepare to upgrade to v0.4.0?

Teams should review dependency updates like xgrammar and sglang-router, test new routing behaviors, and evaluate performance improvements on their specific accelerator hardware (such as NVIDIA, AMD, or Intel Gaudi).

📄 View Raw Release Notes (Original Developer Log)
## Highlights blog: https://lmsys.org/blog/2024-12-04-sglang-v0-4/ We’re excited to release SGLang v0.4, featuring significant performance improvements and new features: - Zero-overhead batch scheduler: 1.1x increase in throughput. - Cache-aware load balancer: up to 1.9x increase in throughput with 3.8x higher cache hit rate. - Data parallelism attention for DeepSeek models: up to 1.9x decoding throughput improvement. - Fast structured outputs with xgrammar: up to 10x faster. ## What's Changed * fix: add xgrammar dependency by @zhyncs in https://github.com/sgl-project/sglang/pull/2126 * docs: fix module docstrings and copyright headers by @XuehaiPan in https://github.com/sgl-project/sglang/pull/2077 * feat(pre-commit): trim unnecessary notebook metadata from git history by @XuehaiPan in https://github.com/sgl-project/sglang/pull/2127 * Expose max total num tokens from Runtime & Engine API by @henryhmko in https://github.com/sgl-project/sglang/pull/2092 * Only stream output on tp rank 0 by @merrymercy in https://github.com/sgl-project/sglang/pull/2124 * Revert "Only stream output on tp rank 0" by @merrymercy in https://github.com/sgl-project/sglang/pull/2130 * Add initial support for intel Gaudi accelerators by @ankurneog in https://github.com/sgl-project/sglang/pull/2121 * Add simple CPU offloading support. by @janimo in https://github.com/sgl-project/sglang/pull/2081 * Fix grid size in Triton decoding kernel by @ispobock in https://github.com/sgl-project/sglang/pull/2134 * [CI] Fix test cases by @merrymercy in https://github.com/sgl-project/sglang/pull/2137 * Add concurrency option for benchmark by @cermeng in https://github.com/sgl-project/sglang/pull/2136 * Fix dp print message by @merrymercy in https://github.com/sgl-project/sglang/pull/2138 * fix: resolve bench_serving args by @zhyncs in https://github.com/sgl-project/sglang/pull/2139 * [router] cache-aware load-balancing router v1 by @ByronHsu in https://github.com/sgl-project/sglang/pull/2114 * Bump sglang-router to 0.0.5 by @ByronHsu in https://github.com/sgl-project/sglang/pull/2142 * update router doc by @ByronHsu in https://github.com/sgl-project/sglang/pull/2143 * fix dp_rank env by @ByronHsu in https://github.com/sgl-project/sglang/pull/2144 * Add more api routes (completion, health, etc) to the router by @ByronHsu in https://github.com/sgl-project/sglang/pull/2146 * add prefix match for certain tenant by @ByronHsu in https://github.com/sgl-project/sglang/pull/2147 * Improve sglang router by @ByronHsu in https://github.com/sgl-project/sglang/pull/2148 * Merged three native APIs into one: get_server_info by @henryhmko in https://github.com/sgl-project/sglang/pull/2152 * feat: remove the dependency on FusedMoE by @zhyncs in https://github.com/sgl-project/sglang/pull/2153 * feat: update gitignore and add tuning config for FusedMoE by @zhyncs in https://github.com/sgl-project/sglang/pull/2155 * fix: resolve end-of-file-fixer by @zhyncs in https://github.com/sgl-project/sglang/pull/2157 * Simplify `Scheduler.update_running_batch` by @merrymercy in https://github.com/sgl-project/sglang/pull/2154 * feat: update other MoE models deps by @zhyncs in https://github.com/sgl-project/sglang/pull/2156 * Update CI threshold & Improve code style by @merrymercy in https://github.com/sgl-project/sglang/pull/2159 * fix: use torch.sum for compatible by @zhyncs in https://github.com/sgl-project/sglang/pull/2161 * Fix mixed chunked prefill in overlap mode by @merrymercy in https://github.com/sgl-project/sglang/pull/2158 * Balance CI tests by @merrymercy in https://github.com/sgl-project/sglang/pull/2162 * Rename triton_fused_moe -> fused_moe_triton by @merrymercy in https://github.com/sgl-project/sglang/pull/2163 * Fix docs by @merrymercy in https://github.com/sgl-project/sglang/pull/2164 * [Fused moe] add tuning fused configs for qwen2 57b and mixtral 8x7b by @BBuf in https://github.com/sgl-project/sglang/pull/2167 * Allow overwrite flashinfer use_tensorcore by @merrymercy in https://github.com/sgl-project/sglang/pull/2169 * Replace prob based with threshold based load balancing by @ByronHsu in https://github.com/sgl-project/sglang/pull/2170 * feat: fused_moe fp8 monkey patch by @zhyncs in https://github.com/sgl-project/sglang/pull/2174 * [Fix] Avoid calling fill_vocab_mask for terminated requests by @Ubospica in https://github.com/sgl-project/sglang/pull/2175 * [CI] Split test cases in CI for better load balancing by @merrymercy in https://github.com/sgl-project/sglang/pull/2180 * Bump rustls from 0.23.16 to 0.23.18 in /rust by @dependabot in https://github.com/sgl-project/sglang/pull/2182 * [feat] Refactor session control interface and add CI by @Ying1123 in https://github.com/sgl-project/sglang/pull/2173 * [router] Replace print with logger by @ByronHsu in https://github.com/sgl-project/sglang/pull/2183 * Use custom allreduce w/ torch.compile by @merrymercy in https://github.com/sgl-project/sglang/pull/2185 * [Performance]: Process affinity to CPU cores with multiple sockets support by @HaiShaw in https://github.com/sgl-project/sglang/pull/2171 * Update CI threshold by @merrymercy in https://github.com/sgl-project/sglang/pull/2186 * Update XGrammar to the latest API by @Ubospica in https://github.com/sgl-project/sglang/pull/2176 * [router] Rust e2e test by @ByronHsu in https://github.com/sgl-project/sglang/pull/2184 * Input_embeds support by @RinRin-32 in https://github.com/sgl-project/sglang/pull/2052 * [CI] Minor fix for CI by @merrymercy in https://github.com/sgl-project/sglang/pull/2187 * Rename double sparsity config file by @merrymercy in https://github.com/sgl-project/sglang/pull/2188 * Release v0.3.6.post1 by @merrymercy in https://github.com/sgl-project/sglang/pull/2189 * Update sampler.py to skip the success check by @merrymercy in https://github.com/sgl-project/sglang/pull/2197 * remove unused imports by @WrRan in https://github.com/sgl-project/sglang/pull/2195 * Remove unresolved reference 'self' by @apemost in https://github.com/sgl-project/sglang/pull/2198 * using `is not` not `!=` to test `None` by @WrRan in https://github.com/sgl-project/sglang/pull/2196 * fix: add cuda-python for xgrammar by @zhyncs in https://github.com/sgl-project/sglang/pull/2199 * minor: update check_env by @zhyncs in https://github.com/sgl-project/sglang/pull/2201 * add sglang version to get_server_info by @binarycrayon in https://github.com/sgl-project/sglang/pull/2206 * docs: update adoption by @zhyncs in https://github.com/sgl-project/sglang/pull/2204 * Bump router to 0.0.9 with better logging by @ByronHsu in https://github.com/sgl-project/sglang/pull/2207 * Fix rust warning by @ByronHsu in https://github.com/sgl-project/sglang/pull/2208 * Fix flasky tests by @merrymercy in https://github.com/sgl-project/sglang/pull/2212 * [feat] Support session control for vision language models by @Ying1123 in https://github.com/sgl-project/sglang/pull/2210 * Use an env var SGLANG_SET_CPU_AFFINITY to set cpu affinity; turn it off by default by @merrymercy in https://github.com/sgl-project/sglang/pull/2217 * Revert "Use an env var SGLANG_SET_CPU_AFFINITY to set cpu affinity; turn it off by default" by @merrymercy in https://github.com/sgl-project/sglang/pull/2221 * Use an env var SGLANG_SET_CPU_AFFINITY to set cpu affinity; turn it off by default by @merrymercy in https://github.com/sgl-project/sglang/pull/2222 * Release v0.3.6.post2 by @merrymercy in https://github.com/sgl-project/sglang/pull/2214 * Rename DP_RANK to SGLANG_DP_RANK by @merrymercy in https://github.com/sgl-project/sglang/pull/2218 * [3rdparty, document] Updated Documentation that for triton fused_moe kernel tuning for AMD Instinct GPUs by @kkHuang-amd in https://github.com/sgl-project/sglang/pull/2191 * Bump sglang-router to 0.0.10 for env name change by @ByronHsu in https://github.com/sgl-project/sglang/pull/2226 * fix typo prompts by @qibaoyuan in https://github.com/sgl-project/sglang/pull/2224 * Remove fused_moe_grok by @merrymercy in https://github.com/sgl-project/sglang/pull/2223 * add profile in offline benchmark & update doc by @bjmsong in https://github.com/sgl-project/sglang/pull/2123 * Rename tuned MI300X config files for fused_moe_triton by @HaiShaw in https://github.com/sgl-project/sglang/pull/2228 * Update Install Method 2. From source by @HaiShaw in https://github.com/sgl-project/sglang/pull/2232 * Fix chunked prefill size for bench_offline_throughput by @merrymercy in https://github.com/sgl-project/sglang/pull/2234 * Disable overlap scheduler for multimodal models by @merrymercy in https://github.com/sgl-project/sglang/pull/2235 * Add OLMo2 model. by @janimo in https://github.com/sgl-project/sglang/pull/2233 * Crash the server correctly during error by @merrymercy in https://github.com/sgl-project/sglang/pull/2231 * Fix memory leak during abort by @merrymercy in https://github.com/sgl-project/sglang/pull/2238 * fix missing launch server import by @qeternity in https://github.com/sgl-project/sglang/pull/2242 * [fix] Fix prefix caching for multi-image/video by @Ying1123 in https://github.com/sgl-project/sglang/pull/2239 * Update backend.md by @merrymercy in https://github.com/sgl-project/sglang/pull/2250 * Update backend.md by @merrymercy in https://github.com/sgl-project/sglang/pull/2251 * Revert "Add simple CPU offloading support" by @Ying1123 in https://github.com/sgl-project/sglang/pull/2252 * Revert "Revert "Add simple CPU offloading support"" by @Ying1123 in https://github.com/sgl-project/sglang/pull/2253 * Simplify tokenizer manager by @merrymercy in https://github.com/sgl-project/sglang/pull/2254 * Fix hash collision for multi modal models by @merrymercy in https://github.com/sgl-project/sglang/pull/2256 * [Minor] fix the style for multimodal models by @merrymercy in https://github.com/sgl-project/sglang/pull/2257 * chore: bump v0.3.6.post3 by @zhyncs in https://github.com/sgl-project/sglang/pull/2259 * minor: add sgl-kernel dir by @zhyncs in https://github.com/sgl-project/sglang/pull/2261 * [benchmark] Add fused_moe_triton benchmark and tuning tools by @BBuf in https://github.com/sgl-project/sglang/pull/2225 * Fix the default chunked prefill size by @merrymercy in https://github.com/sgl-project/sglang/pull/2268 * Support LoRA in Completion API by @bjmsong in https://github.com/sgl-project/sglang/pull/2243 * Add new contributors so they can trigger CI automatically by @merrymercy in https://github.com/sgl-project/sglang/pull/2269 * udate weights from disk by @zhaochenyang20 in https://github.com/sgl-project/sglang/pull/2265 * add get weights by parameter name for llama by @zhaochenyang20 in https://github.com/sgl-project/sglang/pull/2266 * [CI] Print summary on github actions by @merrymercy in https://github.com/sgl-project/sglang/pull/2274 * [CI] Kill zombie processes by @merrymercy in https://github.com/sgl-project/sglang/pull/2280 * [FEAT] Support GGUF format by @zhengy001 in https://github.com/sgl-project/sglang/pull/2215 * [Fix] fix assertion error for chunked prefill when disabling cache by @wangraying in https://github.com/sgl-project/sglang/pull/2282 * Revert "[FEAT] Support GGUF format" by @merrymercy in https://github.com/sgl-project/sglang/pull/2285 * Revert "[Fix] fix assertion error for chunked prefill when disabling cache" by @merrymercy in https://github.com/sgl-project/sglang/pull/2286 * [CI] Fix ci tests by @merrymercy in https://github.com/sgl-project/sglang/pull/2284 * Revert "Revert "[FEAT] Support GGUF format"" by @merrymercy in https://github.com/sgl-project/sglang/pull/2287 * feat: add Dockerfile for development by @zhyncs in https://github.com/sgl-project/sglang/pull/2289 * [CI] Fix missing files in run_suite.py by @merrymercy in https://github.com/sgl-project/sglang/pull/2288 * adapt vllm distributed module to sglang by @yizhang2077 in https://github.com/sgl-project/sglang/pull/2244 * Fix chunked prefill when ignore eos by @hnyls2002 in https://github.com/sgl-project/sglang/pull/2290 * [CI] Balance CI tests by @merrymercy in https://github.com/sgl-project/sglang/pull/2293 * feat: add should_use_tensor_core by @zhyncs in https://github.com/sgl-project/sglang/pull/2179 * Feat: upgrade outlines & support compatibility with the old version by @gobraves in https://github.com/sgl-project/sglang/pull/2292 * minor: support flashinfer nightly by @zhyncs in https://github.com/sgl-project/sglang/pull/2295 * Add a simple torch native attention backend by @YangQun1 in https://github.com/sgl-project/sglang/pull/2241 * feat: skip good first issue by @zhyncs in https://github.com/sgl-project/sglang/pull/2298 * minor: rm unused _grouped_size_compiled_for_decode_kernels by @zhyncs in https://github.com/sgl-project/sglang/pull/2299 * feat: support sgl-kernel pypi by @zhyncs in https://github.com/sgl-project/sglang/pull/2302 * Fix logprob for completions by @merrymercy in https://github.com/sgl-project/sglang/pull/2301 * feat: use warp reduce as a simple example by @zhyncs in https://github.com/sgl-project/sglang/pull/2304 * fix: resolve CodeQL cpp issue by @zhyncs in https://github.com/sgl-project/sglang/pull/2305 * misc: update build setup by @zhyncs in https://github.com/sgl-project/sglang/pull/2306 * Online weight updates from torch.distributed by @zhaochenyang20 in https://github.com/sgl-project/sglang/pull/2279 * [Fix] Fix the padded hash value for image tokens by @merrymercy in https://github.com/sgl-project/sglang/pull/2309 * Use rocminfo instead of rocm-smi for more OS/WSL support by @HaiShaw in https://github.com/sgl-project/sglang/pull/2310 * [Minor] Fix code style by @merrymercy in https://github.com/sgl-project/sglang/pull/2311 * Add more fused moe benchmark utilities by @merrymercy in https://github.com/sgl-project/sglang/pull/2314 * Update model_loader deps and qqq quantization deps (#2220) by @zhyncs in https://github.com/sgl-project/sglang/pull/2318 * Relax to include more AMD GPUs by @HaiShaw in https://github.com/sgl-project/sglang/pull/2319 * [feat] Enable chunked prefill for llava-onevision by @Ying1123 in https://github.com/sgl-project/sglang/pull/2281 * [Minor] Fix logger and style by @merrymercy in https://github.com/sgl-project/sglang/pull/2325 * Revert "[feat] Enable chunked prefill for llava-onevision" by @Ying1123 in https://github.com/sgl-project/sglang/pull/2329 * ROCm Container: set SGLANG_SET_CPU_AFFINITY=1 by @HaiShaw in https://github.com/sgl-project/sglang/pull/2328 * Add missing license for router wheel by @MrAta in https://github.com/sgl-project/sglang/pull/2324 * Improve torch compile for fused moe by @merrymercy in https://github.com/sgl-project/sglang/pull/2327 * fix: resolve cmake url for Dockerfile.dev by @zhyncs in https://github.com/sgl-project/sglang/pull/2335 * Fix gptq for moe layers by @merrymercy in https://github.com/sgl-project/sglang/pull/2300 * [router] Copy license when publishing & bump version by @ByronHsu in https://github.com/sgl-project/sglang/pull/2339 * chore: bump v0.4.0 by @zhyncs in https://github.com/sgl-project/sglang/pull/2338 ## New Contributors * @henryhmko made their first contribution in https://github.com/sgl-project/sglang/pull/2092 * @ankurneog made their first contribution in https://github.com/sgl-project/sglang/pull/2121 * @cermeng made their first contribution in https://github.com/sgl-project/sglang/pull/2136 * @Ubospica made their first contribution in https://github.com/sgl-project/sglang/pull/2175 * @dependabot made their first contribution in https://github.com/sgl-project/sglang/pull/2182 * @RinRin-32 made their first contribution in https://github.com/sgl-project/sglang/pull/2052 * @WrRan made their first contribution in https://github.com/sgl-project/sglang/pull/2195 * @apemost made their first contribution in https://github.com/sgl-project/sglang/pull/2198 * @qibaoyuan made their first contribution in https://github.com/sgl-project/sglang/pull/2224 * @zhengy001 made their first contribution in https://github.com/sgl-project/sglang/pull/2215 * @wangraying made their first contribution in https://github.com/sgl-project/sglang/pull/2282 * @gobraves made their first contribution in https://github.com/sgl-project/sglang/pull/2292 * @YangQun1 made their first contribution in https://github.com/sgl-project/sglang/pull/2241 * @MrAta made their first contribution in https://github.com/sgl-project/sglang/pull/2324 **Full Changelog**: https://github.com/sgl-project/sglang/compare/v0.3.6...v0.4.0