winglian commited on
Commit
7967cd1
1 Parent(s): 02c5983

add 4bit lora 7b

Browse files
examples/4bit-lora-7b/README.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # LLaMa 7B using LoRA
2
+
3
+ This is a good place to start for beginners. This will run on an NVIDIA RTX4090 with no other changes needed.
4
+
5
+ ```shell
6
+ accelerate launch scripts/finetune.py examples/4bit-lora-7b/config.yml
7
+
8
+ ```
examples/4bit-lora-7b/config.yml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ base_model: Neko-Institute-of-Science/LLaMA-7B-4bit-128g
2
+ base_model_config: Neko-Institute-of-Science/LLaMA-7B-4bit-128g
3
+ model_type: LlamaForCausalLM
4
+ tokenizer_type: LlamaTokenizer
5
+ trust_remote_code:
6
+ load_in_8bit: true
7
+ load_4bit: true
8
+ datasets:
9
+ - path: vicgalle/alpaca-gpt4
10
+ type: alpaca
11
+ dataset_prepared_path: last_run_prepared
12
+ val_set_size: 0.02
13
+ adapter:
14
+ lora_model_dir:
15
+ sequence_len: 2048
16
+ max_packed_sequence_len:
17
+ lora_r: 8
18
+ lora_alpha: 16
19
+ lora_dropout: 0.05
20
+ lora_target_modules:
21
+ - q_proj
22
+ - v_proj
23
+ lora_fan_in_fan_out: false
24
+ wandb_project: llama-7b-lora-int4
25
+ wandb_watch:
26
+ wandb_run_id:
27
+ wandb_log_model: checkpoint
28
+ output_dir: ./llama-7b-lora-int4
29
+ batch_size: 1
30
+ micro_batch_size: 1
31
+ num_epochs: 3
32
+ optimizer: adamw_bnb_8bit
33
+ torchdistx_path:
34
+ lr_scheduler: cosine
35
+ learning_rate: 0.0000002
36
+ train_on_inputs: false
37
+ group_by_length: false
38
+ bf16: true
39
+ tf32: true
40
+ early_stopping_patience:
41
+ resume_from_checkpoint:
42
+ local_rank:
43
+ logging_steps: 5
44
+ xformers_attention:
45
+ flash_attention:
46
+ gradient_checkpointing: true
47
+ gptq_groupsize: 128
48
+ gptq_model_v1: false
49
+ warmup_steps: 20
50
+ eval_steps: 110
51
+ save_steps: 660
52
+ debug:
53
+ deepspeed:
54
+ weight_decay: 0.0001
55
+ fsdp:
56
+ fsdp_config:
57
+ special_tokens:
58
+ pad_token: "[PAD]"
59
+ bos_token: "<s>"
60
+ eos_token: "</s>"
61
+ unk_token: "<unk>"