Skip to content

Run InterGeneratorRouter inside a monarch actor - #4069

Open
pzhan9 wants to merge 1 commit into
pytorch:mainfrom
pzhan9:inter_generator_router_actor
Open

Run InterGeneratorRouter inside a monarch actor#4069
pzhan9 wants to merge 1 commit into
pytorch:mainfrom
pzhan9:inter_generator_router_actor

Conversation

@pzhan9

@pzhan9 pzhan9 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

InterGeneratorRouter has mutable states such as generator load and lifecycle state. Its current implementation is not safe to share across threads or processes. This blocks it from being used concurrently from multiple processes.

To solve this problem, this PR add a InterGeneratorRouterActor, which is a Monarch Actor wrapper. This actor is spawned on its dedicate process as a singleton Monarch actor mesh. In this way, the router can be accessed concurrently through this actor.

Currently the actor is only used by controller. This PR is mainly to set up the stage so we later can:

  1. Put Rollouters on a process pool, where each process needs its own router access.
  2. Put router behind a HTTP endpoint, where the HTTP server is in its own process, or maybe even a different host.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 5, 2026
@pzhan9
pzhan9 force-pushed the inter_generator_router_actor branch from 2b4cda7 to 34393d0 Compare August 5, 2026 18:28
@pzhan9
pzhan9 requested review from felipemello1 and tianyu-l August 5, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants