Skip to content

[FEAT][executors]: implement TP-Aware fast forward pass for Reward/Critic models #44

Open

Description

@Flink-ddd

Description:

Context:

For large-scale alignment, our Reward/Critic models are often sharded across multiple GPUs using Tensor Parallelism. When the rollout engine (vLLM) produces sequences, passing these sequences directly to a TP-sharded DeepSpeed/Megatron reward model introduces severe communication bottlenecks if not handled carefully.

Tasks:

  1. Extend rl_engine/executors/bridge.py to support passing rollout token IDs to a TP-sharded PyTorch process group.
  2. Implement a specialized forward-pass wrapper that minimizes All-Reduce calls across the TP group when computing the final scalar reward per sequence.
  3. Ensure that scalar rewards are efficiently broadcasted back to the policy rollout ranks.

Activity

  1. added
    component: executors
    component: distributed
    on May 31, 2026
  2. fusheng-ji commented on Oct 11, 2026

    @fusheng-ji
    Contributor

    Hi @Flink-ddd, I’ve opened PR #548 to implement the TP-aware Reward/Critic forward feature proposed here:

    • Transfer rollout tokens, masks, positions and sample order through explicit process groups.
    • Pool the last valid token before reducing only [B] scalar rewards, with explicit replicated / local_sum head contracts.
    • Return sequence rewards to the rollout ranks.

    The implementation also includes token-level Critic values and a synchronous PPO loop with independent Actor/Critic TP groups, followed by acknowledged rollout weight installation.

    Validation covers CPU/Gloo TP=1/2/4 and real Megatron Core, DeepSpeed and vLLM integration. Both framework paths completed two PPO rounds on four dedicated B200 GPUs, including weight updates and prefix-cache invalidation. These checks use small FP32 GPT models; production-scale performance remains unvalidated.

    Could you review the process-group interfaces and scalar-head reduction semantics, and share your thoughts on the expanded PPO scope? The branch still needs migration to the current repository layout before merge, so early design feedback would be helpful.

    Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: distributedcomponent: executors

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions