Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
nohup.out

*.png
*.pyc
*/checkpoint_dir
Expand Down Expand Up @@ -134,6 +136,7 @@ celerybeat.pid
venv/
env.bak/
venv.bak/
.project_conda_env/

# Spyder project settings
.spyderproject
Expand Down Expand Up @@ -169,4 +172,13 @@ log
# examples

output/
.vscode/
.vscode/

.roo/
.claude/
.history/
*.excp
logs/
tmp/
.ml_tracker/
:/
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Leveraging a multi-role distributed architecture with Ray for flexible resource
[RewardFL](https://alibaba.github.io/ROLL/docs/User%20Guides/Algorithms/Reward_FL)

#### Backend
[DeepSpeed](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/deepspeed)
[FSDP2](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/fsdp2)
[Megatron](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/megatron)
[vLLM](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/vllm)
[SGLang](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/sglang)
Expand Down Expand Up @@ -141,7 +141,7 @@ Leveraging a multi-role distributed architecture with Ray for flexible resource
* Out-of-the-box support for reinforcement learning algorithms, such as **PPO, GRPO, Reinforce++, TOPR, RAFT++, GSPO**, etc.
* **Rich Training and Inference Engine:** Ray-based multi-role distributed architecture; Strategy abstraction unifies various backends, enabling easy operation from single machines to thousands-of-GPU clusters.
* Inference/Generation supports vLLM, SGLang.
* Training supports DeepSpeed (ZeRO), Megatron-LM 5D parallelism (mcore-adapter, dp/tp/pp/cp/ep), FSDP under implementation.
* Training supports FSDP2, Megatron-LM 5D parallelism (mcore-adapter, dp/tp/pp/cp/ep).
* Extreme offload/reload capabilities.
* Supports [LoRA](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/lora) training.
* Supports FP8 rollout (FP8 inference for LLM as judge, FP8 rollout with BF16 training under development).
Expand All @@ -161,6 +161,7 @@ Leveraging a multi-role distributed architecture with Ray for flexible resource
- [ComplementaryRL](https://arxiv.org/abs/2603.17621): Complementary RL is a learning framework that enables agents to effectively learn from experience through the seamless co-evolution of an experience extractor and a policy actor within the RL optimization loop.
- [RLix](https://github.com/rlops/rlix): RLix is an RL job manager that lets more RL jobs run concurrently with less waiting by sharing GPU capacity across jobs, while preserving each pipeline’s training behavior and improving GPU utilization.
- [TurningPoint-GRPO](https://arxiv.org/abs/2602.06422): A GRPO framework for Flow Matching models in text-to-image generation that alleviates step-wise reward sparsity by modeling step-level incremental rewards and explicitly captures long-term effects via turning points detection, providing dense learning signals for each denoising action.
- [SocioReasoner](https://github.com/AMAP-ML/SocioReasoner): A vision-language method for urban socio-semantic segmentation that employs a render-and-refine mechanism optimized by RL to identify abstract social entities using satellite and map data.
- [STAgent](https://arxiv.org/abs/2512.24957): An agentic LLM specialized for spatio-temporal understanding and complex tasks like constrained POI discovery and itinerary planning, featuring hierarchical data curation with 1:10,000 filter ratio and cascaded training (seed SFT + difficulty-aware SFT + RL), achieving strong performance on TravelBench while preserving general capabilities.
- [IPRO](https://arxiv.org/abs/2510.14255): A novel video diffusion framework using reinforcement learning to enhance identity preservation in human-centric I2V generation, optimizing diffusion models with face identity scorer and KL-divergence regularization.
- [TaoSR-SHE](https://arxiv.org/abs/2510.07972): Stepwise Hybrid Examination Reinforcement Learning Framework for Taobao Search Relevance, with SRPO (hybrid reward model + offline verifier), diversified data filtering, and multi-stage curriculum learning.
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.torch2100
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
RUN pip install --trusted-host mirrors.aliyun.com --index-url https://mirrors.aliyun.com/pypi/simple/ \
--no-build-isolation "megatron-core @ git+https://github.com/NVIDIA/Megatron-LM.git@core_dev_r0.16.0"

RUN pip install --trusted-host mirrors.aliyun.com --index-url https://mirrors.aliyun.com/pypi/simple/ \
--no-build-isolation "flash-attn>=2.8.3"

RUN pip install --trusted-host mirrors.aliyun.com --index-url https://mirrors.aliyun.com/pypi/simple/ \
"flash-linear-attention" "transformer-engine[pytorch]"
# FIXME: [pytorch] will install core-cu12 by default, install [core-cu13] after [pytorch] to override core-cu12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To integrate a new model into **ROLL**, you must supply:
| Phase | Pick ≥ 1 backend |
|-----------|-----------------|
| Inference | `vllm`, `sglang` |
| Training | `DeepSpeed`, `Megatron` |
| Training | `FSDP2`, `Megatron` |

---

Expand All @@ -30,7 +30,7 @@ https://docs.sglang.ai/supported_models/support_new_models.html

## 2. Training Strategies

### 2.1 `DeepSpeed`
### 2.1 `FSDP2`

1. Ensure your model can be loaded by
```python
Expand All @@ -41,8 +41,8 @@ https://docs.sglang.ai/supported_models/support_new_models.html
3. Make the model can be loaded in `roll/models/model_providers.py`.

Once these steps are complete, you can:
- train with the `deepspeed_train` strategy for `actor_train` worker, and
- with `hf_infer` or `deepspeed_infer` strategy for the `reference` worker.
- train with the `fsdp2_train` strategy for `actor_train` worker, and
- with `hf_infer` or `fsdp2_infer` strategy for the `reference` worker.

### 2.2 `Megatron`

Expand Down
4 changes: 2 additions & 2 deletions docs_roll/docs/Getting Started/FAQ/qa_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ gradient_accumulation_steps * per_device_train_batch_size * (world_size/tensor_m

### How to set `gradient_accumulation_steps` and `per_device_train_batch_size`?

#### For DeepSpeed Backend:
#### For FSDP2 Backend:
```
global_batch_size = per_device_train_batch_size * gradient_accumulation_steps * world_size
global_batch_size = per_device_train_batch_size * gradient_accumulation_steps * world_size / ulysses_size
```
Where `world_size` is the length of `device_mapping` for `actor_train`/`critic`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ actor_train.model_args.dtype: fp16
actor_infer.model_args.dtype: fp16
reference.model_args.dtype: fp16

# Switch the large model training framework from DeepSpeed to Megatron-LM, where parameters can be sent in batches for faster execution
# Switch the large model training framework from FSDP2 to Megatron-LM, where parameters can be sent in batches for faster execution
strategy_name: megatron_train
strategy_config:
tensor_model_parallel_size: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ actor_train.model_args.dtype: fp16
actor_infer.model_args.dtype: fp16
reference.model_args.dtype: fp16

# Switch the large model training framework from DeepSpeed to Megatron-LM, where parameters can be sent in batches for faster execution
# Switch the large model training framework from FSDP2 to Megatron-LM, where parameters can be sent in batches for faster execution
strategy_name: megatron_train
strategy_config:
tensor_model_parallel_size: 1
Expand Down
2 changes: 1 addition & 1 deletion docs_roll/docs/Overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Leveraging a multi-role distributed architecture with Ray for flexible resource
[Megatron Inference and Training Backend Configuration Guide](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/megatron)
[LoRA Fine-tuning Configuration Guide](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/lora)
[FP8 Quantization Configuration Guide](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/fp8_rollout)
[DeepSpeed Training Backend Configuration Guide](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/deepspeed)
[FSDP2 Training Backend Configuration Guide](https://alibaba.github.io/ROLL/docs/User%20Guides/Configuration/fsdp2)

#### Pipeline
[RLVR Pipeline for VLM](https://alibaba.github.io/ROLL/docs/User%20Guides/Pipeline/vl_rlvr_pipeline_start)
Expand Down
Loading
Loading