Skip to content

Commit c4fb880

Browse files
committed
Merge main into PR #2351
Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
2 parents 175ad4c + 86c97a3 commit c4fb880

80 files changed

Lines changed: 4720 additions & 575 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/pr-test.yml‎

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ jobs:
265265
"test_file": "test_qwen3.5_0.8B_gsm8k_short.py"
266266
},
267267
{
268-
"num_gpus": 4,
269-
"test_file": "test_qwen3.5_0.8B_gsm8k_async_short.py"
268+
"num_gpus": 2,
269+
"test_file": "test_qwen2.5_0.5B_score_centering.py"
270270
},
271271
{
272272
"num_gpus": 8,
@@ -673,6 +673,18 @@ jobs:
673673
"num_gpus": 0,
674674
"test_file": "test_policy_loss.py"
675675
},
676+
{
677+
"num_gpus": 0,
678+
"test_file": "test_score_centering.py"
679+
},
680+
{
681+
"num_gpus": 0,
682+
"test_file": "test_score_centering_binary.py"
683+
},
684+
{
685+
"num_gpus": 0,
686+
"test_file": "test_score_centering_transport.py"
687+
},
676688
{
677689
"num_gpus": 0,
678690
"test_file": "test_ppo_logprob_entropy.py"
@@ -733,6 +745,22 @@ jobs:
733745
"num_gpus": 0,
734746
"test_file": "test_fully_async_rollout.py"
735747
},
748+
{
749+
"num_gpus": 0,
750+
"test_file": "test_rollout_buffer_order.py"
751+
},
752+
{
753+
"num_gpus": 0,
754+
"test_file": "test_server_control.py"
755+
},
756+
{
757+
"num_gpus": 0,
758+
"test_file": "test_cuda_stack_offload.py"
759+
},
760+
{
761+
"num_gpus": 0,
762+
"test_file": "test_r3_spill.py"
763+
},
736764
{
737765
"num_gpus": 0,
738766
"test_file": "test_rollout_sample_hooks.py"
@@ -1097,8 +1125,8 @@ jobs:
10971125
"test_file": "test_qwen3.5_0.8B_gsm8k_short.py"
10981126
},
10991127
{
1100-
"num_gpus": 4,
1101-
"test_file": "test_qwen3.5_0.8B_gsm8k_async_short.py"
1128+
"num_gpus": 2,
1129+
"test_file": "test_qwen2.5_0.5B_score_centering.py"
11021130
},
11031131
{
11041132
"num_gpus": 8,
@@ -1227,7 +1255,7 @@ jobs:
12271255
FIRST=true
12281256
for filepath in $CHANGED; do
12291257
# Extract NUM_GPUS from the test file, default to 8
1230-
NGPU=$(grep -oP '^NUM_GPUS\s*=\s*\K\d+' "$filepath" | head -1)
1258+
NGPU=$(grep -m1 -oP '^NUM_GPUS\s*=\s*\K\d+' "$filepath" || true)
12311259
NGPU=${NGPU:-8}
12321260
if [ "$FIRST" = true ]; then FIRST=false; else MATRIX+=","; fi
12331261
MATRIX+="{\"test_file\":\"$filepath\",\"num_gpus\":$NGPU}"

‎.github/workflows/pr-test.yml.j2‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{'test_file': 'test_qwen2.5_0.5B_fanout_short.py', 'num_gpus': 4},
2525
{'test_file': 'test_qwen3_4B_streaming_partial_rollout.py', 'num_gpus': 8},
2626
{'test_file': 'test_qwen3.5_0.8B_gsm8k_short.py', 'num_gpus': 4},
27-
{'test_file': 'test_qwen3.5_0.8B_gsm8k_async_short.py', 'num_gpus': 4},
27+
{'test_file': 'test_qwen2.5_0.5B_score_centering.py', 'num_gpus': 2},
2828
{'test_file': 'test_qwen3_4B_ckpt.py', 'test_args': '--save-optimizer gpu --load-optimizer gpu', 'num_gpus': 8},
2929
{'test_file': 'test_qwen3_4B_ckpt.py', 'test_args': '--save-optimizer gpu --load-optimizer cpu', 'num_gpus': 8},
3030
{'test_file': 'test_qwen3_4B_ckpt.py', 'test_args': '--save-optimizer cpu --load-optimizer cpu', 'num_gpus': 8},
@@ -94,6 +94,9 @@
9494
{'test_file': 'test_ppo_kl_metric.py', 'num_gpus': 0},
9595
{'test_file': 'test_cispo_loss.py', 'num_gpus': 0},
9696
{'test_file': 'test_policy_loss.py', 'num_gpus': 0},
97+
{'test_file': 'test_score_centering.py', 'num_gpus': 0},
98+
{'test_file': 'test_score_centering_binary.py', 'num_gpus': 0},
99+
{'test_file': 'test_score_centering_transport.py', 'num_gpus': 0},
97100
{'test_file': 'test_ppo_logprob_entropy.py', 'num_gpus': 0},
98101
{'test_file': 'test_discounted_returns.py', 'num_gpus': 0},
99102
{'test_file': 'test_block_fp8_zero_block.py', 'num_gpus': 0},
@@ -109,6 +112,10 @@
109112
{'test_file': 'test_filter_long_prompt.py', 'num_gpus': 0},
110113
{'test_file': 'test_read_file_slicing.py', 'num_gpus': 0},
111114
{'test_file': 'test_fully_async_rollout.py', 'num_gpus': 0},
115+
{'test_file': 'test_rollout_buffer_order.py', 'num_gpus': 0},
116+
{'test_file': 'test_server_control.py', 'num_gpus': 0},
117+
{'test_file': 'test_cuda_stack_offload.py', 'num_gpus': 0},
118+
{'test_file': 'test_r3_spill.py', 'num_gpus': 0},
112119
{'test_file': 'test_rollout_sample_hooks.py', 'num_gpus': 0},
113120
{'test_file': 'test_hf_to_megatron.py', 'num_gpus': 0},
114121
{'test_file': 'test_qwen3_5_vl_native.py', 'num_gpus': 0},
@@ -334,7 +341,7 @@ jobs:
334341
FIRST=true
335342
for filepath in $CHANGED; do
336343
# Extract NUM_GPUS from the test file, default to 8
337-
NGPU=$(grep -oP '^NUM_GPUS\s*=\s*\K\d+' "$filepath" | head -1)
344+
NGPU=$(grep -m1 -oP '^NUM_GPUS\s*=\s*\K\d+' "$filepath" || true)
338345
NGPU=${NGPU:-8}
339346
if [ "$FIRST" = true ]; then FIRST=false; else MATRIX+=","; fi
340347
MATRIX+="{\"test_file\":\"$filepath\",\"num_gpus\":$NGPU}"

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Choosing SGLang as the single rollout backend is also intentional. Multi-backend
5151

5252
## Correctness, Stability, and CI
5353

54-
slime is developed as RL infrastructure, where "the script runs" is not enough. The project maintains CPU unit tests, contract tests for customization hooks, and GPU end-to-end tests covering dense and MoE models, Megatron training paths, SGLang deployment configurations, checkpointing, numerical precision, async rollout, OPD, PPO-style workflows, and debug rollout-then-train replay.
54+
slime is developed as RL infrastructure, where "the script runs" is not enough. The project maintains CPU unit tests, contract tests for customization hooks, and GPU end-to-end tests covering dense and MoE models, Megatron training paths, SGLang deployment configurations, checkpointing, numerical precision, fully-async rollout, OPD, PPO-style workflows, and debug rollout-then-train replay.
5555

5656
Useful engineering docs:
5757

@@ -131,7 +131,7 @@ These are not just demos. They are independent systems that use slime as a reusa
131131

132132
### 🦞 OpenClaw-RL: Train a Personalized Clawbot Simply by Talking to It
133133

134-
[**OpenClaw-RL**](https://github.com/Gen-Verse/OpenClaw-RL) is an RL server for personalized OpenClaw agents. It hosts the OpenClaw model and improves it from prior conversations across deployments, while slime's asynchronous RL infrastructure prevents training from interfering with API serving. It supports two automatic optimization methods: GRPO with binary feedback inferred from subsequent states, and on-policy distillation that extracts hindsight hints from later feedback for the current policy.
134+
[**OpenClaw-RL**](https://github.com/Gen-Verse/OpenClaw-RL) is an RL server for personalized OpenClaw agents. It hosts the OpenClaw model and improves it from prior conversations across deployments, while slime's decoupled RL infrastructure prevents training from interfering with API serving. It supports two automatic optimization methods: GRPO with binary feedback inferred from subsequent states, and on-policy distillation that extracts hindsight hints from later feedback for the current policy.
135135

136136
### ⚛️ P1: Mastering Physics Olympiads with Reinforcement Learning
137137

‎README_zh.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ slime 不只是一个能调用推理后端的框架。它尽量保留 Megatron
5151

5252
## 正确性、稳定性与 CI
5353

54-
slime 被当作 RL 基础设施来开发,因为“脚本能跑起来”远远不够。项目维护 CPU unit test、customization hook contract test,以及 GPU end-to-end test,覆盖 dense 和 MoE 模型、Megatron training path、SGLang deployment config、checkpoint、数值精度、async rollout、OPD、PPO-style workflow,以及 debug rollout-then-train replay。
54+
slime 被当作 RL 基础设施来开发,因为“脚本能跑起来”远远不够。项目维护 CPU unit test、customization hook contract test,以及 GPU end-to-end test,覆盖 dense 和 MoE 模型、Megatron training path、SGLang deployment config、checkpoint、数值精度、fully-async rollout、OPD、PPO-style workflow,以及 debug rollout-then-train replay。
5555

5656
相关工程文档:
5757

@@ -133,7 +133,7 @@ slime 被当作 RL 基础设施来开发,因为“脚本能跑起来”远远
133133

134134
### 🦞 OpenClaw-RL: Train a Personalized Clawbot Simply by Talking to It
135135

136-
[**OpenClaw-RL**](https://github.com/Gen-Verse/OpenClaw-RL) 是面向 personalized OpenClaw agent 的 RL server。它托管 OpenClaw model,并从跨部署的历史对话中持续改进模型,同时 slime 的 asynchronous RL infrastructure 避免训练过程干扰 API serving。它支持两种自动优化方法:基于后续状态推断 binary feedback 的 GRPO,以及从后续反馈中提取 hindsight hint 的 on-policy distillation。
136+
[**OpenClaw-RL**](https://github.com/Gen-Verse/OpenClaw-RL) 是面向 personalized OpenClaw agent 的 RL server。它托管 OpenClaw model,并从跨部署的历史对话中持续改进模型,同时 slime 的 decoupled RL infrastructure 避免训练过程干扰 API serving。它支持两种自动优化方法:基于后续状态推断 binary feedback 的 GRPO,以及从后续反馈中提取 hindsight hint 的 on-policy distillation。
137137

138138
### ⚛️ P1: Mastering Physics Olympiads with Reinforcement Learning
139139

‎docker/npu_patch/slime.patch‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,14 +678,13 @@ diff --git a/slime/utils/external_utils/command_utils.py b/slime/utils/external_
678678
index 9f51ecdf..d4b47eca 100644
679679
--- a/slime/utils/external_utils/command_utils.py
680680
+++ b/slime/utils/external_utils/command_utils.py
681-
@@ -184,6 +184,108 @@ def execute_train(
681+
@@ -184,6 +184,107 @@ def execute_train(
682682
f"{train_args}"
683683
)
684684

685685
+def execute_train_npu(
686686
+ train_args: str,
687687
+ megatron_model_type: str | None,
688-
+ train_script: str = "train.py",
689688
+ before_ray_job_submit=None,
690689
+ extra_env_vars=None,
691690
+ config: ExecuteTrainConfig | None = None,
@@ -780,7 +779,7 @@ index 9f51ecdf..d4b47eca 100644
780779
+ f"{cmd_megatron_model_source}"
781780
+ f'ray job submit --address="http://127.0.0.1:8265" '
782781
+ f"--runtime-env-json='{runtime_env_json}' "
783-
+ f"-- python3 {train_script} "
782+
+ f"-- python3 train.py "
784783
+ f"{'${MODEL_ARGS[@]}' if megatron_model_type is not None else ''} "
785784
+ f"{train_args}"
786785
+ )

0 commit comments

Comments
 (0)