File tree Expand file tree Collapse file tree 5 files changed +85
-29
lines changed
Expand file tree Collapse file tree 5 files changed +85
-29
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,30 @@ source .venv/bin/activate
123123pip install -e .[dev]
124124# for zsh
125125pip install -e .\[ dev\]
126+
127+ # Install flash-attn after all dependencies are installed
128+ # Note: flash-attn will take a long time to compile, please be patient.
129+ pip install flash-attn -v
130+ # Try the following command if you encounter errors during installation
131+ # pip install flash-attn -v --no-build-isolation
126132```
127133
134+ Installation from docker:
128135
136+ We provided a dockerfile for Trinity-RFT (trinity)
129137
130- Installation with pip:
131- (coming soon)
138+ ``` shell
139+ git clone https://github.com/modelscope/Trinity-RFT
140+ cd Trinity-RFT
132141
142+ # build the docker image
143+ # Note: you can edit the dockerfile to customize the environment
144+ # e.g., use pip mirrors or set api key
145+ docker build -f scripts/docker/Dockerfile -t trinity-rft:latest .
146+
147+ # run the docker image
148+ docker run -it --gpus all --shm-size=" 64g" --rm -v $PWD :/workspace -v < root_path_of_data_and_checkpoints> :/data trinity-rft:latest
149+ ```
133150
134151
135152### Step 2: prepare dataset and model
@@ -263,18 +280,6 @@ Please refer to [this document](./docs/sphinx_doc/source/tutorial/trinity_progra
263280This project is currently under active development, and we welcome contributions from the community!
264281
265282
266-
267- Installation for development :
268-
269- ` ` ` shell
270- # for bash
271- pip install -e .[dev]
272- # for zsh
273- pip install -e .\[ dev\]
274- ` ` `
275-
276-
277-
278283Code style check :
279284
280285` ` ` shell
Original file line number Diff line number Diff line change @@ -115,12 +115,31 @@ source .venv/bin/activate
115115pip install -e .[dev]
116116# for zsh
117117pip install -e .\[ dev\]
118+
119+ # Install flash-attn after all dependencies are installed
120+ # Note: flash-attn will take a long time to compile, please be patient.
121+ pip install flash-attn -v
122+ # Try the following command if you encounter errors during installation
123+ # pip install flash-attn -v --no-build-isolation
118124```
119125
120126
127+ Installation from docker:
128+
129+ We provided a dockerfile for Trinity-RFT (trinity)
130+
131+ ``` shell
132+ git clone https://github.com/modelscope/Trinity-RFT
133+ cd Trinity-RFT
134+
135+ # build the docker image
136+ # Note: you can edit the dockerfile to customize the environment
137+ # e.g., use pip mirrors or set api key
138+ docker build -f scripts/docker/Dockerfile -t trinity-rft:latest .
121139
122- Installation with pip:
123- (coming soon)
140+ # run the docker image
141+ docker run -it --gpus all --shm-size=" 64g" --rm -v $PWD :/workspace -v < root_path_of_data_and_checkpoints> :/data trinity-rft:latest
142+ ```
124143
125144
126145
@@ -255,18 +274,6 @@ Please refer to [this document](tutorial/trinity_programming_guide.md).
255274This project is currently under active development, and we welcome contributions from the community!
256275
257276
258-
259- Installation for development :
260-
261- ` ` ` shell
262- # for bash
263- pip install -e .[dev]
264- # for zsh
265- pip install -e .\[ dev\]
266- ` ` `
267-
268-
269-
270277Code style check :
271278
272279` ` ` shell
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ dependencies = [
2323 " ray==2.43.0" ,
2424 " vllm==0.8.3" ,
2525 " tensordict==0.6.2" ,
26- " redis" ,
2726 " wandb" ,
2827 " omegaconf" ,
2928 " sqlalchemy" ,
Original file line number Diff line number Diff line change 1+ # Build and run the docker image with the following command:
2+ #
3+ # cd <Trinity-RFT root dir>
4+ # docker build -f scripts/docker/Dockerfile -t trinity-rft:latest .
5+ # docker run -it --gpus all --shm-size="64g" --rm -v $PWD:/workspace -v <root_path_of_data_and_checkpoints>:/data trinity-rft:latest
6+
7+
8+ FROM nvcr.io/nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
9+
10+ WORKDIR /workspace
11+
12+ RUN apt update && apt install -y \
13+ build-essential \
14+ curl \
15+ git \
16+ wget \
17+ vim \
18+ tmux \
19+ python3 \
20+ python3-pip \
21+ python3-dev \
22+ python3-packaging \
23+ && rm -rf /var/lib/apt/lists/* \
24+ && ln -sf /usr/bin/python3 /usr/bin/python
25+
26+
27+ # For Aliyun users: update pip mirror to aliyun to speed up pip install
28+ RUN pip config set global.index-url http://mirrors.cloud.aliyuncs.com/pypi/simple/ \
29+ && pip config set global.trusted-host mirrors.cloud.aliyuncs.com
30+
31+ # copy the Trinity-RFT dir into the workspace
32+ COPY . .
33+
34+ RUN pip install --upgrade pip && pip install -e .[dev] && pip install flash-attn
35+
36+ # Set Env variables
37+
38+ # WANDB
39+ # ENV WANDB_API_KEY=
40+ # ENV WANDB_BASE_URL=
41+
42+ # LLM API
43+ # ENV OPENAI_API_KEY=
44+ # ENV DASH_API_KEY=
Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ def synchronize_config(self, config: Config) -> None:
268268 self .trainer .nnodes = config .cluster .node_num - rollout_node_num
269269 self .actor_rollout_ref .model .path = config .model .model_path
270270 self .critic .model .path = config .model .critic_model_path
271+ self .critic .model .tokenizer_path = config .model .critic_model_path
271272
272273 if config .cluster .node_num == 1 :
273274 # for single node scenarios, rollout and training are on the same node
You can’t perform that action at this time.
0 commit comments