Skip to content

[PD] Runtime role switch: engine launched with --disaggregation-mode decode crashes with illegal memory access after decode -> prefill -> decode #43557

Description

@athrael-soju

Version: sglang 0.5.21 (lmsysorg/sglang:v0.5.21-cu130), mooncake transfer backend, TP 1, one node.

Model: Qwen/Qwen3.5-0.8B (hybrid linear and full attention). Every engine runs with
--max-running-requests 256 --page-size 1 --attention-backend triton --enable-pd-role-switch --disaggregation-transfer-backend mooncake.

Steps

  1. Start engine A with --disaggregation-mode prefill and engine B with --disaggregation-mode decode, each with its own --disaggregation-bootstrap-port.
  2. Serve requests A -> B: they work.
  3. With both engines idle, POST /pd_role_switch {"new_role": "decode", "decode_cuda_graph_memory_gb": <B's value from /server_info>} on A, then {"new_role": "prefill"} on B. Serve B -> A: it works.
  4. Switch A back to prefill and B back to decode (passing decode_cuda_graph_memory_gb). Both switches return success: true.
  5. Serve A -> B.

Expected: B decodes as it did in step 2.

Actual: B's scheduler exits on its first decode with torch.AcceleratorError: CUDA error: an illegal memory access was encountered, then SIGQUIT. Prefill requests fail after the bootstrap timeout. This reproduced in 4 of 4 runs, including with a larger model from the same family.

Workaround: launch every engine with --disaggregation-mode prefill and switch the decode engines to decode at startup. With that, engine A and engine B each switched both ways through three full cycles and served every request (2 of 2 runs). So the failure seems tied to an instance whose launch role was decode.

Activity

  1. self-assigned this
    on Oct 11, 2026
  2. ShangmingCai commented on Oct 11, 2026

    @ShangmingCai
    Collaborator
  3. michaelmanly commented on Oct 11, 2026

    @michaelmanly

    We tried a bounded decode → prefill → decode role-switch cycle on 2× RTX 4090 and didn't reproduce the illegal memory access, so this doesn't rule out the issue on your setup. Is there a particular SGLang commit, GPU topology or request sequence that triggers it reliably? Happy to compare against the exact workload, especially if it's blocking a live deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions