Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
LLaMA-Factory
Commits
317a82e2
Commit
317a82e2
authored
Mar 07, 2025
by
chenych
Browse files
Add QWQ-32B
parent
37b0ad9f
Changes
255
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
46 additions
and
370 deletions
+46
-370
examples/README_zh.md
examples/README_zh.md
+7
-1
examples/extras/adam_mini/qwen2_full_sft.yaml
examples/extras/adam_mini/qwen2_full_sft.yaml
+4
-4
examples/extras/apollo/llama3_full_sft.yaml
examples/extras/apollo/llama3_full_sft.yaml
+4
-4
examples/extras/badam/llama3_full_sft.yaml
examples/extras/badam/llama3_full_sft.yaml
+4
-4
examples/extras/badam/llama3_full_sft_ds3.yaml
examples/extras/badam/llama3_full_sft_ds3.yaml
+0
-42
examples/extras/badam/llama3_lora_sft.yaml
examples/extras/badam/llama3_lora_sft.yaml
+0
-41
examples/extras/fsdp_qlora/llama3_lora_sft.yaml
examples/extras/fsdp_qlora/llama3_lora_sft.yaml
+5
-4
examples/extras/fsdp_qlora/single_node.sh
examples/extras/fsdp_qlora/single_node.sh
+0
-6
examples/extras/galore/llama3_full_sft.yaml
examples/extras/galore/llama3_full_sft.yaml
+4
-4
examples/extras/llama_pro/llama3_freeze_sft.yaml
examples/extras/llama_pro/llama3_freeze_sft.yaml
+4
-4
examples/extras/loraplus/llama3_lora_sft.yaml
examples/extras/loraplus/llama3_lora_sft.yaml
+5
-4
examples/extras/mod/llama3_full_sft.yaml
examples/extras/mod/llama3_full_sft.yaml
+4
-4
examples/extras/pissa/llama3_lora_sft.yaml
examples/extras/pissa/llama3_lora_sft.yaml
+5
-4
examples/full_multi_gpu/llama3_full_predict.yaml
examples/full_multi_gpu/llama3_full_predict.yaml
+0
-23
examples/full_multi_gpu/llama3_full_sft.yaml
examples/full_multi_gpu/llama3_full_sft.yaml
+0
-41
examples/lora_multi_gpu/llama3_lora_sft.yaml
examples/lora_multi_gpu/llama3_lora_sft.yaml
+0
-41
examples/lora_multi_gpu/llama3_lora_sft_ds.yaml
examples/lora_multi_gpu/llama3_lora_sft_ds.yaml
+0
-42
examples/lora_single_gpu/llama3_lora_dpo.yaml
examples/lora_single_gpu/llama3_lora_dpo.yaml
+0
-40
examples/lora_single_gpu/llama3_lora_eval.yaml
examples/lora_single_gpu/llama3_lora_eval.yaml
+0
-19
examples/lora_single_gpu/llama3_lora_kto.yaml
examples/lora_single_gpu/llama3_lora_kto.yaml
+0
-38
No files found.
examples/README_zh.md
View file @
317a82e2
...
@@ -98,7 +98,7 @@ FORCE_TORCHRUN=1 llamafactory-cli train examples/train_lora/llama3_lora_sft_ds3.
...
@@ -98,7 +98,7 @@ FORCE_TORCHRUN=1 llamafactory-cli train examples/train_lora/llama3_lora_sft_ds3.
#### 使用 Ray 在 4 张 GPU 上微调
#### 使用 Ray 在 4 张 GPU 上微调
```
bash
```
bash
USE_RAY
=
1 llamafactory-cli train examples/train_
full
/llama3_lora_sft_ray.yaml
USE_RAY
=
1 llamafactory-cli train examples/train_
lora
/llama3_lora_sft_ray.yaml
```
```
### QLoRA 微调
### QLoRA 微调
...
@@ -170,6 +170,12 @@ llamafactory-cli export examples/merge_lora/llama3_lora_sft.yaml
...
@@ -170,6 +170,12 @@ llamafactory-cli export examples/merge_lora/llama3_lora_sft.yaml
llamafactory-cli
export
examples/merge_lora/llama3_gptq.yaml
llamafactory-cli
export
examples/merge_lora/llama3_gptq.yaml
```
```
### 保存 Ollama 配置文件
```
bash
llamafactory-cli
export
examples/merge_lora/llama3_full_sft.yaml
```
### 推理 LoRA 模型
### 推理 LoRA 模型
#### 使用 vLLM+TP 批量推理
#### 使用 vLLM+TP 批量推理
...
...
examples/extras/adam_mini/qwen2_full_sft.yaml
View file @
317a82e2
...
@@ -34,7 +34,7 @@ bf16: true
...
@@ -34,7 +34,7 @@ bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/apollo/llama3_full_sft.yaml
View file @
317a82e2
...
@@ -39,7 +39,7 @@ pure_bf16: true
...
@@ -39,7 +39,7 @@ pure_bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/badam/llama3_full_sft.yaml
View file @
317a82e2
...
@@ -37,7 +37,7 @@ lr_scheduler_type: cosine
...
@@ -37,7 +37,7 @@ lr_scheduler_type: cosine
warmup_ratio
:
0.1
warmup_ratio
:
0.1
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/badam/llama3_full_sft_ds3.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
sft
do_train
:
true
finetuning_type
:
full
use_badam
:
true
badam_mode
:
layer
badam_switch_mode
:
ascending
badam_switch_interval
:
50
badam_verbose
:
2
deepspeed
:
examples/deepspeed/ds_z3_config.json
### dataset
dataset
:
identity,alpaca_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/full/sft
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
8
learning_rate
:
1.0e-4
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
examples/extras/badam/llama3_lora_sft.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
sft
do_train
:
true
finetuning_type
:
full
use_badam
:
true
badam_switch_mode
:
ascending
badam_switch_interval
:
50
badam_verbose
:
2
### dataset
dataset
:
identity,alpaca_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/full/sft
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
8
learning_rate
:
1.0e-4
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
pure_bf16
:
true
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
examples/extras/fsdp_qlora/llama3_lora_sft.yaml
View file @
317a82e2
...
@@ -7,6 +7,7 @@ trust_remote_code: true
...
@@ -7,6 +7,7 @@ trust_remote_code: true
stage
:
sft
stage
:
sft
do_train
:
true
do_train
:
true
finetuning_type
:
lora
finetuning_type
:
lora
lora_rank
:
8
lora_target
:
all
lora_target
:
all
### dataset
### dataset
...
@@ -35,7 +36,7 @@ bf16: true
...
@@ -35,7 +36,7 @@ bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/fsdp_qlora/single_node.sh
deleted
100644 → 0
View file @
37b0ad9f
#!/bin/bash
# DO NOT use GPTQ/AWQ model in FSDP+QLoRA
CUDA_VISIBLE_DEVICES
=
0,1 accelerate launch
\
--config_file
examples/accelerate/fsdp_config.yaml
\
src/train.py examples/extras/fsdp_qlora/llama3_lora_sft.yaml
examples/extras/galore/llama3_full_sft.yaml
View file @
317a82e2
...
@@ -38,7 +38,7 @@ pure_bf16: true
...
@@ -38,7 +38,7 @@ pure_bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/llama_pro/llama3_freeze_sft.yaml
View file @
317a82e2
...
@@ -36,7 +36,7 @@ bf16: true
...
@@ -36,7 +36,7 @@ bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/loraplus/llama3_lora_sft.yaml
View file @
317a82e2
...
@@ -6,6 +6,7 @@ trust_remote_code: true
...
@@ -6,6 +6,7 @@ trust_remote_code: true
stage
:
sft
stage
:
sft
do_train
:
true
do_train
:
true
finetuning_type
:
lora
finetuning_type
:
lora
lora_rank
:
8
lora_target
:
all
lora_target
:
all
loraplus_lr_ratio
:
16.0
loraplus_lr_ratio
:
16.0
...
@@ -35,7 +36,7 @@ bf16: true
...
@@ -35,7 +36,7 @@ bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/mod/llama3_full_sft.yaml
View file @
317a82e2
...
@@ -35,7 +35,7 @@ pure_bf16: true
...
@@ -35,7 +35,7 @@ pure_bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/extras/pissa/llama3_lora_sft.yaml
View file @
317a82e2
...
@@ -6,6 +6,7 @@ trust_remote_code: true
...
@@ -6,6 +6,7 @@ trust_remote_code: true
stage
:
sft
stage
:
sft
do_train
:
true
do_train
:
true
finetuning_type
:
lora
finetuning_type
:
lora
lora_rank
:
8
lora_target
:
all
lora_target
:
all
pissa_init
:
true
pissa_init
:
true
pissa_iter
:
16
pissa_iter
:
16
...
@@ -37,7 +38,7 @@ bf16: true
...
@@ -37,7 +38,7 @@ bf16: true
ddp_timeout
:
180000000
ddp_timeout
:
180000000
### eval
### eval
val_size
:
0.1
#
val_size: 0.1
per_device_eval_batch_size
:
1
#
per_device_eval_batch_size: 1
eval_strategy
:
steps
#
eval_strategy: steps
eval_steps
:
500
#
eval_steps: 500
examples/full_multi_gpu/llama3_full_predict.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
saves/llama3-8b/full/sft
### method
stage
:
sft
do_predict
:
true
finetuning_type
:
full
### dataset
dataset
:
identity,alpaca_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
50
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/full/predict
overwrite_output_dir
:
true
### eval
per_device_eval_batch_size
:
1
predict_with_generate
:
true
examples/full_multi_gpu/llama3_full_sft.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
sft
do_train
:
true
finetuning_type
:
full
### ddp
ddp_timeout
:
180000000
deepspeed
:
examples/deepspeed/ds_z3_config.json
### dataset
dataset
:
identity,alpaca_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/full/sft
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
2
learning_rate
:
1.0e-4
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
fp16
:
true
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
examples/lora_multi_gpu/llama3_lora_sft.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
sft
do_train
:
true
finetuning_type
:
lora
lora_target
:
all
### ddp
ddp_timeout
:
180000000
### dataset
dataset
:
identity,alpaca_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/lora/sft
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
2
learning_rate
:
1.0e-4
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
fp16
:
true
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
examples/lora_multi_gpu/llama3_lora_sft_ds.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
sft
do_train
:
true
finetuning_type
:
lora
lora_target
:
all
### ddp
ddp_timeout
:
180000000
deepspeed
:
examples/deepspeed/ds_z3_config.json
### dataset
dataset
:
identity,alpaca_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/lora/sft
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
2
learning_rate
:
1.0e-4
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
fp16
:
true
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
examples/lora_single_gpu/llama3_lora_dpo.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
dpo
do_train
:
true
finetuning_type
:
lora
lora_target
:
all
pref_beta
:
0.1
pref_loss
:
sigmoid
# [sigmoid (dpo), orpo, simpo]
### dataset
dataset
:
dpo_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/lora/dpo
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
8
learning_rate
:
5.0e-6
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
fp16
:
true
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
examples/lora_single_gpu/llama3_lora_eval.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
adapter_name_or_path
:
saves/llama3-8b/lora/sft
### method
finetuning_type
:
lora
### dataset
task
:
mmlu
split
:
test
template
:
fewshot
lang
:
en
n_shot
:
5
### output
save_dir
:
saves/llama3-8b/lora/eval
### eval
batch_size
:
4
examples/lora_single_gpu/llama3_lora_kto.yaml
deleted
100644 → 0
View file @
37b0ad9f
### model
model_name_or_path
:
meta-llama/Meta-Llama-3-8B-Instruct
### method
stage
:
kto
do_train
:
true
finetuning_type
:
lora
lora_target
:
all
### dataset
dataset
:
kto_en_demo
template
:
llama3
cutoff_len
:
1024
max_samples
:
1000
overwrite_cache
:
true
preprocessing_num_workers
:
16
### output
output_dir
:
saves/llama3-8b/lora/kto
logging_steps
:
10
save_steps
:
500
plot_loss
:
true
overwrite_output_dir
:
true
### train
per_device_train_batch_size
:
1
gradient_accumulation_steps
:
8
learning_rate
:
5.0e-6
num_train_epochs
:
3.0
lr_scheduler_type
:
cosine
warmup_ratio
:
0.1
fp16
:
true
### eval
val_size
:
0.1
per_device_eval_batch_size
:
1
eval_strategy
:
steps
eval_steps
:
500
Prev
1
2
3
4
5
6
…
13
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment