Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge into rubra-9b #2

Merged
merged 119 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
8e04794
fix packages
hiyouga Mar 17, 2024
bea31b9
Update wechat.jpg
hiyouga Mar 18, 2024
df9b4fb
Updated README with new information
Mar 20, 2024
0531dac
Updated README with new information
khazic Mar 20, 2024
8d10fa7
Updated README with new information
khazic Mar 20, 2024
a773035
Merge pull request #2903 from khazic/main
hiyouga Mar 20, 2024
e165965
Follow HF_ENDPOINT environment variable
SirlyDreamer Mar 20, 2024
7b8f502
fix #2346
hiyouga Mar 20, 2024
9bec3c9
fix #2777 #2895
hiyouga Mar 20, 2024
b2dfbd7
Merge pull request #2905 from SirlyDreamer/main
hiyouga Mar 20, 2024
3271af2
add orca_dpo_pairs dataset
hiyouga Mar 20, 2024
8408225
support fsdp + qlora
hiyouga Mar 20, 2024
bfe7a91
update readme
hiyouga Mar 20, 2024
c3b80d6
update tool extractor
sanjay920 Mar 20, 2024
9cd6ef8
Merge branch 'hiyouga:main' into main
sanjay920 Mar 21, 2024
0581bfd
paper release
hiyouga Mar 21, 2024
5eaa50f
add citation
hiyouga Mar 21, 2024
9670262
move file
hiyouga Mar 21, 2024
675ba41
Update README.md, fix the release date of the paper
0xez Mar 21, 2024
be03603
Update README_zh.md, fix the release date of the paper
0xez Mar 22, 2024
ce261fd
Merge pull request #2919 from 0xez/main
hiyouga Mar 22, 2024
564d57a
Update wechat.jpg
hiyouga Mar 22, 2024
a1c8c98
fix #2941
hiyouga Mar 23, 2024
7afbc85
fix #2928
hiyouga Mar 23, 2024
140ad4a
fix #2936
hiyouga Mar 23, 2024
c1e2c4e
fix Llama lora merge crash
marko1616 Mar 23, 2024
51349ea
fix Llama lora merge crash
marko1616 Mar 23, 2024
6f080fd
fix Llama lora merge crash
marko1616 Mar 23, 2024
c8f0d99
pass ruff check
marko1616 Mar 24, 2024
49f9dbb
Merge pull request #2945 from marko1616/bugfix/lora-model-merge
hiyouga Mar 25, 2024
558a538
tiny fix
hiyouga Mar 25, 2024
b02899b
Update requirements.txt
rkinas Mar 25, 2024
f33a3df
Merge pull request #2963 from rkinas/patch-1
hiyouga Mar 25, 2024
bb4ca16
Update README_zh.md
Tsumugii24 Mar 25, 2024
6f2b563
release v0.6.0
hiyouga Mar 25, 2024
1484f76
add arg check
hiyouga Mar 25, 2024
7aa77a3
Update README_zh.md
Tsumugii24 Mar 25, 2024
1704599
Update README.md
Tsumugii24 Mar 25, 2024
f633ac6
Merge pull request #2967 from Tsumugii24/main
hiyouga Mar 25, 2024
7b3d818
update readme
hiyouga Mar 25, 2024
98a42cb
tiny fix
hiyouga Mar 25, 2024
ba70aca
release v0.6.0 (real)
hiyouga Mar 25, 2024
7ea1a1f
Update wechat.jpg
hiyouga Mar 26, 2024
511f675
fix #2961
hiyouga Mar 26, 2024
3164b4f
fix bug
hiyouga Mar 26, 2024
b29d556
fix #2981
hiyouga Mar 26, 2024
3bcd41b
fix ds optimizer
hiyouga Mar 26, 2024
8c77b10
update trainers
hiyouga Mar 28, 2024
b19c148
fix #3010
hiyouga Mar 28, 2024
6c94305
update readme
hiyouga Mar 28, 2024
8d603f8
fix #2982
hiyouga Mar 28, 2024
1e43319
add project
hiyouga Mar 28, 2024
c1fe6ce
update readme
hiyouga Mar 28, 2024
ca79302
release v0.6.1
hiyouga Mar 29, 2024
a0333bb
Update wechat.jpg
hiyouga Mar 29, 2024
9c2ef9c
fix pile datset hf hub url
yunhaoli24 Mar 30, 2024
831c532
upgrade gradio to 4.21.0
hiyouga Mar 30, 2024
257f643
Merge pull request #3053 from lealaxy/main
hiyouga Mar 30, 2024
7a086ed
support save args in webui #2807 #3046
hiyouga Mar 30, 2024
eb178ea
Fix Llama model save for full param train
marko1616 Mar 30, 2024
d9a5134
fix blank line contains whitespace
marko1616 Mar 30, 2024
de3564f
Merge pull request #3057 from marko1616/bugfix/lora-model-merge
hiyouga Mar 30, 2024
27776c3
tiny fix
hiyouga Mar 30, 2024
17bf8a2
support ORPO
hiyouga Mar 31, 2024
5195add
support orpo in webui
hiyouga Mar 31, 2024
a81d88b
Merge pull request #3066 from hiyouga/orpo
hiyouga Mar 31, 2024
099db6a
update readme
hiyouga Mar 31, 2024
68aaa49
use log1p in orpo loss
hiyouga Mar 31, 2024
5907216
fix plots
hiyouga Mar 31, 2024
5b9b404
fix IPO and ORPO loss
hiyouga Apr 1, 2024
816d714
fix ORPO loss
hiyouga Apr 1, 2024
d0842f6
update webui
hiyouga Apr 1, 2024
eb259cc
support infer 4bit model on GPUs #3023
hiyouga Apr 1, 2024
aee634c
fix #3077
hiyouga Apr 1, 2024
54b7d34
add qwen1.5 moe
hiyouga Apr 1, 2024
4a6ca62
fix #3083
hiyouga Apr 1, 2024
dd73a0c
set dev version
hiyouga Apr 1, 2024
a86ae17
Update SECURITY.md
hiyouga Apr 1, 2024
9ddbe28
fix #3022
hiyouga Apr 2, 2024
b267aeb
add moe aux loss control #3085
hiyouga Apr 2, 2024
92dab8a
simplify readme
hiyouga Apr 2, 2024
949e5fe
update readme
hiyouga Apr 2, 2024
11a6c1b
update readme
hiyouga Apr 2, 2024
31ffbde
update examples
hiyouga Apr 2, 2024
f22eaeb
update examples
hiyouga Apr 2, 2024
7765f33
add zh readme
hiyouga Apr 2, 2024
fc7f1cc
update examples
hiyouga Apr 2, 2024
66b0fe4
update readme
hiyouga Apr 2, 2024
49a2dfa
update vllm example
hiyouga Apr 2, 2024
f0a9245
Update wechat.jpg
hiyouga Apr 3, 2024
ce77d98
fix #3116
hiyouga Apr 3, 2024
148bda3
fix resize vocab at inference #3022
hiyouga Apr 3, 2024
7f6e412
fix requires for windows
hiyouga Apr 3, 2024
5ddcecd
fix bug in latest gradio
hiyouga Apr 3, 2024
4b920f2
back to gradio 4.21 and fix chat
hiyouga Apr 3, 2024
a6d9438
tiny fix
hiyouga Apr 3, 2024
b87f8f1
update examples
hiyouga Apr 4, 2024
a88fe8c
update readme
hiyouga Apr 6, 2024
77044d9
support Qwen1.5-32B
sliderSun Apr 7, 2024
21650d4
support Qwen1.5-32B
sliderSun Apr 7, 2024
1d117b7
fix spell error
sliderSun Apr 7, 2024
2565a32
support https://github.com/hiyouga/LLaMA-Factory/issues/3152
codemayq Apr 7, 2024
5a780e9
rename template to breeze
codemayq Apr 7, 2024
ff4d313
Merge pull request #3160 from sliderSun/main
hiyouga Apr 7, 2024
34bdcba
rename template to breeze
codemayq Apr 7, 2024
7b76b4c
add empty line
codemayq Apr 7, 2024
e79e153
Update wechat.jpg
hiyouga Apr 8, 2024
98ad2cc
Merge branch 'main' of https://github.com/hiyouga/LLaMA-Factory
hiyouga Apr 8, 2024
4c6c4a0
Merge pull request #3161 from hiyouga/feature/add-mediatek-model
hiyouga Apr 8, 2024
9a99fbc
tiny fix
hiyouga Apr 8, 2024
7f6c248
fix quant infer and qwen2moe
hiyouga Apr 9, 2024
b5eefe5
Pass additional_target to unsloth
kno10 Apr 9, 2024
2111b58
Update adapter.py
hiyouga Apr 9, 2024
98bc97d
Update adapter.py
hiyouga Apr 9, 2024
caf8373
Merge pull request #3201 from kno10/patch-1 and fix #3200
hiyouga Apr 9, 2024
a99f5ed
fix #3225
hiyouga Apr 10, 2024
51d0a1a
Merge branch 'main' of https://github.com/hiyouga/LLaMA-Factory
hiyouga Apr 10, 2024
45778e2
Merge branch 'main' into main
tybalex Apr 10, 2024
27c9dd1
Merge branch 'rubra-9b' into tempmain
tybalex Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reporting Security Issues

To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/electron/electron/security/advisories/new) tab.
To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/hiyouga/LLaMA-Factory/security/advisories/new) tab.

We will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.

Expand Down
37 changes: 37 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cff-version: 1.2.0
date-released: 2024-03
message: "If you use this software, please cite it as below."
authors:
- family-names: "Zheng"
given-names: "Yaowei"
- family-names: "Zhang"
given-names: "Richong"
- family-names: "Zhang"
given-names: "Junhao"
- family-names: "Ye"
given-names: "Yanhan"
- family-names: "Luo"
given-names: "Zheyan"
- family-names: "Ma"
given-names: "Yongqiang"
title: "LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models"
url: "https://arxiv.org/abs/2403.13372"
preferred-citation:
type: article
authors:
- family-names: "Zheng"
given-names: "Yaowei"
- family-names: "Zhang"
given-names: "Richong"
- family-names: "Zhang"
given-names: "Junhao"
- family-names: "Ye"
given-names: "Yanhan"
- family-names: "Luo"
given-names: "Zheyan"
- family-names: "Ma"
given-names: "Yongqiang"
journal: "arXiv preprint arXiv:2403.13372"
title: "LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models"
url: "https://arxiv.org/abs/2403.13372"
year: 2024
465 changes: 91 additions & 374 deletions README.md

Large diffs are not rendered by default.

438 changes: 91 additions & 347 deletions README_zh.md

Large diffs are not rendered by default.

Binary file modified assets/wechat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ If you are using a custom dataset, please provide your dataset definition in the

Given above, you can use the custom dataset via specifying `--dataset dataset_name`.

----

Currently we support dataset in **alpaca** or **sharegpt** format, the dataset in alpaca format should follow the below format:

```json
Expand Down Expand Up @@ -84,6 +86,10 @@ For the preference datasets, the `response` column should be a string list whose
}
```

Remember to set `"ranking": true` for the preference datasets.

----

The dataset in sharegpt format should follow the below format:

```json
Expand Down
6 changes: 6 additions & 0 deletions data/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

添加后可通过指定 `--dataset 数据集名称` 参数使用自定义数据集。

----

该项目目前支持两种格式的数据集:**alpaca** 和 **sharegpt**,其中 alpaca 格式的数据集按照以下方式组织:

```json
Expand Down Expand Up @@ -84,6 +86,10 @@
}
```

添加偏好数据集需要额外指定 `"ranking": true`。

----

而 sharegpt 格式的数据集按照以下方式组织:

```json
Expand Down
7 changes: 5 additions & 2 deletions data/belle_multiturn/belle_multiturn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import os
import json
import datasets


_HF_ENDPOINT = os.getenv("HF_ENDPOINT", "https://huggingface.co")

_DESCRIPTION = "BELLE multiturn chat dataset."

_CITATION = """\
Expand All @@ -13,9 +16,9 @@
}
"""

_HOMEPAGE = "https://huggingface.co/datasets/BelleGroup/multiturn_chat_0.8M"
_HOMEPAGE = "{}/datasets/BelleGroup/multiturn_chat_0.8M".format(_HF_ENDPOINT)
_LICENSE = "gpl-3.0"
_URL = "https://huggingface.co/datasets/BelleGroup/multiturn_chat_0.8M/resolve/main/multiturn_chat_0.8M.json"
_URL = "{}/datasets/BelleGroup/multiturn_chat_0.8M/resolve/main/multiturn_chat_0.8M.json".format(_HF_ENDPOINT)


class BelleMultiturn(datasets.GeneratorBasedBuilder):
Expand Down
23 changes: 20 additions & 3 deletions data/dataset_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,14 @@
"ms_hub_url": "AI-ModelScope/WizardLM_evol_instruct_V2_196k",
"formatting": "sharegpt"
},
"glaive_toolcall_100k": {
"hf_hub_url": "hiyouga/glaive-function-calling-v2-sharegpt",
"formatting": "sharegpt",
"columns": {
"messages": "conversations",
"tools": "tools"
}
},
"cosmopedia": {
"hf_hub_url": "HuggingFaceTB/cosmopedia",
"columns": {
Expand Down Expand Up @@ -536,6 +544,16 @@
"file_sha1": "515b18ed497199131ddcc1af950345c11dc5c7fd",
"ranking": true
},
"orca_rlhf": {
"file_name": "orca_rlhf.json",
"file_sha1": "acc8f74d16fd1fc4f68e7d86eaa781c2c3f5ba8e",
"ranking": true,
"columns": {
"prompt": "question",
"response": "answer",
"system": "system"
}
},
"nectar_rm": {
"hf_hub_url": "mlinmg/RLAIF-Nectar",
"ms_hub_url": "AI-ModelScope/RLAIF-Nectar",
Expand Down Expand Up @@ -587,12 +605,11 @@
}
},
"pile": {
"hf_hub_url": "EleutherAI/pile",
"hf_hub_url": "monology/pile-uncopyrighted",
"ms_hub_url": "AI-ModelScope/pile",
"columns": {
"prompt": "text"
},
"subset": "all"
}
},
"skypile": {
"hf_hub_url": "Skywork/SkyPile-150B",
Expand Down
7 changes: 4 additions & 3 deletions data/hh_rlhf_en/hh_rlhf_en.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import os
import json
import datasets
from typing import List


_HF_ENDPOINT = os.getenv("HF_ENDPOINT", "https://huggingface.co")
_DESCRIPTION = "Human preference data about helpfulness and harmlessness."
_CITATION = ""
_HOMEPAGE = "https://huggingface.co/datasets/Anthropic/hh-rlhf"
_HOMEPAGE = "{}/datasets/Anthropic/hh-rlhf".format(_HF_ENDPOINT)
_LICENSE = "mit"
_URL = "https://huggingface.co/datasets/Anthropic/hh-rlhf/resolve/main/"
_URL = "{}/datasets/Anthropic/hh-rlhf/resolve/main/".format(_HF_ENDPOINT)
_URLS = {
"train": [
_URL + "harmless-base/train.jsonl.gz",
Expand Down
102,874 changes: 102,874 additions & 0 deletions data/orca_rlhf.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions data/ultra_chat/ultra_chat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import json
import datasets
from typing import List

_HF_ENDPOINT = os.getenv("HF_ENDPOINT", "https://huggingface.co")

_DESCRIPTION = "UltraChat: Large-scale, Informative, and Diverse Multi-round Dialogue Data."

Expand All @@ -16,9 +18,9 @@
}
"""

_HOMEPAGE = "https://huggingface.co/datasets/stingning/ultrachat"
_HOMEPAGE = "{}/datasets/stingning/ultrachat".format(_HF_ENDPOINT)
_LICENSE = "cc-by-nc-4.0"
_BASE_DATA_URL = "https://huggingface.co/datasets/stingning/ultrachat/resolve/main/train_{idx}.jsonl"
_BASE_DATA_URL = "{}/datasets/stingning/ultrachat/resolve/main/train_{{idx}}.jsonl".format(_HF_ENDPOINT)


class UltraChat(datasets.GeneratorBasedBuilder):
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
- ./hf_cache:/root/.cache/huggingface/
- ./data:/app/data
- ./output:/app/output
environment:
- CUDA_VISIBLE_DEVICES=0
ports:
- "7860:7860"
ipc: host
Expand Down
43 changes: 43 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
We provide diverse examples about fine-tuning LLMs.

```
examples/
├── lora_single_gpu/
│ ├── pretrain.sh: Do pre-training
│ ├── sft.sh: Do supervised fine-tuning
│ ├── reward.sh: Do reward modeling
│ ├── ppo.sh: Do PPO training
│ ├── dpo.sh: Do DPO training
│ ├── orpo.sh: Do ORPO training
│ ├── prepare.sh: Save tokenized dataset
│ └── predict.sh: Do batch predict
├── qlora_single_gpu/
│ ├── bitsandbytes.sh: Fine-tune 4/8-bit BNB models
│ ├── gptq.sh: Fine-tune 4/8-bit GPTQ models
│ ├── awq.sh: Fine-tune 4-bit AWQ models
│ └── aqlm.sh: Fine-tune 2-bit AQLM models
├── lora_multi_gpu/
│ ├── single_node.sh: Fine-tune model with Accelerate on single node
│ └── multi_node.sh: Fine-tune model with Accelerate on multiple nodes
├── full_multi_gpu/
│ ├── single_node.sh: Fine-tune model with DeepSpeed on single node
│ └── multi_node.sh: Fine-tune model with DeepSpeed on multiple nodes
├── merge_lora/
│ ├── merge.sh: Merge LoRA weights into the pre-trained models
│ └── quantize.sh: Quantize fine-tuned model with AutoGPTQ
├── inference/
│ ├── cli_demo.sh: Launch a command line interface
│ ├── api_demo.sh: Launch an OpenAI-style API
│ ├── web_demo.sh: Launch a web interface
│ └── evaluate.sh: Evaluate model on the MMLU benchmark
└── extras/
├── galore/
│ └── sft.sh: Fine-tune model with GaLore
├── loraplus/
│ └── sft.sh: Fine-tune model with LoRA+
├── llama_pro/
│ ├── expand.sh: Expand layers in the model
│ └── sft.sh: Fine-tune expanded model
└── fsdp_qlora/
└── sft.sh: Fine-tune quantized model with FSDP
```
43 changes: 43 additions & 0 deletions examples/README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
我们提供了多样化的示例脚本。

```
examples/
├── lora_single_gpu/
│ ├── pretrain.sh: 进行预训练
│ ├── sft.sh: 进行指令监督微调
│ ├── reward.sh: 进行奖励模型训练
│ ├── ppo.sh: 进行 PPO 训练
│ ├── dpo.sh: 进行 DPO 训练
│ ├── orpo.sh: 进行 ORPO 训练
│ ├── prepare.sh: 保存预处理后的数据集
│ └── predict.sh: 进行批量预测
├── qlora_single_gpu/
│ ├── bitsandbytes.sh: 微调 4/8 比特 BNB 模型
│ ├── gptq.sh: 微调 4/8 比特 GPTQ 模型
│ ├── awq.sh: 微调 4 比特 AWQ 模型
│ └── aqlm.sh: 微调 2 比特 AQLM 模型
├── lora_multi_gpu/
│ ├── single_node.sh: 使用 Accelerate 进行单节点训练
│ └── multi_node.sh: 使用 Accelerate 进行多节点训练
├── full_multi_gpu/
│ ├── single_node.sh: 使用 DeepSpeed 进行单节点训练
│ └── multi_node.sh: 使用 DeepSpeed 进行多节点训练
├── merge_lora/
│ ├── merge.sh: 将 LoRA 权重合并到预训练模型中
│ └── quantize.sh: 使用 AutoGPTQ 量化模型
├── inference/
│ ├── cli_demo.sh: 启动命令行推理接口
│ ├── api_demo.sh: 启动 OpenAI 风格 API
│ ├── web_demo.sh: 启动浏览器推理接口
│ └── evaluate.sh: 在 MMLU 数据集上评测模型
└── extras/
├── galore/
│ └── sft.sh: 使用 GaLore 训练模型
├── loraplus/
│ └── sft.sh: 使用 LoRA+ 训练模型
├── llama_pro/
│ ├── expand.sh: 扩展模型中的层
│ └── sft.sh: 训练扩展后的模型
└── fsdp_qlora/
└── sft.sh: 使用 FSDP 微调量化模型
```
25 changes: 25 additions & 0 deletions examples/accelerate/fsdp_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
compute_environment: LOCAL_MACHINE
debug: false
distributed_type: FSDP
downcast_bf16: 'no'
fsdp_config:
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
fsdp_backward_prefetch: BACKWARD_PRE
fsdp_cpu_ram_efficient_loading: true
fsdp_forward_prefetch: false
fsdp_offload_params: true
fsdp_sharding_strategy: FULL_SHARD
fsdp_state_dict_type: FULL_STATE_DICT
fsdp_sync_module_states: true
fsdp_use_orig_params: false
machine_rank: 0
main_training_function: main
mixed_precision: fp16
num_machines: 1 # the number of nodes
num_processes: 2 # the number of GPUs in all nodes
rdzv_backend: static
same_network: true
tpu_env: []
tpu_use_cluster: false
tpu_use_sudo: false
use_cpu: false
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ main_process_ip: 192.168.0.1
main_process_port: 29555
main_training_function: main
mixed_precision: fp16
num_machines: 2
num_processes: 16
num_machines: 2 # the number of nodes
num_processes: 16 # the number of GPUs in all nodes
rdzv_backend: static
same_network: true
tpu_env: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ gpu_ids: all
machine_rank: 0
main_training_function: main
mixed_precision: fp16
num_machines: 1
num_processes: 4
num_machines: 1 # the number of nodes
num_processes: 4 # the number of GPUs in all nodes
rdzv_backend: static
same_network: true
tpu_env: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ main_process_ip: 192.168.0.1
main_process_port: 29555
main_training_function: main
mixed_precision: fp16
num_machines: 2
num_processes: 16
num_machines: 2 # the number of nodes
num_processes: 16 # the number of GPUs in all nodes
rdzv_backend: static
same_network: true
tpu_env: []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
#!/bin/bash

CUDA_VISIBLE_DEVICES=0 python ../../../src/train_bash.py \
pip install "transformers>=4.39.1"
pip install "accelerate>=0.28.0"
pip install "bitsandbytes>=0.43.0"

CUDA_VISIBLE_DEVICES=0,1 accelerate launch \
--config_file ../../accelerate/fsdp_config.yaml \
../../../src/train_bash.py \
--stage sft \
--do_train \
--model_name_or_path meta-llama/Llama-2-7b-hf \
--model_name_or_path meta-llama/Llama-2-70b-hf \
--dataset alpaca_gpt4_en,glaive_toolcall \
--dataset_dir ../../../data \
--template default \
--finetuning_type full \
--optim adamw_8bit \
--output_dir ../../../saves/LLaMA2-7B/galore/sft \
--finetuning_type lora \
--lora_target q_proj,v_proj \
--output_dir ../../../saves/LLaMA2-70B/lora/sft \
--overwrite_cache \
--overwrite_output_dir \
--cutoff_len 1024 \
--preprocessing_num_workers 16 \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 1 \
--gradient_accumulation_steps 1 \
--gradient_accumulation_steps 4 \
--lr_scheduler_type cosine \
--logging_steps 10 \
--warmup_steps 20 \
Expand All @@ -28,5 +34,7 @@ CUDA_VISIBLE_DEVICES=0 python ../../../src/train_bash.py \
--num_train_epochs 3.0 \
--max_samples 3000 \
--val_size 0.1 \
--ddp_timeout 180000000 \
--quantization_bit 4 \
--plot_loss \
--pure_bf16
--fp16
Loading