Skip to content

[Question] What's the plan for rollout pp_size>1 on the SGLang engine? #490

Description

@ruiling-smartbear

Pipeline parallelism on the SGLang rollout engine is currently blocked in three places:

file guard
unirl/rollout/engine/sglang/config.py:146 pp_size>1 is not supported yet — UniRL Handle would spawn one engine per pp_rank while SGLang spawns its own PP scheduler subprocesses, double-booking GPUs
unirl/distributed/weight_sync/full/nccl.py:73 NCCLWeightSync.connect: rollout pp_size>1 is not implemented
unirl/distributed/group/dispatch.py:178 rejected because auto-backward cannot propagate gradients across pipeline stages

The config comment names two directions as future work — per-stage rank_offset routing, and single-engine PP fan-out.

Reading sglang/engine.py, TP already resolves the same ownership question by delegating: every TP rank gets an engine instance, but only tp_rank=0 is live (engine.py:76-88 turns the rest into no-op shells), and that one instance receives the whole TP group via cuda_visible_devices=tp_visible_devices plus runtime_overrides["tp_size"] (engine.py:121-124, :153), so SGLang does the sharding internally.

Questions:

  1. Is single-engine PP fan-out (same delegation pattern as TP, gated on pp_rank == 0 and tp_rank == 0) the intended direction, or is per-stage rank_offset routing preferred?
  2. NCCLWeightSync.connect currently derives the broadcast group from num_rollout_gpus and tp_size. Under the delegation model the rollout side would still expose one live engine per PP group — is reworking that rank accounting the main blocker, or is there more?
  3. The dispatch.py guard is about gradients crossing pipeline stages. Rollout engines don't backprop, so is that guard incidental to this path, or does it apply for a reason I'm missing?
  4. Is anyone working on this already?

Happy to take a piece of it if the design direction is settled. Asking before writing anything, since the config comment suggests the approach is still open.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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