[Bug] MultimemAllGatherer in LogitsProcessor crashes with SIGFPE on platforms without CUDA multicast (WSL2), even with symm-mem flags off
Checklist
- I searched related issues but found no solution.
- The bug persists in the latest version.
- Issues without environment info and a minimal reproducible demo are hard to resolve and may receive no feedback.
- If this is not a bug report but a general question, please start a discussion at https://github.com/sgl-project/sglang/discussions. Otherwise, it will be closed.
- Please use English. Otherwise, it will be closed.
Describe the bug
On WSL2 with 2 GPUs and --tp-size 2, the server loads weights and allocates KV cache normally, then the scheduler dies with:
Fatal Python error: Floating point exceptionThe crash is inside torch.distributed._symmetric_memory.rendezvous, called by MultimemAllGatherer, which LogitsProcessor enables whenever do_tensor_parallel_all_gather is true. This happens even though --enable-symm-mem and --enable-torch-symm-mem are not set.
It triggers on the first forward that reaches the logits all-gather: either the server warmup request, or decode CUDA graph capture if that runs first (scheduler exit code -8 = SIGFPE). It reproduces on every start.
WSL2's GPU paravirtualization does not support CUDA multicast objects, and NCCL correctly detects this at init:
NCCL INFO NVLS multicast support is not available on dev 0
NCCL INFO Symmetric memory is not supported. cuMemEnable 0, globalGinSupport 0, cuMemGdrSupport 0But MultimemAllGatherer._build() does not check for multicast support before calling create_state(). The existing try/except in _build() cannot help, because the failure is a SIGFPE that kills the process instead of a Python exception.
Plain NCCL works fine on this setup: a standalone 2-GPU all_reduce test in the same image passes (SHM transport, ~3 GB/s bus bandwidth).
Stack trace (scheduler TP0, trimmed)
Fatal Python error: Floating point exception
Current thread (most recent call first):
torch/distributed/_symmetric_memory/__init__.py, line 2004 in rendezvous
sglang/srt/distributed/device_communicators/triton_symm_mem_ag.py, line 337 in create_state
sglang/srt/distributed/device_communicators/triton_symm_mem_ag.py, line 535 in _build
sglang/srt/distributed/device_communicators/triton_symm_mem_ag.py, line 496 in __call__
sglang/srt/layers/logits_processor.py, line 859 in _get_logits
sglang/srt/layers/logits_processor.py, line 533 in forward
sglang/srt/models/qwen3_vl.py, line 1646 in forward
sglang/srt/model_executor/runner/eager_runner.py, line 372 in _execute_extend
...
sglang/srt/managers/scheduler.py, line 1991 in event_loop_overlapThe same path is hit from decode_cuda_graph_runner.py (capture -> run_once -> qwen3_vl.forward -> _get_logits) when graph capture runs first. Rank 1 then reports TCPStore ... Broken pipe as a consequence.
Workaround
Force the gatherer off in LogitsProcessor.__init__ (python/sglang/srt/layers/logits_processor.py, ~L450):
self._logits_gatherer = triton_symm_mem_ag.MultimemAllGatherer(
max_tokens=...,
enabled=False, # was: self.do_tensor_parallel_all_gather and not self.use_attn_tp_group
skip_entry_sync=True,
)__call__ then falls back to tensor_model_parallel_all_gather and the server runs stably (~31 tok/s single stream, ~67 tok/s at batch 2).
Proposed fix (tested)
Add a multicast check to MultimemAllGatherer._build() in
triton_symm_mem_ag.py, right after the existing _NUMEL_PER_THREAD check:
try:
from torch._C._autograd import DeviceType
from torch._C._distributed_c10d import _SymmetricMemory
if not _SymmetricMemory.has_multicast_support(
DeviceType.CUDA, torch.cuda.current_device()
):
logger.warning(
"multimem all-gather disabled: CUDA multicast not supported "
"on this device; using NCCL all-gather."
)
return None
except Exception as e:
logger.warning(f"multimem all-gather disabled: multicast check failed ({e}).")
return NoneReturning None from _build() makes __call__ fall back to
tensor_model_parallel_all_gather permanently, so systems with multicast
support are unaffected.
Tested on this system, without the logits_processor.py workaround:
_SymmetricMemory.has_multicast_support()returnsFalsefor both GPUs:
docker run --rm --gpus all lmsysorg/sglang:v0.5.20-cu130-runtime python3 -c "import torch; from torch._C._autograd import DeviceType; from torch._C._distributed_c10d import _SymmetricMemory; print([_SymmetricMemory.has_multicast_support(DeviceType.CUDA, i) for i in range(torch.cuda.device_count())])" Output: [False, False]
- Both ranks log the warning above during decode CUDA graph capture, the same point that previously crashed. The server then starts and serves requests normally (decode ~30 tok/s with CUDA graphs enabled).
I mount a small patch script into the container and run it before launching
the server. It inserts the guard above into triton_symm_mem_ag.py, does
nothing if already applied, and exits with an error if the expected code
isn't found:
import sys
PATH = "/sgl-workspace/sglang/python/sglang/srt/distributed/device_communicators/triton_symm_mem_ag.py"
MARKER = "# multicast-guard"
ANCHOR = (
" if x.shape[-1] % _NUMEL_PER_THREAD != 0:\n"
" return None\n"
)
GUARD = ANCHOR + """\
# multicast-guard: fall back to NCCL when CUDA multicast is unsupported (e.g. WSL2)
try:
from torch._C._autograd import DeviceType
from torch._C._distributed_c10d import _SymmetricMemory
if not _SymmetricMemory.has_multicast_support(
DeviceType.CUDA, torch.cuda.current_device()
):
logger.warning(
"multimem all-gather disabled: CUDA multicast not supported "
"on this device; using NCCL all-gather."
)
return None
except Exception as e:
logger.warning(f"multimem all-gather disabled: multicast check failed ({e}).")
return None
"""
with open(PATH) as f:
src = f.read()
if MARKER in src:
print("multicast guard already applied")
sys.exit(0)
if src.count(ANCHOR) != 1:
print(f"PATCH FAILED: expected code not found exactly once in {PATH}")
sys.exit(1)
with open(PATH, "w") as f:
f.write(src.replace(ANCHOR, GUARD))
print("multicast guard applied")In docker-compose.yml, mount it and run it before the server:
volumes:
- ./patches:/patches:ro
command:
- bash
- -c
- |
python3 /patches/patch_multicast_guard.py || exit 1
exec python3 -m sglang.launch_server \
--tp-size 2 \
... # rest of the launch arguments unchangedTwo open questions for maintainers:
- I haven't confirmed which step inside
rendezvousactually fails on WSL2. The guard avoids the path on any platform without multicast either way. - The broad
exceptfalls back (with a warning) if the check itself errors. You may prefer to narrow it or handle it differently.
Separately, an env var or server flag to disable the multimem all-gather would give users on unusual platforms an escape hatch without patching source.
I'm happy to open a PR with this change if the approach looks right.
Related
TorchSymmMemCommunicatoralready disables itself whenmulticast_ptr == 0(see #34574); the same guard seems appropriate forMultimemAllGatherer.- radixark/miles#2856 hit a different crash from the same
MultimemAllGathererconstruction path.
Note: I debugged this with the help of an AI assistant (Claude). The workaround and proposed fix came out of that process: iterating on logs, trying suggestions, and narrowing it down to this code path. The crash, the workaround, and the proposed fix have all been verified on this (As mentioned below in the environment) system.
Reproduction
Tested with image lmsysorg/sglang:v0.5.20-cu130-runtime in Docker Desktop (WSL2 backend), 2x RTX 4090.
Failing command (crashes on every start)
Environment variables:
NCCL_P2P_DISABLE=1
NCCL_IB_DISABLE=1
NCCL_SOCKET_IFNAME=lo
NCCL_CUMEM_ENABLE=0python3 -m sglang.launch_server \
--model-path Qwen/Qwen3.8-27B-FP8 \
--tp-size 2 \
--attention-backend flashinfer \
--kv-cache-dtype fp8_e4m3 \
--mem-fraction-static 0.82 \
--context-length 32768 \
--disable-custom-all-reduce \
--host 0.0.0.0 --port 9580Crashes at the server warmup request, or during decode CUDA graph capture.
Working configuration (with workaround)
The sed line in the command patches logits_processor.py before launch. The
server has run stably with it.
services:
sglang:
image: lmsysorg/sglang:v0.5.20-cu130-runtime
ipc: host
ulimits:
memlock: -1
stack: 67108864
environment:
- HF_HUB_OFFLINE=1
- NCCL_DEBUG=WARN
- NCCL_P2P_DISABLE=1
- NCCL_IB_DISABLE=1
- NCCL_SOCKET_IFNAME=lo
- NCCL_CUMEM_ENABLE=0
- TORCHDYNAMO_DISABLE=1 # unrelated local issue, see note below
volumes:
- hf-cache:/root/.cache/huggingface
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
command:
- bash
- -c
- |
# WORKAROUND: disable the multimem logits all-gather
F=/sgl-workspace/sglang/python/sglang/srt/layers/logits_processor.py
sed -i 's/enabled=self.do_tensor_parallel_all_gather and not self.use_attn_tp_group,/enabled=False, # wsl2-no-multimem/' "$$F"
grep -q 'wsl2-no-multimem' "$$F" || { echo "PATCH FAILED"; exit 1; }
exec python3 -m sglang.launch_server \
--host 0.0.0.0 \
--port 9580 \
--model-path Qwen/Qwen3.8-27B-FP8 \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder \
--tp-size 2 \
--attention-backend flashinfer \
--kv-cache-dtype fp8_e4m3 \
--mem-fraction-static 0.82 \
--context-length 32768 \
--max-running-requests 2 \
--disable-custom-all-reduce \
--cuda-graph-backend-prefill disabled \
--watchdog-timeout 90 \
--enable-metrics
volumes:
hf-cache:
external: trueNote: only the sed workaround is needed to fix this crash. TORCHDYNAMO_DISABLE=1
and --cuda-graph-backend-prefill disabled work around separate, intermittent
local issues and are not required. The multimem crash reproduces without them.
Environment
docker exec qwen-sglang python3 -m sglang.check_envPython: 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]
CUDA available: True
GPU 0,1: NVIDIA GeForce RTX 4090
GPU 0,1 Compute Capability: 8.9
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 13.0, V13.0.88
CUDA Driver Version: 617.14
PyTorch: 2.13.0+cu130
sglang: 0.5.20
sglang-kernel: 0.4.7
flashinfer_python: 0.6.18
flashinfer_cubin: 0.6.18
flashinfer_jit_cache: 0.6.18+cu130
triton: 3.7.1
transformers: 5.12.1
torchao: Module Not Found
numpy: 2.3.5
aiohttp: 3.14.3
fastapi: 0.141.1
huggingface_hub: 1.32.0
interegular: 0.3.3
modelscope: 1.40.1
orjson: 3.12.0
outlines: 0.1.11
packaging: 26.3
psutil: 7.2.2
pydantic: 2.13.5
python-multipart: 0.0.32
pyzmq: 27.2.0
uvicorn: 0.53.0
uvloop: 0.22.1
vllm: Module Not Found
xgrammar: 0.2.1
openai: 2.6.1
tiktoken: 0.14.0
anthropic: 1.6.0
litellm: Module Not Found
torchcodec: 0.15.0+cu130
Hypervisor vendor:: Microsoft
ulimit soft: 1048576Additional details not captured by check_env:
- Windows 11 (build 10.0.26200.9550), WSL 2.7.14.0, Docker Desktop (WSL2 backend)
- WSL kernel: custom 6.6.114.1-microsoft-standard-WSL2 (extracted from the WSL 2.7.3.0 package), set via .wslconfig. The bundled 6.18.33.2-2 cannot be used: SGLang startup hangs with worker processes stuck in D state at
__vma_start_write, matching microsoft/WSL#41708 and #41113. - .wslconfig: memory=48GB, swap=16GB, processors=16
- 2x RTX 4090 (no P2P/NVLink, WDDM mode), NVIDIA driver 617.14 (CUDA 13.4)
- NCCL 2.30.7
--enable-symm-memand--enable-torch-symm-memNOT set
Source: sgl-project/sglang