-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update code for data pipeline and training
- Loading branch information
Showing
35 changed files
with
227,966 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
export now_time="$(date -u -d '+8 hours' '+%Y-%m%d-%H%M')" | ||
echo ${now_time} | ||
|
||
# --num_gpus $MLP_WORKER_GPU \ | ||
# --num_nodes $MLP_WORKER_NUM \ | ||
# --hostfile=$MLP_MPI_HOSTFILE \ | ||
# --master_addr $MLP_WORKER_0_HOST \ | ||
# --master_port=$MLP_WORKER_0_PORT \ | ||
|
||
for lr in 2e-5 5e-6 1e-5 2e-5 | ||
do | ||
deepspeed \ | ||
--num_gpus 8 \ | ||
src/finetune/run_sft.py src/finetune/config/sft_config_full.yaml \ | ||
--learning_rate=${lr} \ | ||
--num_train_epochs=3 \ | ||
--output_dir="outputs/ultramedical/Meta-Llama-3.1-8B-Instruct-${lr}" \ | ||
1>logs/sft_full_8b_ultramedical_${now_time}.log 2>&1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
export now_time=$(date -u -d '+8 hours' '+%Y-%m%d-%H%M') | ||
echo ${now_time} | ||
|
||
# --num_gpus $MLP_WORKER_GPU \ | ||
# --num_nodes $MLP_WORKER_NUM \ | ||
# --hostfile=$MLP_MPI_HOSTFILE \ | ||
# --master_addr $MLP_WORKER_0_HOST \ | ||
# --master_port=$MLP_WORKER_0_PORT \ | ||
|
||
for lr in 1e-5 | ||
do | ||
echo ${lr} | ||
deepspeed \ | ||
--num_gpus 8 \ | ||
src/finetune/run_dpo.py src/finetune/config/dpo_config_full.yaml \ | ||
--model_name_or_path="outputs/ultramedical/Meta-Llama-3.1-8B/1e-5-length8192" \ | ||
--save_strategy="steps" \ | ||
--num_train_epochs=1 \ | ||
--output_dir="outputs/ultramedical/Meta-Llama-3.1-8B-Instruct-1e-5-dpo/${lr}" \ | ||
1>logs/dpo_8b_${now_time}.log 2>&1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
from finetune.alignment.configs import DataArguments, DPOConfig, H4ArgumentParser, ModelArguments, SFTConfig | ||
from finetune.alignment.data import apply_chat_template, get_datasets, maybe_insert_system_message, is_openai_format | ||
from finetune.alignment.model_utils import ( | ||
get_checkpoint, | ||
get_kbit_device_map, | ||
get_peft_config, | ||
get_quantization_config, | ||
get_tokenizer, | ||
is_adapter_model, | ||
) |
Oops, something went wrong.