Skip to content

Commit df5e9c5

Browse files
YeAnbangTongLi3701
andauthored
[ColossalChat] Update RLHF V2 (#5286)
* Add dpo. Fix sft, ppo, lora. Refactor all * fix and tested ppo * 2 nd round refactor * add ci tests * fix ci * fix ci * fix readme, style * fix readme style * fix style, fix benchmark * reproduce benchmark result, remove useless files * rename to ColossalChat * use new image * fix ci workflow * fix ci * use local model/tokenizer for ci tests * fix ci * fix ci * fix ci * fix ci timeout * fix rm progress bar. fix ci timeout * fix ci * fix ci typo * remove 3d plugin from ci temporary * test environment * cannot save optimizer * support chat template * fix readme * fix path * test ci locally * restore build_or_pr * fix ci data path * fix benchmark * fix ci, move ci tests to 3080, disable fast tokenizer * move ci to 85 * support flash attention 2 * add all-in-one data preparation script. Fix colossal-llama2-chat chat template * add hardware requirements * move ci test data * fix save_model, add unwrap * fix missing bos * fix missing bos; support grad accumulation with gemini * fix ci * fix ci * fix ci * fix llama2 chat template config * debug sft * debug sft * fix colossalai version requirement * fix ci * add sanity check to prevent NaN loss * fix requirements * add dummy data generation script * add dummy data generation script * add dummy data generation script * add dummy data generation script * update readme * update readme * update readme and ignore * fix logger bug * support parallel_output * modify data preparation logic * fix tokenization * update lr * fix inference * run pre-commit --------- Co-authored-by: Tong Li <tong.li352711588@gmail.com>
1 parent 36c4bb2 commit df5e9c5

File tree

200 files changed

+8850
-8051
lines changed

Some content is hidden

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

200 files changed

+8850
-8051
lines changed

.github/workflows/run_chatgpt_examples.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,44 @@ jobs:
1919
runs-on: [self-hosted, gpu]
2020
container:
2121
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
22-
options: --gpus all --rm -v /data/scratch/github_actions/chat:/data/scratch/github_actions/chat --shm-size=10.24gb
23-
timeout-minutes: 30
22+
options: --gpus all --rm -v /data/scratch/examples-data:/data/scratch/examples-data --shm-size=10.24gb
23+
timeout-minutes: 60
2424
defaults:
2525
run:
2626
shell: bash
2727
steps:
2828
- name: Checkout ColossalAI
2929
uses: actions/checkout@v2
3030

31+
- name: Install Colossal-AI
32+
run: |
33+
BUILD_EXT=1 pip install -v -e .
34+
3135
- name: Install ChatGPT
3236
run: |
33-
cd applications/Chat
37+
cd applications/ColossalChat
3438
pip install -v .
39+
export BUILD_EXT=1
3540
pip install -r examples/requirements.txt
3641
3742
- name: Install Transformers
3843
run: |
39-
pip install transformers==4.30.2
44+
pip install transformers==4.34.1
4045
4146
- name: Execute Examples
4247
run: |
43-
cd applications/Chat
48+
cd applications/ColossalChat
4449
rm -rf ~/.cache/colossalai
45-
./tests/test_inference.sh
46-
./tests/test_benchmarks.sh
50+
mkdir models
51+
mkdir sft_data
52+
mkdir prompt_data
53+
mkdir preference_data
54+
./tests/test_data_preparation.sh
4755
./tests/test_train.sh
4856
env:
4957
NCCL_SHM_DISABLE: 1
5058
MAX_JOBS: 8
51-
SFT_DATASET: /data/scratch/github_actions/chat/data.json
52-
PROMPT_DATASET: /data/scratch/github_actions/chat/prompts_en.jsonl
53-
PRETRAIN_DATASET: /data/scratch/github_actions/chat/alpaca_data.json
59+
PRETRAINED_MODEL_PATH: ./models
60+
SFT_DATASET: ./sft_data
61+
PROMPT_DATASET: ./prompt_data
62+
PREFERENCE_DATASET: ./preference_data

.github/workflows/run_chatgpt_unit_tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: [self-hosted, gpu]
2222
container:
2323
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
24-
options: --gpus all --rm -v /data/scratch/chatgpt:/data/scratch/chatgpt
24+
options: --gpus all --rm -v /data/scratch/examples-data:/data/scratch/examples-data
2525
timeout-minutes: 30
2626
defaults:
2727
run:
@@ -32,15 +32,17 @@ jobs:
3232

3333
- name: Install ChatGPT
3434
run: |
35-
cd applications/Chat
35+
cd applications/ColossalChat
3636
pip install -v .
37-
pip install -r requirements-test.txt
37+
pip install pytest
3838
3939
- name: Execute Unit Testing
4040
run: |
41-
cd applications/Chat
41+
cd applications/ColossalChat
4242
rm -rf ~/.cache/colossalai
4343
pytest tests/
44+
cd ./tests
45+
./test_templating.sh
4446
env:
4547
NCCL_SHM_DISABLE: 1
4648
MAX_JOBS: 8

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,7 @@ coverage.xml
159159
# ignore testmon and coverage files
160160
.coverage
161161
.testmondata*
162+
163+
# log, test files - ColossalChat
164+
applications/ColossalChat/logs
165+
applications/ColossalChat/tests/logs

applications/Chat/benchmarks/README.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

applications/Chat/benchmarks/benchmark_opt_lora_dummy.py

Lines changed: 0 additions & 208 deletions
This file was deleted.

applications/Chat/coati/dataset/__init__.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)