[Diffusion] Return scheduler sigmas snapshot in rollout dit_trajectory - #32683
Merged
AgainstEntropy merged 1 commit intoJul 31, 2026
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Rockdu
force-pushed
the
rollout-return-sigmas-fork
branch
from
July 29, 2026 00:09
7285c06 to
4c9e7f3
Compare
Rockdu
marked this pull request as ready for review
July 29, 2026 06:29
Rockdu
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
mickqian,
ping1jing2 and
yichiche
as code owners
July 29, 2026 06:29
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
AgainstEntropy
approved these changes
Jul 30, 2026
Collaborator
|
/tag-and-rerun-ci |
Contributor
Author
|
TODO: ablation and switch to scheduler.timesteps as well |
This was referenced Aug 10, 2026
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 16, 2026
jakki-amd
pushed a commit
to jakki-amd/sglang
that referenced
this pull request
Sep 9, 2026
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
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.
What
sigmastoRolloutDitTrajectory: a[T+1]snapshot ofscheduler.sigmas(post-shift, includes the terminal 0), captured when the trajectory is finalized and returned alongsidetimestepsinPOST /rollout/generateresponses.Why
Training-side consumers currently recompute sigmas from trajectory timesteps as
timesteps / num_train_timesteps. That round-tripssigma * 1000 / 1000and drifts ULPs, which amplifies into observable log-prob differences when the division happens in bf16. The scheduler already holds the exact per-request schedule (set_timestepsrebuildsself.sigmasfor the request's actualnum_inference_steps), so return it directly.Semantics worth noting for reviewers:
sigmasis schedule metadata, not per-entry data: it stays the full[T+1]schedule and is not affected byrollout_return_step_indicesfiltering. When filtering is used, consumers must align by absolute step index rather than zipping positionally with the filteredtimesteps.num_outputs_per_prompt > 1all samples of a request share one scheduler schedule, so the per-sample slicer passes it through unsliced (same pattern astimesteps). This also avoids_extract_single_sample_tensormis-slicing a 1-D schedule whose length happens to equalbatch_size.set_timestepsmore than once per generation (multi-stage pipelines) would snapshot the last schedule; this matches the existingtimestepsbehavior and single-stage rollout is the only supported RL path today.Validation
python -m pytest python/sglang/multimodal_gen/test/unit/test_rollout_api.py -q: 34 passed (H200).stabilityai/stable-diffusion-3.5-medium, 10-step rollout viaPOST /rollout/generatewithrollout_return_dit_trajectory=true; responsedit_trajectory.sigmasis fp32(11,)with terminal 0, andsigma * 1000bitwise-equals the returnedtimesteps.Files
runtime/post_training/rl_dataclasses.py— add thesigmasfield.runtime/post_training/rollout_denoising_mixin.py— snapshotbatch.scheduler.sigmasat trajectory finalize.runtime/entrypoints/post_training/rollout_api.py— passsigmasthrough per-sample extraction and response serialization.test/unit/test_rollout_api.py— extend serialization and batched-response tests.Checklist
pre-commit run --files <changed files>passes (all hooks, no auto-fixes needed)pytest -xis green (scoped totest_rollout_api.py, 34 passed)CI States
Latest PR Test (Base): ✅ Run #30410262021
Latest PR Test (Extra): ❌ Run #30410261848