Skip to content

[WIP] lmms-engine RL infra - #186

Open
pufanyi wants to merge 27 commits into
mainfrom
pufanyi/rl
Open

[WIP] lmms-engine RL infra#186
pufanyi wants to merge 27 commits into
mainfrom
pufanyi/rl

Conversation

@pufanyi

@pufanyi pufanyi commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator
image

pufanyi and others added 24 commits July 1, 2026 21:28
- Introduced a new shell script `run_vizdoom_qwen3_5_4b.sh` for launching the RL training with VizDoom.
- Created a configuration file `vizdoom_qwen3_5_4b.yaml` for specifying training parameters and dataset configurations.
- Implemented `lmms_eval` paths and task loader to facilitate the integration of LMMS evaluation with RL training.
- Developed `FSDP2GRPORLTrainer` class for handling the training process, including rollout management and checkpointing.
- Enhanced the training step to compute GRPO loss and manage policy weight synchronization.
- Added utility functions for managing RL configurations and data loading.
- Implemented RL training loop in `src/lmms_engine/launch/rl.py`.
- Introduced `TransformersChatModelServer` for model serving in `src/lmms_engine/rl/model_server/hf.py`.
- Created GRPO training adapters in `src/lmms_engine/train/rl/grpo/` including configuration and payload handling.
- Developed `RLTrainRunner` for managing online RL training in `src/lmms_engine/train/rl/runner.py`.
- Added necessary utility functions and data processing for RL training.
- Created a new configuration file `_vizdoom.ini` for ViZDoom with paths for IWADs, auto-execution scripts, and global settings.
- Introduced a new module `lmms_engine.rl.ray` with classes for managing Ray cluster specifications, worker descriptors, and resource planning.
- Implemented `RayNodeScheduler` for managing node roles and starting Ray clusters.
- Added `RayRLMultinodeRuntime` to facilitate multi-node reinforcement learning training.
- Developed training logic in `train.py` to integrate Ray Train with the RL training framework.
- Updated InMemoryDataBuffer to resolve global train batch size and minimum trajectories from config.
- Enforced explicit model server requirement in build_rollout_episode_specs for RL rollout tasks.
- Enhanced Ray model server initialization with runtime environment settings and validation for GPU resources.
- Modified VLLMChatModelServer to accept new parameters for chat template content format and multimodal processor kwargs.
- Improved RayClusterSpec and RayResourcePlan to derive configurations from a provided dictionary instead of environment variables.
- Implemented sharding for RL train batches to ensure proper distribution across multiple workers.
- Added validation for vLLM model server configurations to ensure compliance with expected structure.
- Updated training engine configuration to remove deprecated parameters and enforce new structure.
…nd logging

- Added support for policy weight synchronization in the RLTrainRunner class, including configuration options for initial synchronization and draining inflight rollouts.
- Implemented logging for training rank placement and shard balance during training.
- Introduced a new method to build a weight synchronization client for Ray actors.
- Enhanced the sharding of training batches to balance trajectory steps across GPUs.
- Added new utility functions for managing weight synchronization directories and validating configurations.
- Created a smoke test for weight synchronization across multiple GPUs, ensuring proper actor placement and checkpoint validation.
- Developed unit tests for orchestrator backpressure handling and policy weight synchronization functionality.
@Luodian
Luodian requested review from Luodian and kcz358 July 6, 2026 06:17
@Luodian Luodian changed the title [WIP] RL [WIP] lmms-engine RL infra Jul 6, 2026
pufanyi and others added 3 commits July 6, 2026 20:16
- Added disk delta functionality for efficient weight synchronization, including publishing and applying deltas.
- Introduced ModelServerManager to manage multiple model servers by role, supporting ray_actor_pool and external OpenAI-compatible servers.
- Created ReferenceLogprobAnnotator for annotating trajectories with log probabilities from a reference model.
- Enhanced unit tests for policy model server validation, trajectory annotation, and resource planning in Ray.
- Refactored existing code to support new features and improve maintainability.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can split this into a different config in examples and pass with --config-name and --config-path to split with original default config

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe can put this into examples rl or in docs.

Comment thread rl_design.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same for this

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