Skip to content

fix step batch rollout#1

Merged
knlnguyen1802 merged 1 commit into
knlnguyen1802:stepwise_fixfrom
zhtmike:pr81
May 18, 2026
Merged

fix step batch rollout#1
knlnguyen1802 merged 1 commit into
knlnguyen1802:stepwise_fixfrom
zhtmike:pr81

Conversation

@zhtmike

@zhtmike zhtmike commented May 18, 2026

Copy link
Copy Markdown

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, vllm_omni, rollout, trainer, ci, training_utils, recipe, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward, diffusion, omni, tests, docker
    • If this PR involves multiple modules, separate them with , like [diffusion, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][diffusion, fsdp] feat: new rollout scheduler

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

  • Read the Contribute Guide.
  • Apply pre-commit checks: pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=always
  • Add / Update the documentation.
  • Add unit or end-to-end test(s) to the CI workflow to cover all the code. If not feasible, explain why: ...

@knlnguyen1802 knlnguyen1802 merged commit eefca1b into knlnguyen1802:stepwise_fix May 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces step_scheduler and post_decode methods to vllm_omni_rollout_adapter.py to support trajectory collection (latents, log-probabilities, and timesteps) during step-by-step execution, ensuring consistency with the standard rollout behavior. It also updates prepare_encode to initialize SDE-related parameters and state variables. A review comment identifies that the default sde_window end index excludes the final denoising step, which would lead to an incomplete trajectory for RL training, and suggests extending the range to include all timesteps.

).item()
sde_window = (start, start + sde_window_size)
else:
sde_window = (0, len(timesteps) - 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The default sde_window end index is set to len(timesteps) - 1, which excludes the final denoising step from the collected trajectory. In the diffuse loop (and the new step_scheduler), the condition i < sde_window[1] is used to collect latents and log-probabilities. By ending at len(timesteps) - 1, the last latent (the final output) and the last step's log-probability are not captured in all_latents and all_log_probs, leading to an incomplete trajectory for RL training. This should be changed to len(timesteps) to cover the full range of steps. Note that this same logic exists in the forward method (line 772) and should ideally be updated there as well for consistency, although that line is outside the current diff hunks.

Suggested change
sde_window = (0, len(timesteps) - 1)
sde_window = (0, len(timesteps))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants