In [1]:
%cd /workspace/axolotl
/workspace/axolotl
In [2]:
!accelerate config --config_file configs/accelerate/default_config.yaml default
Setting ds_accelerator to cuda (auto detect) accelerate configuration saved at /root/.cache/huggingface/accelerate/default_config.yaml
Open files to modify:
/workspace/axolotl/examples/falcon/qlora.yml
In [18]:
!cat examples/falcon/qlora.yml
base_model: tiiuae/falcon-rw-1b
base_model_config: tiiuae/falcon-rw-1b
trust_remote_code: true
model_type: AutoModelForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: true
gptq: false
strict: false
push_dataset_to_hub:
datasets:
# - path: AtlasUnified/Code-Instruct-Sets
# data_files:
# - unmasked-set-1.jsonl
# - unmasked-set-2.jsonl
# - unmasked-set-3.jsonl
# - unmasked-set-4.jsonl
# type: alpaca_code_instruct
# - path: winglian/pygmalion-cleaned
# data_files:
# - v13_no_ai.cleaned.jsonl
# type: pygmalion
# shards: 4
# - path: winglian/evals
# data_files:
# - hf/ARC-Challenge.jsonl
# - hf/ARC-Easy.jsonl
# - hf/riddle_sense.jsonl
# type: explainchoice:chat
# - path: winglian/evals
# data_files:
# - hf/gsm8k.jsonl
# - custom/logic_inference_oa.jsonl
# type: alpaca_chat.load_qa
# - path: winglian/evals
# data_files:
# - custom/in_context_qa.jsonl
# type: context_qa
# - path: winglian/evals
# data_files:
# - custom/in_context_qa.jsonl
# type: context_qa.load_404
# - path: winglian/evals
# data_files:
# - custom/jokes_explained_500up.jsonl
# type: sharegpt_jokes
# - path: winglian/evals
# data_files:
# - custom/classify-self-chat.sharegpt.jsonl
# - custom/coding-self-chat.sharegpt.jsonl
# - custom/prose-gpt4.sharegpt.jsonl
# - custom/prose-rewrite-gpt4.sharegpt.jsonl
# type: sharegpt_simple
# - path: winglian/evals
# data_files:
# - custom/guanaco-cleaned.en.jsonl
# type: sharegpt_simple.load_guanaco
# - path: winglian/evals
# data_files:
# - openai/tldr.jsonl
# type: summarizetldr:chat
# - path: winglian/evals
# data_files:
# - hellaswag/hellaswag.jsonl
# type: explainchoice:chat
# shards: 60
# - path: metaeval/ScienceQA_text_only
# type: concisechoice:chat
# shards: 13
# - path: teknium/GPTeacher-General-Instruct
# data_files:
# - gpt4-instruct-similarity-0.6-dataset.json
# type: gpteacher:chat
- path: QingyiSi/Alpaca-CoT
data_files:
# - chain-of-thought/formatted_cot_data/aqua_train.jsonl
# - Chain-of-Thought/formatted_cot_data/creak_train.json
# - Chain-of-Thought/formatted_cot_data/ecqa_train.json
# - Chain-of-Thought/formatted_cot_data/esnli_train.json
- Chain-of-Thought/formatted_cot_data/gsm8k_train.json
# - Chain-of-Thought/formatted_cot_data/qasc_train.json
# - Chain-of-Thought/formatted_cot_data/qed_train.json
# - Chain-of-Thought/formatted_cot_data/sensemaking_train.json
# - Chain-of-Thought/formatted_cot_data/strategyqa_train.json
# - GPTeacher/Roleplay/formatted_roleplay-similarity_0.6-instruct-dataset.json
type: "alpaca:chat"
dataset_prepared_path: last_run_prepared
val_set_size: 0.01
adapter: qlora
lora_model_dir:
sequence_len: 2048
max_packed_sequence_len: 2048
lora_r: 64
lora_alpha: 16
lora_dropout: 0.05
lora_target_modules:
lora_target_linear: true
lora_fan_in_fan_out:
wandb_project: falcon-qlora
wandb_watch:
wandb_run_id:
wandb_log_model: checkpoint
output_dir: ./qlora-out
batch_size: 24
micro_batch_size: 12
num_epochs: 3
optimizer: paged_adamw_32bit
torchdistx_path:
lr_scheduler: cosine
learning_rate: 0.0002
train_on_inputs: false
group_by_length: false
bf16: true
fp16: false
tf32: true
gradient_checkpointing: true
# stop training after this many evaluation losses have increased in a row
# https://huggingface.co/transformers/v4.2.2/_modules/transformers/trainer_callback.html#EarlyStoppingCallback
early_stopping_patience: 3
resume_from_checkpoint:
auto_resume_from_checkpoints: true
local_rank:
logging_steps: 1
xformers_attention: false
flash_attention:
gptq_groupsize:
gptq_model_v1:
warmup_steps: 10
eval_steps: 5
save_steps: 10
debug:
deepspeed:
weight_decay: 0.000001
fsdp:
fsdp_config:
special_tokens:
pad_token: "<|endoftext|>"
bos_token: ">>ABSTRACT<<"
eos_token: "<|endoftext|>"
In [ ]:
!accelerate launch scripts/finetune.py examples/falcon/qlora.yml
Below are ad hoc cells handling issues during training¶
In [17]:
!ps aux|grep python|grep finetune|awk '{print $2}'|xargs kill
In [ ]:
!apt install zip
!zip -r last_run_prepared.zip -xi last_run_prepared
In [ ]:
!nvitop -m full
In [ ]:
!apt install lsof
In [ ]:
!lsof /dev/nvidia*