Skip to content

Commit 56058ba

Browse files
committed
update document And fix unittest
1 parent f944d8d commit 56058ba

File tree

9 files changed

+82
-39
lines changed

9 files changed

+82
-39
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ Choose one of the following options:
191191
conda create -n trinity python=3.12
192192
conda activate trinity
193193

194-
pip install -e ".[verl]"
195-
pip install -e ".[flash_attn]"
194+
pip install -e ".[vllm,flash_attn]"
196195

197-
# If you have no GPU, comment out the two lines above and uncomment this instead:
196+
# If you have no GPU, comment out the line above and uncomment this instead:
198197
# pip install -e ".[tinker]"
199198

200199
# If you encounter issues when installing flash-attn, try:
@@ -209,10 +208,9 @@ pip install -e ".[dev]" # for development like linting and debugging
209208
python3.10 -m venv .venv
210209
source .venv/bin/activate
211210

212-
pip install -e ".[verl]"
213-
pip install -e ".[flash_attn]"
211+
pip install -e ".[vllm,flash_attn]"
214212

215-
# If you have no GPU, comment out the two lines above and uncomment this instead:
213+
# If you have no GPU, comment out the line above and uncomment this instead:
216214
# pip install -e ".[tinker]"
217215

218216
# If you encounter issues when installing flash-attn, try:
@@ -226,7 +224,10 @@ pip install -e ".[dev]" # for development like linting and debugging
226224
[`uv`](https://github.com/astral-sh/uv) is a modern Python package installer.
227225

228226
```bash
229-
uv sync --extra verl --extra dev --extra flash_attn
227+
uv sync --extra vllm --extra dev --extra flash_attn
228+
229+
# If you have no GPU, try to use Tinker instead:
230+
# uv sync --extra tinker --extra dev
230231
```
231232

232233

README_zh.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ cd Trinity-RFT
190190
conda create -n trinity python=3.12
191191
conda activate trinity
192192

193-
pip install -e ".[verl]"
194-
pip install -e ".[flash_attn]"
193+
pip install -e ".[vllm,flash_attn]"
195194

196-
# 如果没有GPU,可以注释上两行的命令,改为使用Tinker:
195+
# 如果没有GPU,可以注释上一行的命令,改为使用Tinker:
197196
# pip install -e ".[tinker]"
198197

199198
# 如果安装 flash-attn 时遇到问题,可尝试:
@@ -208,10 +207,9 @@ pip install -e ".[dev]" # 用于调试和开发
208207
python3.10 -m venv .venv
209208
source .venv/bin/activate
210209

211-
pip install -e ".[verl]"
212-
pip install -e ".[flash_attn]"
210+
pip install -e ".[vllm,flash_attn]"
213211

214-
# 如果没有GPU,可以注释上两行的命令,改为使用Tinker:
212+
# 如果没有GPU,可以注释上一行的命令,改为使用Tinker:
215213
# pip install -e ".[tinker]"
216214

217215
# 如果安装 flash-attn 时遇到问题,可尝试:
@@ -225,7 +223,10 @@ pip install -e ".[dev]" # 用于调试和开发
225223
[`uv`](https://github.com/astral-sh/uv) 是现代的 Python 包管理工具。
226224

227225
```bash
228-
uv sync --extra verl --extra dev --extra flash_attn
226+
uv sync --extra vllm --extra dev --extra flash_attn
227+
228+
# 如果没有GPU,可以改为使用Tinker:
229+
# uv sync --extra tinker --extra dev
229230
```
230231

231232
## 通过 PyPI 安装

docs/sphinx_doc/source/tutorial/trinity_installation.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33

44
For installing Trinity-RFT, you have three options: from source (recommended), via PyPI, or using Docker.
55

6-
Before installing, ensure your system meets the following requirements:
6+
**Before you begin**, check your system setup:
77

8-
- **Python**: Version 3.10 to 3.12 (inclusive)
9-
- **CUDA**: Version >= 12.8
10-
- **GPUs**: At least 2 GPUs
8+
### If you have GPUs and want to use them:
9+
Make sure your system meets these requirements:
10+
- **Python**: 3.10 – 3.12
11+
- **CUDA**: 12.8 or higher
12+
- **GPUs**: At least 2 available
13+
14+
### If you don’t have GPUs (or prefer not to use them):
15+
You can use the `tinker` option instead, which only requires:
16+
- **Python**: 3.11 – 3.12
17+
- **GPUs**: Not required
1118

1219
---
1320

@@ -32,10 +39,15 @@ Choose one of the following options:
3239
conda create -n trinity python=3.12
3340
conda activate trinity
3441

35-
pip install -e ".[dev]"
36-
pip install -e ".[flash_attn]"
37-
# if you encounter issues when installing flash-attn, try:
42+
pip install -e ".[vllm,flash_attn]"
43+
44+
# If you have no GPU, comment out the line above and uncomment this instead:
45+
# pip install -e ".[tinker]"
46+
47+
# If you encounter issues when installing flash-attn, try:
3848
# pip install flash-attn==2.8.1 --no-build-isolation
49+
50+
pip install -e ".[dev]" # for development like linting and debugging
3951
```
4052

4153
#### Using venv
@@ -44,18 +56,26 @@ pip install -e ".[flash_attn]"
4456
python3.10 -m venv .venv
4557
source .venv/bin/activate
4658

47-
pip install -e ".[dev]"
48-
pip install -e ".[flash_attn]"
49-
# if you encounter issues when installing flash-attn, try:
59+
pip install -e ".[vllm,flash_attn]"
60+
61+
# If you have no GPU, comment out the line above and uncomment this instead:
62+
# pip install -e ".[tinker]"
63+
64+
# If you encounter issues when installing flash-attn, try:
5065
# pip install flash-attn==2.8.1 --no-build-isolation
66+
67+
pip install -e ".[dev]" # for development like linting and debugging
5168
```
5269

5370
#### Using `uv`
5471

5572
[`uv`](https://github.com/astral-sh/uv) is a modern Python package installer.
5673

5774
```bash
58-
uv sync --extra dev --extra flash_attn
75+
uv sync --extra vllm --extra dev --extra flash_attn
76+
77+
# If you have no GPU, try to use Tinker instead:
78+
# uv sync --extra tinker --extra dev
5979
```
6080

6181
---

docs/sphinx_doc/source_zh/tutorial/trinity_installation.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33

44
安装 Trinity-RFT 有三种方式:源码安装(推荐)、通过 PyPI 安装,或使用 Docker。
55

6-
在安装前,请确保您的系统满足以下要求
6+
**开始之前**,请检查您的系统配置
77

8-
- **Python**:3.10 至 3.12(包含)
9-
- **CUDA**:大于等于 12.8
10-
- **GPU**:至少 2 块 GPU
8+
### 如果您拥有 GPU 并希望使用它们:
9+
请确保您的系统满足以下要求:
10+
- **Python**:3.10 – 3.12
11+
- **CUDA**:12.8 或更高版本
12+
- **GPU**:至少 2 块可用
13+
14+
### 如果您没有 GPU(或不希望使用 GPU):
15+
您可以改用 `tinker` 选项,该选项仅需满足:
16+
- **Python**:3.11 – 3.12
17+
- **GPU**:无需
1118

1219
---
1320

@@ -32,10 +39,15 @@ cd Trinity-RFT
3239
conda create -n trinity python=3.12
3340
conda activate trinity
3441

35-
pip install -e ".[dev]"
36-
pip install -e ".[flash_attn]"
42+
pip install -e ".[vllm,flash_attn]"
43+
44+
# 如果没有GPU,可以注释上一行的命令,改为使用Tinker:
45+
# pip install -e ".[tinker]"
46+
3747
# 如果安装 flash-attn 时遇到问题,可尝试:
3848
# pip install flash-attn==2.8.1 --no-build-isolation
49+
50+
pip install -e ".[dev]" # 用于调试和开发
3951
```
4052

4153
#### 使用 venv
@@ -44,18 +56,26 @@ pip install -e ".[flash_attn]"
4456
python3.10 -m venv .venv
4557
source .venv/bin/activate
4658

47-
pip install -e ".[dev]"
48-
pip install -e ".[flash_attn]"
59+
pip install -e ".[vllm,flash_attn]"
60+
61+
# 如果没有GPU,可以注释上一行的命令,改为使用Tinker:
62+
# pip install -e ".[tinker]"
63+
4964
# 如果安装 flash-attn 时遇到问题,可尝试:
5065
# pip install flash-attn==2.8.1 --no-build-isolation
66+
67+
pip install -e ".[dev]" # 用于调试和开发
5168
```
5269

5370
#### 使用 `uv`
5471

5572
[`uv`](https://github.com/astral-sh/uv) 是现代的 Python 包管理工具。
5673

5774
```bash
58-
uv sync --extra dev --extra flash_attn
75+
uv sync --extra vllm --extra dev --extra flash_attn
76+
77+
# 如果没有GPU,可以改为使用Tinker:
78+
# uv sync --extra tinker --extra dev
5979
```
6080

6181
---

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ classifiers = [
2121
]
2222
requires-python = ">=3.10,<3.13"
2323
dependencies = [
24+
"verl==0.5.0",
2425
"ray[default]>=2.50.0",
2526
"tensordict",
2627
"wandb",
@@ -48,8 +49,7 @@ dependencies = [
4849
trinity = "trinity.cli.launcher:main"
4950

5051
[project.optional-dependencies]
51-
verl = [
52-
"verl==0.5.0",
52+
vllm = [
5353
"vllm>=0.10.2,<=0.11.0",
5454
]
5555
data = [

scripts/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN chmod 1777 /tmp && apt update && apt install -y \
2727
# copy the Trinity-RFT dir into the workspace
2828
COPY . .
2929

30-
RUN pip install --upgrade pip && pip install -e .[verl,mm,dev] && pip install flash_attn==2.8.1 --no-build-isolation
30+
RUN pip install --upgrade pip && pip install -e .[vllm,mm,dev] && pip install flash_attn==2.8.1 --no-build-isolation
3131

3232
# Set Env variables
3333

scripts/docker/Dockerfile.megatron

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ COPY . .
2828

2929
# Install Trinity-RFT with Megatron
3030
RUN pip install --upgrade pip \
31-
&& pip install -e .[verl,mm,dev] \
31+
&& pip install -e .[vllm,mm,dev] \
3232
&& pip install flash_attn==2.8.1 --no-build-isolation \
3333
&& pip install -e .[megatron] \
3434
&& NVCC_APPEND_FLAGS="--threads 4" APEX_PARALLEL_BUILD=8 pip install -v \

scripts/docker/Dockerfile.uv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN pip install uv && uv venv /opt/venv --python=python3.12
3535

3636
# Install minimal Trinity-RFT
3737
RUN . /opt/venv/bin/activate && \
38-
uv pip install -e.[verl,mm,dev]
38+
uv pip install -e.[vllm,mm,dev]
3939

4040
# Install flash_attn and Megatron
4141
RUN . /opt/venv/bin/activate && \

tests/trainer/trainer_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ async def test_serve_with_trainer(self): # noqa: C901
980980
trainer_config = deepcopy(config)
981981
trainer_config.mode = "train"
982982
trainer_config.check_and_update()
983+
trainer_config.trainer.max_actor_ckpt_to_keep = 10
983984

984985
trainer_process = multiprocessing.Process(target=run_trainer, args=(trainer_config,))
985986
trainer_process.start()

0 commit comments

Comments
 (0)