Skip to content

Conversation

@dongju-2
Copy link
Contributor

@dongju-2 dongju-2 commented Nov 28, 2025

What does this PR do?

Problem
When using VLM with Ulysses sequence parallelism in PPO training, the critic and reward model did not function correctly. The actor module already had proper implementation for handling VLM inputs with sequence parallel, but this logic was missing from the critic/rm modules.

Solution
Applied the same VLM + Ulysses sequence parallel handling logic from the actor to the critic and reward model
Ensures consistent behavior across all model components during PPO training

Changes
Updated workers/critic/dp_critic.py and workers/fsdp_workers.py to properly handle VLM inputs with sequence parallel
Aligned the implementation with the existing logic in workers/actor/dp_actor.py for VLM + sequence parallel support

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, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, 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][fsdp, megatron] feat: dynamic batching

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.

@CLAassistant
Copy link

CLAassistant commented Nov 28, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

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

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 aims to fix support for Vision Language Models (VLM) with Ulysses sequence parallelism in the critic and reward models, aligning their behavior with the actor model. The changes include adding necessary configurations and updating the forward pass logic in dp_critic.py and fsdp_workers.py. The refactoring in compute_rm_score is a good improvement for clarity and memory efficiency. However, I've identified a critical bug in fsdp_workers.py where the processed multi-modal inputs are not being passed to the reward model, which would prevent VLM from functioning correctly.

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