-
Notifications
You must be signed in to change notification settings - Fork 5k
[Diffusion] Revamp Rollout Log-Prob Support with SDE/CPS for RL Post-Training #21204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rockdu
wants to merge
10
commits into
sgl-project:main
Choose a base branch
from
MikukuOvO:feat/rollout-logprob-support-revamp-20260323
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+836
−11
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2e30252
[diffusion] feat: add rollout log_prob with flow-matching SDE/CPS sup…
MikukuOvO 5ba1ecb
[diffusion] add rollout log-prob engine with SDE/CPS/ODE support
Rockdu 9db311c
[diffusion] integrate rollout into scheduler step and denoising pipeline
Rockdu 1ec3843
[diffusion] expose rollout parameters in SamplingParams and API layer
Rockdu d5bbaa7
[diffusion] adapt zimage DiT for rollout SP compatibility
Rockdu 7831557
[diffusion] add unit tests for rollout step alignment with FlowGRPO
Rockdu e5c0325
[diffusion] fix lint, align log_prob test with FlowGRPO, fix CLI defa…
Rockdu 115178f
[diffusion] remove rollout params from OpenAI-compatible API layer
Rockdu dd8a51e
[diffusion] rename test_scheduler_rollout_ode_unit -> test_scheduler_…
Rockdu 8162901
[diffusion] fix rollout zero noise_level
Rockdu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Empty file.
46 changes: 46 additions & 0 deletions
46
python/sglang/multimodal_gen/runtime/post_training/rl_dataclasses.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """RL-specific dataclasses used by post-training and rollout paths.""" | ||
|
|
||
| from dataclasses import dataclass, field | ||
| from typing import Any | ||
|
|
||
| import torch | ||
|
|
||
|
|
||
| @dataclass | ||
| class RolloutSessionData: | ||
| """Per-batch rollout state created by prepare_rollout(), lives on the batch object. | ||
|
|
||
| Cleared by setting ``batch._rollout_session_data = None``. | ||
| """ | ||
|
|
||
| pipeline_config: Any = None | ||
| sigma_max: float = 0.0 | ||
| latents_shape: tuple | None = None | ||
| noise_buffer: torch.Tensor | None = None | ||
|
|
||
| local_log_prob_sum: list[torch.Tensor] = field(default_factory=list) | ||
| local_log_prob_count: list[torch.Tensor] = field(default_factory=list) | ||
|
|
||
| local_variance_noises: list[torch.Tensor] = field(default_factory=list) | ||
| local_prev_sample_means: list[torch.Tensor] = field(default_factory=list) | ||
| local_noise_std_devs: list[torch.Tensor] = field(default_factory=list) | ||
| local_model_outputs: list[torch.Tensor] = field(default_factory=list) | ||
|
|
||
|
|
||
| @dataclass | ||
| class RolloutDebugTensors: | ||
| """Container for rollout debug tensors collected during denoising.""" | ||
|
|
||
| rollout_variance_noises: torch.Tensor | None = None | ||
| rollout_prev_sample_means: torch.Tensor | None = None | ||
| rollout_noise_std_devs: torch.Tensor | None = None | ||
| rollout_model_outputs: torch.Tensor | None = None | ||
|
|
||
|
|
||
| @dataclass | ||
| class RolloutTrajectoryData: | ||
| """Container for rollout-specific trajectory outputs.""" | ||
|
|
||
| rollout_log_probs: torch.Tensor | None = None | ||
| rollout_debug_tensors: RolloutDebugTensors | None = None |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we use a dedicated parser (for RL), and add arguments of the parser here