diff --git a/finetune.py b/finetune.py index 075ef68..72bfd6b 100644 --- a/finetune.py +++ b/finetune.py @@ -36,7 +36,7 @@ LEARNING_RATE = 2e-4 CUTOFF_LEN = 256 LORA_R = 8 LORA_ALPHA = 16 -LORA_DROPOUT = 0.05 +LORA_DROPOUT = 0.05 # should be 0 if gradient checkpointing is on VAL_SET_SIZE = 0 TARGET_MODULES = [ "q_proj", @@ -49,6 +49,10 @@ save_steps = 50 save_total_limit = 3 logging_steps = 10 +if LORA_DROPOUT > 0 and GRADIENT_CHECKPOINTING: + LORA_DROPOUT = 0 + print('Disable Dropout.') + # Load Basic Model model, tokenizer = load_llama_model_4bit_low_ram(config_path, model_path) diff --git a/install.bat b/install.bat index bf5e817..bd79a55 100644 --- a/install.bat +++ b/install.bat @@ -15,8 +15,9 @@ REM replace ./repository/GPTQ-for-LLaMa/quant_cuda.cpp and quant_cuda_kernel.cu copy .\GPTQ-for-LLaMa\quant_cuda.cpp .\repository\GPTQ-for-LLaMa\quant_cuda.cpp /Y copy .\GPTQ-for-LLaMa\quant_cuda_kernel.cu .\repository\GPTQ-for-LLaMa\quant_cuda_kernel.cu /Y -REM copy autograd_4bit.py into ./repository/GPTQ-for-LLaMa/autograd_4bit.py +REM copy files into ./repository/GPTQ-for-LLaMa/ copy .\GPTQ-for-LLaMa\autograd_4bit.py .\repository\GPTQ-for-LLaMa\autograd_4bit.py /Y +copy .\GPTQ-for-LLaMa\gradient_checkpointing.py .\repository\GPTQ-for-LLaMa\gradient_checkpointing.py /Y REM install quant_cuda cd .\repository\GPTQ-for-LLaMa diff --git a/install.sh b/install.sh index be4c802..fd5a67c 100644 --- a/install.sh +++ b/install.sh @@ -19,8 +19,9 @@ cp ./peft/tuners/lora.py ./repository/peft/src/peft/tuners/lora.py cp ./GPTQ-for-LLaMa/quant_cuda.cpp ./repository/GPTQ-for-LLaMa/quant_cuda.cpp cp ./GPTQ-for-LLaMa/quant_cuda_kernel.cu ./repository/GPTQ-for-LLaMa/quant_cuda_kernel.cu -# Copy autograd_4bit.py into ./repository/GPTQ-for-LLaMa/autograd_4bit.py +# Copy files into ./repository/GPTQ-for-LLaMa/ cp ./GPTQ-for-LLaMa/autograd_4bit.py ./repository/GPTQ-for-LLaMa/autograd_4bit.py +cp ./GPTQ-for-LLaMa/gradient_checkpointing.py ./repository/GPTQ-for-LLaMa/gradient_checkpointing.py # Install quant_cuda and cd into ./repository/GPTQ-for-LLaMa cd ./repository/GPTQ-for-LLaMa