Finetuning falcon-7b with Axolotl¶
In [ ]:
%cd /workspace/axolotl
In [ ]:
!accelerate config --config_file configs/accelerate/default_config.yaml default
#1¶
In [ ]:
!cat examples/falcon/ft.yml
In [ ]:
!accelerate launch scripts/finetune.py examples/falcon/ft.yml
#2¶
In [ ]:
!cat examples/falcon/ft.yml
In [ ]:
!accelerate launch scripts/finetune.py examples/falcon/ft.yml
#3¶
In [ ]:
!cat examples/falcon/ft.yml
In [ ]:
!accelerate launch scripts/finetune.py examples/falcon/ft.yml
#4¶
In [ ]:
!cat examples/falcon/ft.yml
In [ ]:
!accelerate launch scripts/finetune.py examples/falcon/ft.yml
In [ ]:
Below are ad hoc cells handling issues during training¶
Force release VRAM¶
In [ ]:
# First interupt the kernel, wait a few seconds then run this to kill finetune to release VRAM
!ps aux|grep python|grep finetune|awk '{print $2}'|xargs kill
Clean the finetuned model and all checkpoints¶
In [ ]:
# Only run this to start over
!rm -rf ./ft-out
Zip the prepared dataset¶
In [ ]:
!apt install zip
!zip -r last_run_prepared.zip -xi last_run_prepared
Monitoring GPU¶
In [ ]:
# Run this in a seperate terminal
!nvitop -m full
Fix DISK FULL¶
In [ ]:
%cd /
In [ ]:
!du -d 2 -h|grep G
In [ ]:
!du -d 2 -h /root/.local
In [ ]:
!rm -rf /root/.local/share/Trash/
In [ ]:
!rm -rf /root/.local/share/wandb/
In [ ]:
!rm -rf /root/.cache/wandb/
Check who is using GPU¶
In [ ]:
!apt install lsof
In [ ]:
!lsof /dev/nvidia*
Upload checkpoints to HF¶
In [ ]:
!mkdir -p /workspace/llm-playground/storage/falcon-ft/
In [ ]:
!cp -r /workspace/axolotl/ft-out/checkpoint-120 /workspace/llm-playground/storage/falcon-ft/
In [ ]:
!python /workspace/llm-playground/helper/storage.py -u
Update axolotl¶
In [ ]:
%cd /workspace/
In [ ]:
!git clone https://github.com/OpenAccess-AI-Collective/axolotl axolotl-update
In [ ]:
!cp -r axolotl-update/* axolotl
In [ ]:
%cd /workspace/axolotl
In [ ]:
!git status
In [ ]:
!pip install -e .
A new bash without tmux etc.¶
In [ ]:
!bash --norc --noprofile
Clean up all checkpoints but last one¶
In [ ]:
cd /workspace/axolotl/ft-out/ && ls -lhta |grep checkpoint- | awk 'NR > 1 {print $9}' | xargs rm -rf