Skip to content

feat(ezpz): validate multi-host RL actor placement - #26

Merged
saforem2 merged 7 commits into
ezpzfrom
feat/ezpz-postmerge-validation
Sep 25, 2026
Merged

saforem2 merged 7 commits into
ezpzfrom
feat/ezpz-postmerge-validation

Conversation

@saforem2

@saforem2 saforem2 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add a scheduler-SPMD entry point and Sunspot validation launcher for placing the RL trainer and vLLM generator on separate hosts in one Monarch actor graph. Use Gloo for cross-host TorchStore weight transfer, retain host dimensions when slicing role meshes, tolerate full RL startup during attach, and remove the stale import of upstream's deleted breakable_cuda_graph_env helper.

Validation

  • 12478702: two-host Monarch actor preflight, distinct host identities, exit 0.
  • 12478711: exact head 738109e8d4481ebb723622db0d1a34b9c8907203, trainer host 0 / generator host 1, TransportType.Gloo, pre/post vLLM validation, three finite GRPO updates, policy versions 0→3, 40/40 completed nonzero-reward rollouts, checkpoints at steps 1/2/3, PBS Exit_status=0.
  • Focused flake8/µfmt and exact Sunspot RL-environment imports/py_compile passed.

Prior controlled failures

The launcher fails closed for host-local automatic TorchStore storage across nodes; forcing Gloo is required. Intermediate jobs also exposed and fixed stale upstream API use, attach timeout, dimension-dropping host slices, and an overly short coordination-store timeout.

Summary by Sourcery

Validate RL trainer and vLLM generator execution across separate hosts in a single Monarch actor graph.

New Features:

  • Add scheduler-SPMD entry points for validating and running a two-host Monarch RL actor graph with trainer and vLLM generator placement on separate hosts.
  • Add a Sunspot validation job covering cross-host TorchStore synchronization, vLLM generation, finite GRPO training, rollouts, and checkpoint creation.

Bug Fixes:

  • Remove the stale dependency on the deleted upstream CUDA graph environment helper.
  • Prevent multi-host role provisioning from losing host dimensions and allow complete RL startup and coordination to exceed previous timeouts.
  • Ensure cross-host policy-weight transfer uses a transport compatible with remote hosts.

Enhancements:

  • Preserve explicit host-based trainer and generator placement for multi-host RL execution.

Documentation:

  • Document the successful two-host Sunspot validation, acceptance evidence, controlled failures, and topology limitations.

Tests:

  • Add a multi-host actor preflight that verifies actors run on distinct physical hosts.

@sourcery-ai sourcery-ai 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.

Sorry @saforem2, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 19 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds scheduler-launched two-host validation for an RL controller whose trainer and vLLM generator run in separate host slices of one Monarch actor graph, using explicit cross-host TorchStore/Gloo coordination and lifecycle synchronization. It also hardens attach and store timeouts, preserves host topology during placement, and removes a stale deleted upstream helper dependency.

Sequence diagram for two-host RL actor validation

sequenceDiagram
    participant Scheduler
    participant Rank0 as Controller rank 0
    participant Rank1 as Scheduler rank 1
    participant Store as FileStore / Gloo
    participant Hosts as Monarch host mesh
    participant Trainer as RL trainer host 0
    participant Generator as vLLM generator host 1

    Scheduler->>Rank0: launch multihost_train_upstream.py
    Scheduler->>Rank1: launch multihost_train_upstream.py
    Rank0->>Store: host_mesh_from_store(..., transport=tcp)
    Rank1->>Store: host_mesh_from_store(..., transport=tcp)
    Rank0->>Hosts: spawn_proc_mesh(host slices 0 and 1)
    Hosts->>Trainer: create trainer mesh
    Hosts->>Generator: create generator mesh
    Rank0->>Trainer: Controller.setup_async()
    Rank0->>Generator: start vLLM and attach
    Trainer->>Generator: transfer weights via Gloo TorchStore
    Rank0->>Trainer: Controller.run()
    Trainer-->>Rank0: complete RL updates and validation
    Rank0->>Hosts: shutdown()
    Rank0->>Store: set multihost_rl_done
    Rank1->>Store: get multihost_rl_done
Loading

File-Level Changes

Change Details Files
Add scheduler-SPMD launchers that construct and validate a single two-host Monarch actor graph with explicit trainer/generator placement.
  • Discover scheduler rank and initialize a shared FileStore-backed host mesh.
  • Preflight actor placement by probing hostnames and requiring one actor per distinct host.
  • Run the RL controller with the trainer on host 0 and the sole vLLM generator on host 1.
  • Coordinate non-controller ranks through the full RL lifecycle before allowing launcher exit.
torchtitan/experiments/ezpz/rl/scripts/grpo/multihost_actor_preflight.py
torchtitan/experiments/ezpz/rl/scripts/grpo/multihost_train_upstream.py
torchtitan/experiments/ezpz/rl/scripts/grpo/agpt2b_multihost_torchstore_validate.pbs
Make cross-host TorchStore coordination and RL startup robust for the validation workflow.
  • Use Gloo-compatible host-mesh transport and extend the FileStore timeout to cover startup, training, transfers, and shutdown.
  • Configure a longer Monarch mesh attach timeout.
  • Preserve host dimensions when slicing trainer and generator meshes.
torchtitan/experiments/ezpz/rl/scripts/grpo/multihost_train_upstream.py
Remove reliance on the deleted upstream CUDA-graph environment helper.
  • Delete the stale helper import.
  • Pass no generator environment override when spawning the generator mesh.
torchtitan/experiments/ezpz/rl/train_upstream.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@saforem2
saforem2 merged commit c7605bf into ezpz Sep 25, 2026
2 checks passed
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.

1 participant