refactor(diffusion): require rollout scheduler sigmas, drop timesteps-derived fallbacks - #89
Merged
Rockdu merged 3 commits intoAug 3, 2026
Conversation
6 tasks
Rockdu
force-pushed
the
refactor/require-rollout-sigmas
branch
from
August 3, 2026 07:52
b2b02a8 to
df2e704
Compare
Rockdu
marked this pull request as ready for review
August 3, 2026 08:39
Rockdu
merged commit Aug 3, 2026
6720ee4
into
radixark:fix/rerecord-sd3-ocr-sglang-drift
27 of 28 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.
What
scheduler.sigmassnapshot verbatim; thetimesteps / num_train_timestepsreconstruction fallbacks are removed (scheduler_meta_from_rollout, NFT converter, Flow-GRPO converter). Missing sigmas is a hardValueError, making sglang585a7d05e(#32683) the minimum rollout engine.scheduler_meta_from_samples, which builds the batch scheduler meta from sample 0 and rejects any sample whosetimesteps/sigmasdiffer — the NFT converter previously used sample 0's meta without checking the rest.Why
The fallback was not equivalent to the snapshot:
traj.timestepsis[T+1](terminal0.0appended with the final x0 latent), socat([timesteps / N, zeros(1)])produced 12 entries for a 10-step schedule vs the snapshot's 11, and the division does not round-tripsigma * 1000in fp32 (rel. diff up to 1.42e-8, measured in CI run 30778705251). Two paths producing almost the same array is exactly howstage-c-3-gpu-h200silently drifted when upstream started supplying sigmas; failing loudly removes that bug class.Validation
b8109b5d+ this branch): all 5 recipes ran 2 rollouts end-to-end — SD3-OCR GRPO, SD3 NFT (nft_num_timesteps=9,nft_t_mean=0.7304325, matching the sigmas-snapshot theory value), LTX-2.3 GRPO, Qwen-Image Flow-GRPO-aligned, Wan2.2-A14B (dual-DiT per-component metrics present). Healthylog_prob_mean_abs_diffon all: ~1e-4 (SD3), ~1e-6 (LTX), ~4e-5 (Qwen-Image), ~1e-5 (Wan2.2).tests/fastlocally: 136 passed (excludingtest_metric_buffer_dist/test_hybrid_shard_mesh, which need a Linux dist/GPU environment).Not in this PR (tracked separately): value-threshold trim for
resolve_nft_sigmas(requires re-recording the NFT e2e standard), the degenerate terminal pair innext_timesteps, and the upstream[T]annotation fix (sgl-project/sglang#33332).Files
miles/utils/train_data_utils.py—scheduler_meta_from_rolloutrequiresscheduler_sigmas; new sharedscheduler_meta_from_samples.miles/backends/fsdp_utils/actor.py— drop the now-unusednum_train_timestepsplumbing.miles/ray/data_conversion_hub/flow_grpo.py,miles/ray/data_conversion_hub/nft.py— use the shared helper; fallbacks removed.miles/utils/types.py—DiTTrajectory.sigmascomment updated.tests/fast/utils/test_grouping_parity.py,tests/fast/backends/fsdp_utils/test_loss_hub_nft.py— sigmas-required and mismatched-meta tests (registeredstage-a-cpu).Checklist
pre-commit run --all-filespasses — not run locallypytest -xis green —tests/fastlocally, see Validationpython3 train.py --helpstill parses — N/A, no flag changes