Add example Llama 2 ReLoRA config (#471)
Browse files* Add example Llama 2 ReLoRA config
* Use adamw_bnb_8bit in example relora config
- examples/llama-2/relora.yml +73 -0
examples/llama-2/relora.yml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
base_model: meta-llama/Llama-2-7b-hf
|
| 2 |
+
base_model_config: meta-llama/Llama-2-7b-hf
|
| 3 |
+
model_type: LlamaForCausalLM
|
| 4 |
+
tokenizer_type: LlamaTokenizer
|
| 5 |
+
is_llama_derived_model: true
|
| 6 |
+
|
| 7 |
+
load_in_8bit: false
|
| 8 |
+
load_in_4bit: true
|
| 9 |
+
strict: false
|
| 10 |
+
|
| 11 |
+
datasets:
|
| 12 |
+
- path: teknium/GPT4-LLM-Cleaned
|
| 13 |
+
type: alpaca
|
| 14 |
+
dataset_prepared_path: last_run_prepared
|
| 15 |
+
val_set_size: 0.01
|
| 16 |
+
output_dir: ./relora-out
|
| 17 |
+
|
| 18 |
+
adapter: qlora
|
| 19 |
+
lora_model_dir:
|
| 20 |
+
|
| 21 |
+
sequence_len: 4096
|
| 22 |
+
sample_packing: true
|
| 23 |
+
|
| 24 |
+
lora_r: 8
|
| 25 |
+
lora_alpha: 16
|
| 26 |
+
lora_dropout: 0.05
|
| 27 |
+
lora_target_modules:
|
| 28 |
+
lora_target_linear: true
|
| 29 |
+
lora_fan_in_fan_out:
|
| 30 |
+
|
| 31 |
+
relora_steps: 150
|
| 32 |
+
relora_warmup_steps: 10
|
| 33 |
+
relora_cpu_offload: false
|
| 34 |
+
|
| 35 |
+
wandb_project:
|
| 36 |
+
wandb_entity:
|
| 37 |
+
wandb_watch:
|
| 38 |
+
wandb_run_id:
|
| 39 |
+
wandb_log_model:
|
| 40 |
+
|
| 41 |
+
gradient_accumulation_steps: 4
|
| 42 |
+
micro_batch_size: 4
|
| 43 |
+
num_epochs: 3
|
| 44 |
+
optimizer: adamw_bnb_8bit
|
| 45 |
+
lr_scheduler: cosine
|
| 46 |
+
learning_rate: 0.0002
|
| 47 |
+
|
| 48 |
+
train_on_inputs: false
|
| 49 |
+
group_by_length: false
|
| 50 |
+
bf16: true
|
| 51 |
+
fp16: false
|
| 52 |
+
tf32: false
|
| 53 |
+
|
| 54 |
+
gradient_checkpointing: true
|
| 55 |
+
early_stopping_patience:
|
| 56 |
+
resume_from_checkpoint:
|
| 57 |
+
local_rank:
|
| 58 |
+
logging_steps: 1
|
| 59 |
+
xformers_attention:
|
| 60 |
+
flash_attention: true
|
| 61 |
+
|
| 62 |
+
warmup_steps: 10
|
| 63 |
+
eval_steps: 20
|
| 64 |
+
save_steps: 50
|
| 65 |
+
debug:
|
| 66 |
+
deepspeed:
|
| 67 |
+
weight_decay: 0.0
|
| 68 |
+
fsdp:
|
| 69 |
+
fsdp_config:
|
| 70 |
+
special_tokens:
|
| 71 |
+
bos_token: "<s>"
|
| 72 |
+
eos_token: "</s>"
|
| 73 |
+
unk_token: "<unk>"
|