Repository navigation
[Refactor] diffusion RL: Rollout controller as a scheduler-step plugin instead of mixins (sglang-miles port) - #44877
Merged
Merged
Conversation
…troller.py Pure file rename (git R100); the proof tool has no file-rename primitive. Refactor-Kind: non_mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
…er.py Refactor-Kind: mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
Refactor-Kind: mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
Refactor-Kind: mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
… RolloutSessionData Refactor-Kind: non_mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
Refactor-Kind: mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
…lloutController and drop SchedulerRLMixin Refactor-Kind: non_mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
…stead of branching on batch Refactor-Kind: non_mechanical_provable Co-authored-by: WenhaoZhang <42087078+niehen6174@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
… of the denoise loops Refactor-Kind: non_mechanical_provable Co-authored-by: WenhaoZhang <42087078+niehen6174@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
… hook functions Refactor-Kind: non_mechanical_provable Co-authored-by: WenhaoZhang <42087078+niehen6174@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
…ontroller Refactor-Kind: non_mechanical_provable Co-authored-by: WenhaoZhang <42087078+niehen6174@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
… miles-diffusion Refactor-Kind: non_mechanical_provable Signed-off-by: rockdu <kangrdu@gmail.com>
… keep trajectory timesteps on device Refactor-Kind: non_mechanical_provable Co-authored-by: Kangrui Du <89372739+Rockdu@users.noreply.github.com> Co-authored-by: JingwenGu0829 <75733630+JingwenGu0829@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
…nstead of capturing it Refactor-Kind: non_mechanical_provable Co-authored-by: Kangrui Du <89372739+Rockdu@users.noreply.github.com> Co-authored-by: JingwenGu0829 <75733630+JingwenGu0829@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
…undant generator argument and make the trajectory recorder public Refactor-Kind: non_mechanical_provable Co-authored-by: Kangrui Du <89372739+Rockdu@users.noreply.github.com> Co-authored-by: JingwenGu0829 <75733630+JingwenGu0829@users.noreply.github.com> Signed-off-by: rockdu <kangrdu@gmail.com>
Rockdu
marked this pull request as ready for review
October 17, 2026 09:33
Rockdu
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
kevin-mii,
mickqian,
niehen6174,
ping1jing2 and
yichiche
as code owners
October 17, 2026 09:33
Rockdu
force-pushed
the
rockdu/rollout-plugin-sglang-miles
branch
3 times, most recently
from
October 17, 2026 09:45
38746af to
928423d
Compare
3 of 6 tasks
4 of 5 tasks
nanjiangwill
pushed a commit
to modal-projects/sglang
that referenced
this pull request
Nov 1, 2026
…n instead of mixins (sglang-miles port) (sgl-project#44877) Signed-off-by: rockdu <kangrdu@gmail.com> Co-authored-by: WenhaoZhang <42087078+niehen6174@users.noreply.github.com> Co-authored-by: JingwenGu0829 <75733630+JingwenGu0829@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
sglang-milesport of #44603 (the same 15 commits) on thesglang-milesbump to sglangv0.5.22; it supersedes #44239. The one difference from #44603:sglang-mileskeeps its trajectory semantics from #40786 (timesteps cover every step, latents followrollout_return_step_indices,latent_step_indicesis recorded), which miles-diffusion depends on.Rollout stops being a scheduler / denoising-stage mixin: each latent stream of a rollout request gets a
FlowRolloutControllerwhosetransitionthe loop passes intoscheduler.step. Serving is untouched; rollout numerics do not change.It supersedes the design in #37940; @niehen6174 is co-author on the derived commits. @JingwenGu0829 found the issues fixed in commits 13 and 14 (Rockdu#4) and is co-author on commits 13 to 15.
How it works
FlowMatchEulerDiscreteScheduler.step(..., transition=None)runstransition or self._transition. Loops pass**rollout_step_kwargs(batch), which is empty for serving requests, so every scheduler keeps its serving call.rollout_hooks.py:prepare_rollout_if_enabled(before the SP shard),init_rollout_env_if_enabled,rollout_step_kwargs,finalize_rollout_if_enabled; all no-ops for serving.DenoisingStage, Cosmos3 and LTX-2. A loop without a scheduler (MiniMax H3, next PR) passes its ownbuild_controllerandode_transition.Review guide
Commits 2, 3, 4 and 6 are mechanical moves verified by the chain verifier (4/4 proofs) and commit 1 is a pure rename; skim them. Review commits 5, 7 to 11 and 13 to 15.
Tests
sglang-miles([Diffusion][sglang-miles] refactor: rollout controller as a scheduler-step plugin instead of mixins #44239): bitwise identical for Qwen-Image, Cosmos3 and LTX-2.3 at SP 1 and 2.Checklist
CI States
Latest PR Test (Base): ❌ Run #39022334419
Latest PR Test (Extra): ❌ Run #39022334380
Latest PR Test (AMD ROCm 10): ❌ Run #39022334446