Repository navigation
[Diffusion] Rollout API: support return only SDE latents - #36994
Merged
Zhichenzzz merged 1 commit intoAug 30, 2026
Merged
Conversation
Rockdu
force-pushed
the
rollout-traj-window
branch
from
August 29, 2026 09:02
c50aebb to
e9bea69
Compare
…indow with step-index provenance
Rockdu
force-pushed
the
rollout-traj-window
branch
from
August 30, 2026 00:08
e9bea69 to
cbeeeb5
Compare
4 of 6 tasks
Rockdu
marked this pull request as ready for review
August 30, 2026 00:50
Rockdu
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
mickqian,
ping1jing2 and
yichiche
as code owners
August 30, 2026 00:50
Zhichenzzz
approved these changes
Aug 30, 2026
Zhichenzzz
merged commit Aug 30, 2026
c80d803
into
sgl-project:sglang-miles-h3
81 of 90 checks passed
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.
Motivation
/rollout/generatereturns the whole0..Tdenoising trajectory, but flowGRPO training consumes only the SDE window: for each SDE stepsit needsx_s,x_{s+1}andlog_prob_s. On a 10-step schedule with a 2-step window that is 3 of the 11 latents; the other 8 can be thrown away, cutting trajectory payload size down by ~72%. These latents are fp32 and, for video models, dominate the response body — a MiniMax H3 t2va microgroup carries hundreds of MB of them.rollout_return_step_indicesalready existed for this, but it was not usable:x_swithx_{s+1}relied on the array being the full contiguous0..T;timestepswas filtered together with the latents, so the trainer lost the schedule entries it indexes by step number;Modifications
RolloutDitTrajectorygainslatent_step_indices: the original step index of each returned latent (None= the full0..Ttrajectory). Serialized alongside the trajectory and carried through the per-sample split.RolloutDenoisingMixin: latents keep honoringrollout_return_step_indicesand now record their provenance;timestepsis appended before the filter, so the schedule always comes back full-length. Scalar-sized arrays (timesteps,rollout_log_probs) are indexed by original step number, only the latents are filtered.MiniMaxH3RolloutCollector: same filtering and provenance, so H3 stops ignoring the request; itstimestepsnow spans the full[T+1]including the terminal entry, matchingsigmasand the generic path.The consumer side lives in radixark/miles_diffusion#216: it requests
S ∪ (S+1)for an SDE windowSand pairs latents by the echoed provenance instead of by array position, so a non-contiguous window is correct by construction and a request/response disagreement raises instead of silently mispairing.Accuracy Tests
Joint end-to-end runs with radixark/miles_diffusion#216 pinned to this branch — all e2e stages green (run 33244938347):
stage-b-3-gpu-h200,stage-b-5-gpu-h200,stage-c-3-gpu-h200,stage-c-5-gpu-h200.Every one of those recipes runs a step strategy, so all of them exercised the filtered transport, and each reproduced its pre-existing recorded metric standard bit for bit (strict comparison,
--deterministic-mode):test_sd3_ocr_grpo_2xGPUtest_qwenimage_pickscore_grpo_5xGPUtest_ltx23_pickscore_grpo_4xGPUtest_wan22_pickscore_grpo_17xGPU_single_node_4xGPU_proxyTwo further e2e CIs are being added for the models this PR touches. Each recorded its standard off this branch, then reproduced it on top of it:
test_h3_t2va_grpo_2xGPU(miles_diffusion#217)sglang-miles-h3engine; all 8 metric series identical to the last digit, and that baseline passes in CI (run 33271965673, 1490 s)test_cosmos3_pickscore_grpo_t2i_4xGPU(miles_diffusion#219)sglang main; all 10 metric series bitwise identical here (run). On the stock engine the same run instead fails in rollout to train conversion:trajectory lacks latents for steps [10, 11, 12] (have [0, 1, 2])(run)cosmos3 is the case that cannot pass without the provenance echo: its Karras grid puts the useful window at steps 8-11, so array position never coincides with step number and pairing by position would silently pair
x_10withx_0. Itstrain/model_output_{mean_abs_diff,rel_max}compare the raw DiT outputs between engine and trainer, so the equality covers the tensors themselves rather than a reward summary.Checklist
CI States
Latest PR Test (Base): ❌ Run #33282596522
Latest PR Test (Extra): ❌ Run #33282596363
Latest PR Test (AMD ROCm 7.2): ❌ Run #33282596623