Views
No views yet
0.8.0.dev01# === Start-up Commands ===
2# curl -LsSf https://astral.sh/uv/install.sh | sh
3# export PATH="$HOME/.local/bin:$PATH"
4# git clone https://github.com/axolotl-ai-cloud/axolotl
5# cd axolotl
6# git checkout d8b4027200de0fe60f4ae0a71272c1a8cb2888f7
7# uv venv
8# source .venv/bin/activate
9# uv pip install packaging ninja setuptools ftfy huggingface_hub[cli,hf_transfer]
10# uv pip install "cut-cross-entropy[transformers] @ git+https://github.com/strangedove/ml-cross-entropy.git"
11# uv pip install apollo-torch
12# uv pip install --no-build-isolation -e .[flash-attn,deepspeed]
13# uv pip install git+https://github.com/huggingface/transformers.git
14# export HF_HUB_ENABLE_HF_TRANSFER=1
15# huggingface-cli login --token $hf_key && wandb login $wandb_key
16# axolotl preprocess qwen21-pretrain.yml
17# axolotl train qwen21-pretrain.yml
18
19# curl -LsSf https://astral.sh/uv/install.sh | sh && export PATH="$HOME/.local/bin:$PATH" && git clone https://github.com/axolotl-ai-cloud/axolotl && uv venv && source .venv/bin/activate && cd axolotl && uv pip install torch==2.5.1 packaging ninja setuptools ftfy huggingface_hub[cli,hf_transfer] && uv pip install "cut-cross-entropy[transformers] @ git+https://github.com/strangedove/ml-cross-entropy.git" && uv pip install apollo-torch && uv pip install --no-build-isolation -e .[flash-attn,deepspeed] && uv pip install git+https://github.com/huggingface/transformers.git && export HF_HUB_ENABLE_HF_TRANSFER=1 && cd .. && huggingface-cli login --token $hf_key && wandb login $wandb_key
20
21# === Model Configuration ===
22base_model: unsloth/gemma-3-12b-pt
23load_in_8bit: false
24load_in_4bit: true
25
26# === HF Configuration ===
27hub_model_id: ToastyPigeon/g3-12b-pt-story-qlora
28hub_strategy: "every_save"
29
30# === Training Setup ===
31num_epochs: 2
32micro_batch_size: 2
33gradient_accumulation_steps: 2
34sequence_len: 8192
35sample_packing: true
36pad_to_sequence_len: true
37
38# === Evaluation ===
39val_set_size: 100
40evals_per_epoch: 5
41#eval_table_size:
42eval_max_new_tokens: 256
43eval_sample_packing: true
44#eval_strategy: "no"
45
46# === LoRA Configuration ===
47adapter: qlora
48lora_model_dir:
49lora_r: 64
50lora_alpha: 64
51lora_dropout: 0.5
52lora_target_linear:
53lora_fan_in_fan_out:
54lora_target_modules:
55 - gate_proj
56 - down_proj
57 - up_proj
58 - q_proj
59 - v_proj
60 - k_proj
61 - o_proj
62
63#lora_mlp_kernel: true
64#lora_qkv_kernel: true
65#lora_o_kernel: true
66
67# === Hyperparameter Configuration ===
68#optimizer: apollo_adamw_layerwise
69optimizer: paged_adamw_8bit
70# Apollo-mini configuration:
71#optim_args: "proj=random,rank=1,scale=128.0,scale_type=tensor,update_proj_gap=200"
72# Regular Apollo configuration:
73# optim_args:
74#optim_target_modules: all_linear
75learning_rate: 1e-5
76lr_scheduler: rex
77weight_decay: 0.01
78#warmup_ratio: 0.05
79
80
81# === Data Configuration ===
82#chat_template: jinja
83#chat_template_jinja: "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}"
84#special_tokens:
85# eos_token: "<end_of_turn>"
86shuffle_merged_datasets: true
87datasets:
88 - path: ToastyPigeon/new-story-dataset
89 type: customcompletion-regex
90 field: text
91dataset_prepared_path: last_run_prepared
92
93
94# === Plugins ===
95plugins:
96 - axolotl.integrations.liger.LigerPlugin
97 - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
98
99# === Hardware Optimization ===
100gradient_checkpointing: true
101#gradient_checkpointing_kwargs:
102# use_reentrant: true
103liger_rope: true
104liger_rms_norm: true
105liger_glu_activation: true
106#liger_fused_linear_cross_entropy: true
107#unsloth_cross_entropy_loss: true
108cut_cross_entropy: true
109# Only if using multiple GPUs:
110deepspeed: axolotl/deepspeed_configs/zero2.json
111max_grad_norm: 2.0
112
113# === Wandb Tracking ===
114wandb_project: Gemma
115# wandb_entity: [WANDB_ENTITY]
116# wandb_name: [WANDB_RUN_NAME]
117
118# === Checkpointing ===
119saves_per_epoch: 10
120save_total_limit: 1
121
122# === Advanced Settings ===
123output_dir: ./ckpts
124bf16: auto
125flash_attention: true
126train_on_inputs: false
127group_by_length: false
128save_safetensors: true
129logging_steps: 1
130gc_steps: 10
131seed: 69| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 3.7026 | 0.0058 | 1 | 3.8366 |
| 3.358 | 0.2035 | 35 | 3.2872 |
| 3.0792 | 0.4070 | 70 | 3.0753 |
| 2.881 | 0.6105 | 105 | 2.9436 |
| 2.9439 | 0.8140 | 140 | 2.8437 |
| 2.6859 | 1.0174 | 175 | 2.7684 |
| 2.6724 | 1.2209 | 210 | 2.7104 |
| 2.6565 | 1.4244 | 245 | 2.6730 |
| 2.6235 | 1.6279 | 280 | 2.6528 |
| 2.7326 | 1.8314 | 315 | 2.6458 |