-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
190 additions
and
35 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
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
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,22 @@ | ||
compute_environment: LOCAL_MACHINE | ||
debug: false | ||
deepspeed_config: | ||
deepspeed_multinode_launcher: standard | ||
offload_optimizer_device: cpu | ||
offload_param_device: cpu | ||
zero3_init_flag: true | ||
zero3_save_16bit_model: true | ||
zero_stage: 3 | ||
distributed_type: DEEPSPEED | ||
downcast_bf16: 'no' | ||
machine_rank: 0 | ||
main_training_function: main | ||
mixed_precision: bf16 | ||
num_machines: 1 | ||
num_processes: 2 | ||
rdzv_backend: static | ||
same_network: true | ||
tpu_env: [] | ||
tpu_use_cluster: false | ||
tpu_use_sudo: false | ||
use_cpu: false |
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,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: SHARDED_STATE_DICT | ||
fsdp_sync_module_states: true | ||
fsdp_use_orig_params: false | ||
machine_rank: 0 | ||
main_training_function: main | ||
mixed_precision: 'no' | ||
num_machines: 1 | ||
num_processes: 2 | ||
rdzv_backend: static | ||
same_network: true | ||
tpu_env: [] | ||
tpu_use_cluster: false | ||
tpu_use_sudo: false | ||
use_cpu: false |
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,41 @@ | ||
accelerate launch --config_file "configs/deepspeed_config_z3_qlora.yaml" train.py \ | ||
--seed 100 \ | ||
--model_name_or_path "meta-llama/Llama-2-70b-hf" \ | ||
--dataset_name "smangrul/ultrachat-10k-chatml" \ | ||
--chat_template_format "chatml" \ | ||
--add_special_tokens False \ | ||
--append_concat_token False \ | ||
--splits "train,test" \ | ||
--max_seq_len 2048 \ | ||
--num_train_epochs 1 \ | ||
--logging_steps 5 \ | ||
--log_level "info" \ | ||
--logging_strategy "steps" \ | ||
--evaluation_strategy "epoch" \ | ||
--save_strategy "epoch" \ | ||
--push_to_hub \ | ||
--hub_private_repo True \ | ||
--hub_strategy "every_save" \ | ||
--bf16 True \ | ||
--packing True \ | ||
--learning_rate 1e-4 \ | ||
--lr_scheduler_type "cosine" \ | ||
--weight_decay 1e-4 \ | ||
--warmup_ratio 0.0 \ | ||
--max_grad_norm 1.0 \ | ||
--output_dir "llama-sft-qlora-dsz3" \ | ||
--per_device_train_batch_size 2 \ | ||
--per_device_eval_batch_size 2 \ | ||
--gradient_accumulation_steps 2 \ | ||
--gradient_checkpointing True \ | ||
--use_reentrant True \ | ||
--dataset_text_field "content" \ | ||
--use_flash_attn True \ | ||
--use_peft_lora True \ | ||
--lora_r 8 \ | ||
--lora_alpha 16 \ | ||
--lora_dropout 0.1 \ | ||
--lora_target_modules "all-linear" \ | ||
--use_4bit_quantization True \ | ||
--use_nested_quant True \ | ||
--bnb_4bit_compute_dtype "bfloat16" |
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,42 @@ | ||
accelerate launch --config_file "configs/fsdp_config_qlora.yaml" train.py \ | ||
--seed 100 \ | ||
--model_name_or_path "meta-llama/Llama-2-70b-hf" \ | ||
--dataset_name "smangrul/ultrachat-10k-chatml" \ | ||
--chat_template_format "chatml" \ | ||
--add_special_tokens False \ | ||
--append_concat_token False \ | ||
--splits "train,test" \ | ||
--max_seq_len 2048 \ | ||
--num_train_epochs 1 \ | ||
--logging_steps 5 \ | ||
--log_level "info" \ | ||
--logging_strategy "steps" \ | ||
--evaluation_strategy "epoch" \ | ||
--save_strategy "epoch" \ | ||
--push_to_hub \ | ||
--hub_private_repo True \ | ||
--hub_strategy "every_save" \ | ||
--bf16 True \ | ||
--packing True \ | ||
--learning_rate 1e-4 \ | ||
--lr_scheduler_type "cosine" \ | ||
--weight_decay 1e-4 \ | ||
--warmup_ratio 0.0 \ | ||
--max_grad_norm 1.0 \ | ||
--output_dir "llama-sft-qlora-fsdp" \ | ||
--per_device_train_batch_size 2 \ | ||
--per_device_eval_batch_size 2 \ | ||
--gradient_accumulation_steps 2 \ | ||
--gradient_checkpointing True \ | ||
--use_reentrant True \ | ||
--dataset_text_field "content" \ | ||
--use_flash_attn True \ | ||
--use_peft_lora True \ | ||
--lora_r 8 \ | ||
--lora_alpha 16 \ | ||
--lora_dropout 0.1 \ | ||
--lora_target_modules "all-linear" \ | ||
--use_4bit_quantization True \ | ||
--use_nested_quant True \ | ||
--bnb_4bit_compute_dtype "bfloat16" \ | ||
--bnb_4bit_quant_storage_dtype "bfloat16" |
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
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