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 deepspeed 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]
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 && git checkout 9f00465a5cb2349c23853c4a020a928709e506f2 && uv pip install torch==2.5.1 packaging ninja setuptools ftfy deepspeed huggingface_hub[cli,hf_transfer] && uv pip install "cut-cross-entropy[transformers] @ git+https://github.com/strangedove/ml-cross-entropy.git@gemma3" && uv pip install apollo-torch && uv pip install --no-build-isolation -e .[flash-attn] && uv pip install git+https://github.com/huggingface/transformers.git@c9d1e5238a752813ba91a8751a638a09b5efbb73 && 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-creative-qlora
28hub_strategy: "every_save"
29
30# === Training Setup ===
31num_epochs: 1
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: lora
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#lora_modules_to_save:
63# - embed_tokens
64#fix_untrained_tokens: true
65
66#lora_mlp_kernel: true
67#lora_qkv_kernel: true
68#lora_o_kernel: true
69
70# === Hyperparameter Configuration ===
71#optimizer: apollo_adamw_layerwise
72optimizer: paged_adamw_8bit
73# Apollo-mini configuration:
74#optim_args: "proj=random,rank=1,scale=128.0,scale_type=tensor,update_proj_gap=200"
75# Regular Apollo configuration:
76# optim_args:
77#optim_target_modules: all_linear
78learning_rate: 1e-5
79lr_scheduler: rex
80weight_decay: 0.01
81#warmup_ratio: 0.05
82
83
84# === Data Configuration ===
85chat_template: jinja
86chat_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 %}"
87#special_tokens:
88# eos_token: "<end_of_turn>"
89shuffle_merged_datasets: true
90datasets:
91 - path: ToastyPigeon/some-rp-extended
92 type: customgemma-regex
93 - path: allura-org/inkstructmix-v0.2.1a-system-reasoning-separated
94 type: customgemma-regex
95 data_files: inkstruct-system.json
96 split: train[:1000]
97 - path: ToastyPigeon/unalign-v2
98 type: chat_template
99 field_messages: conversations
100 message_property_mappings:
101 role: from
102 content: value
103 - path: ToastyPigeon/synth-rp
104 split: train[:20%]
105 type: customgemma-regex
106 - path: ToastyPigeon/SpringDragon
107 type: customcompletion-regex
108 - path: ToastyPigeon/new-story-dataset
109 type: customcompletion-regex
110 field: text
111
112dataset_prepared_path: last_run_prepared
113
114
115# === Plugins ===
116plugins:
117 - axolotl.integrations.liger.LigerPlugin
118 - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
119
120# === Hardware Optimization ===
121gradient_checkpointing: true
122#gradient_checkpointing_kwargs:
123# use_reentrant: true
124liger_rope: true
125liger_rms_norm: true
126liger_glu_activation: true
127#liger_fused_linear_cross_entropy: true
128#unsloth_cross_entropy_loss: true
129cut_cross_entropy: true
130# Only if using multiple GPUs:
131deepspeed: axolotl/deepspeed_configs/zero2.json
132
133# === Wandb Tracking ===
134wandb_project: Gemma
135# wandb_entity: [WANDB_ENTITY]
136# wandb_name: [WANDB_RUN_NAME]
137
138# === Checkpointing ===
139saves_per_epoch: 10
140save_total_limit: 1
141
142# === Advanced Settings ===
143output_dir: ./ckpts
144bf16: auto
145flash_attention: true
146train_on_inputs: false
147group_by_length: false
148save_safetensors: true
149logging_steps: 1
150gc_steps: 10
151seed: 69| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 4.232 | 0.0027 | 1 | 4.6818 |
| 3.0096 | 0.2003 | 74 | 3.4715 |
| 3.1876 | 0.4005 | 148 | 2.9701 |
| 2.9183 | 0.6008 | 222 | 2.7403 |
| 2.5194 | 0.8011 | 296 | 2.6618 |