RL icon indicating copy to clipboard operation
RL copied to clipboard

SingleController: support SGLang fault tolerance

Open shikicloud opened this issue 1 week ago • 1 comments

Context. #5282 runs SGLang generation on the SingleController. SGLang fault tolerance (policy.generation.sglang_cfg.sglang_fault_tolerance_config.use_fault_tolerance: true) is rejected at setup there, in SGLangGeneration.validate_settings. This is the remaining SGLang item of #5044.

Why it does not work today. The SingleController pickles the generation handle into its actor. The RolloutHealthMonitor is a thread of the driver process: it would keep probing and restarting engines in the driver, while the actor's copy keeps the engine handles and URLs it was pickled with. After a restart the copy would drive dead handles.

What is needed.

  • One owner of the engine list that both sides can follow: run the health monitor in the process that serves the rollouts (the SingleController actor), or keep the engine handles and URLs in one place the copy reads from.
  • Engine restart at refit from the owning side, with the copy picking up the new handles.
  • An SC variant of tests/functional/grpo_sglang_fault_tolerance_chaos.sh, the validation target #5044 lists.

Done when use_fault_tolerance: true is accepted on the SingleController and the SC chaos test passes.

shikicloud avatar Nov 21 '26 11:11 shikicloud

Hello, I would like to work on this if nobody is working on it yet.

Rough plan:

  • I will have only the copy in the SC actor run the RolloutHealthMonitor, because that copy is the one serving rollouts, and a monitor in the driver restarts engines the copy never sees. The monitor will start from SingleControllerActor.__init__ through a no-op GenerationInterface hook, the same spot where the vLLM EngineSupervisor is built, so unpickling stays free of side effects. The driver instance will be built with the monitor off.
  • Refit-time restart already happens in the actor (sync_weights -> recover_updatable_engines -> _recover), so the replacement engines are created there and only the actor knows about them. A teardown hook in SingleControllerActor.run will stop the monitor and shut those engines down, since the driver only has the dead handles and would leave the replacements running.
  • With the monitor and the restarts both in the actor, the reason for the use_fault_tolerance rejection in validate_settings goes away, so that check will be dropped. The docs will be updated too, since they currently say SGLang on SC has to run without fault tolerance.
  • For validation, an SC variant of grpo_sglang_fault_tolerance_chaos.sh will be added, since that is the test #5044 lists for this item. _sglang_grpo_chaos.py counts finished steps from the legacy ===== Step N/M ===== banner, which SC does not print, so it will also learn the SC train step N/M format.

Questions:

  1. Should I stack this on #5282, or wait until it merges?
  2. On SC, SGLang cannot share GPUs with the trainer, and the survival test needs a second engine to keep serving while the killed one waits for its restart at the next refit. That makes the test 3 GPUs (1 trainer + 2 engines), while the other SC functional tests use 2. Is 3 GPUs OK for CI, or would you prefer a different setup?

edjson avatar Nov 21 '26 11:11 edjson