Skip to content

Instantly share code, notes, and snippets.

@jondurbin
Last active September 10, 2023 23:47
Show Gist options
  • Save jondurbin/51a336c582a224de197ba1d2c6b1da97 to your computer and use it in GitHub Desktop.
Save jondurbin/51a336c582a224de197ba1d2c6b1da97 to your computer and use it in GitHub Desktop.
spicyboros-70b-2.2-tuning

Trained on 8x 80gb a100 nodes in runpod.

Dataset: https://hf.co/datasets/jondurbin/airoboros-2.2 (specifically, instructions.jsonl)

My fork of qlora: https://github.com/jondurbin/qlora

Note: the final selected checkpoint used to merge the model was checkpoint-750!

Merged with qmerge.py from my fork of qlora, similar to:

python qlora/qmerge.py --base llama-2-70b-hf --peft spicyboros-70b-2.2-checkpoints/checkpoint-750/model_adapter --out spicyboros-2.2
export BASE_DIR=/workspace
export WANDB_API_KEY=[redacted]
export WANDB_PROJECT=spicyboros-70b-2.2

accelerate launch qlora/flash_qlora.py \
  --model_name_or_path $BASE_DIR/llama-2-70b-hf \
  --output_dir $BASE_DIR/$WANDB_PROJECT-checkpoints \
  --num_train_epochs 5 \
  --logging_steps 1 \
  --save_strategy steps \
  --save_steps 25 \
  --save_total_limit 10 \
  --data_seed 11422 \
  --evaluation_strategy no \
  --eval_dataset_size 2 \
  --max_new_tokens 4096 \
  --dataloader_num_workers 3 \
  --logging_strategy steps \
  --remove_unused_columns False \
  --do_train \
  --lora_r 64 \
  --lora_alpha 16 \
  --lora_modules all \
  --bf16 \
  --bits 4 \
  --double_quant \
  --quant_type nf4 \
  --lr_scheduler_type cosine \
  --dataset $BASE_DIR/instructions.jsonl \
  --dataset_format airoboros \
  --model_max_len 4096 \
  --per_device_train_batch_size 2 \
  --learning_rate 0.00012 \
  --adam_beta2 0.999 \
  --max_grad_norm 0.3 \
  --lora_dropout 0.02 \
  --weight_decay 0.0 \
  --seed 11422 \
  --report_to wandb \
  --gradient_checkpointing True \
  --ddp_find_unused_parameters False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment