SGLang stops creating a CUDA context at import time so workers can fork instead of spawn
PR #40201 (merged 2026-09-21) removes CUDA context creation from `import sglang`: `get_device_sm()` now answers from NVML while torch.cuda is uninitialized, `get_device_module()` picks from platform checks, and `--reasoning-parser` / `--tool-call-parser` CLI choices come from dependency-free name lists instead of pulling the parser registries (about 3 seconds of imports) into every process that parses arguments. A process holding a CUDA context cannot be a `fork()` parent, which is what blocked forkserver-based worker startup. The full stack's measured payoff on Qwen3-30B-A3B on an H200: time from `sglang serve` to `/health` drops from 47.3 s to 39.5 s single-GPU, 56.0 s to 40.5 s on DP2, and 46.6 s to 31.4 s on EP2 with DeepEP low-latency.
Source
↳ Follow the thread