|
@@ -71,36 +71,47 @@ python -m llama_recipes.finetuning --use_peft --peft_method lora --quantization
|
|
|
It let us specify the training settings, everything from `model_name` to `dataset_name`, `batch_size` etc. can be set here. Below is the list of supported settings:
|
|
|
|
|
|
```python
|
|
|
-
|
|
|
-model_name: str="PATH/to/LLAMA 2/7B"
|
|
|
-enable_fsdp: bool= False
|
|
|
-run_validation: bool=True
|
|
|
-batch_size_training: int=4
|
|
|
-gradient_accumulation_steps: int=1
|
|
|
-num_epochs: int=3
|
|
|
-num_workers_dataloader: int=2
|
|
|
-lr: float=2e-4
|
|
|
-weight_decay: float=0.0
|
|
|
-gamma: float= 0.85
|
|
|
-use_fp16: bool=False
|
|
|
-mixed_precision: bool=True
|
|
|
-val_batch_size: int=4
|
|
|
-dataset = "samsum_dataset" # alpaca_dataset,grammar_dataset
|
|
|
-peft_method: str = "lora" # None , llama_adapter, prefix
|
|
|
-use_peft: bool=False
|
|
|
-output_dir: str = "./ft-output"
|
|
|
-freeze_layers: bool = False
|
|
|
-num_freeze_layers: int = 1
|
|
|
-quantization: bool = False
|
|
|
-one_gpu: bool = False
|
|
|
-save_model: bool = False
|
|
|
-dist_checkpoint_root_folder: str="model_checkpoints"
|
|
|
-dist_checkpoint_folder: str="fine-tuned"
|
|
|
-save_optimizer: bool=False
|
|
|
-flop_counter: bool=False # Enable FLOPS counter to measure model throughput, can not be used with pytorch profiler at the same time.
|
|
|
-flop_counter_start: int=3 # The step to start profiling, default is 3, which means after 3 steps of warm-up stage, the profiler will start to count FLOPS.
|
|
|
-use_profiler: bool=False # Enable pytorch profiler, can not be used with FLOPS counter at the same time.
|
|
|
-profiler_dir: str="PATH/to/save/profiler/results" # will be used if using profiler
|
|
|
+ model_name: str="PATH/to/Model"
|
|
|
+ tokenizer_name: str=None
|
|
|
+ enable_fsdp: bool=False
|
|
|
+ low_cpu_fsdp: bool=False
|
|
|
+ run_validation: bool=True
|
|
|
+ batch_size_training: int=4
|
|
|
+ batching_strategy: str="packing" #alternative: padding
|
|
|
+ context_length: int=4096
|
|
|
+ gradient_accumulation_steps: int=1
|
|
|
+ gradient_clipping: bool = False
|
|
|
+ gradient_clipping_threshold: float = 1.0
|
|
|
+ num_epochs: int=3
|
|
|
+ max_train_step: int=0
|
|
|
+ max_eval_step: int=0
|
|
|
+ num_workers_dataloader: int=1
|
|
|
+ lr: float=1e-4
|
|
|
+ weight_decay: float=0.0
|
|
|
+ gamma: float= 0.85
|
|
|
+ seed: int=42
|
|
|
+ use_fp16: bool=False
|
|
|
+ mixed_precision: bool=True
|
|
|
+ val_batch_size: int=1
|
|
|
+ dataset = "samsum_dataset"
|
|
|
+ peft_method: str = "lora" # None,llama_adapter, prefix
|
|
|
+ use_peft: bool=False
|
|
|
+ output_dir: str = "PATH/to/save/PEFT/model"
|
|
|
+ freeze_layers: bool = False
|
|
|
+ num_freeze_layers: int = 1
|
|
|
+ quantization: bool = False
|
|
|
+ one_gpu: bool = False
|
|
|
+ save_model: bool = True
|
|
|
+ dist_checkpoint_root_folder: str="PATH/to/save/FSDP/model" # will be used if using FSDP
|
|
|
+ dist_checkpoint_folder: str="fine-tuned" # will be used if using FSDP
|
|
|
+ save_optimizer: bool=False # will be used if using FSDP
|
|
|
+ use_fast_kernels: bool = False # Enable using SDPA from PyTroch Accelerated Transformers, make use Flash Attention and Xformer memory-efficient kernels
|
|
|
+ use_wandb: bool = False # Enable wandb for experient tracking
|
|
|
+ save_metrics: bool = False # saves training metrics to a json file for later plotting
|
|
|
+ flop_counter: bool = False # Enable flop counter to measure model throughput, can not be used with pytorch profiler at the same time.
|
|
|
+ flop_counter_start: int = 3 # The step to start profiling, default is 3, which means after 3 steps of warmup stage, the profiler will start to count flops.
|
|
|
+ use_profiler: bool = False # Enable pytorch profiler, can not be used with flop counter at the same time.
|
|
|
+ profiler_dir: str = "PATH/to/save/profiler/results" # will be used if using profiler
|
|
|
```
|
|
|
|
|
|
* [Datasets config file](../src/llama_recipes/configs/datasets.py) provides the available options for datasets.
|