Views
No views yet
<|channel>thought\n Okay, let's see will make it use DeepSeek-esque reasoning most of the time.1# =============================================================================
2# BASE MODEL
3# =============================================================================
4base_model: /home/arli/models/gemma-4-31B-it
5
6
7# =============================================================================
8# PLUGINS & KERNEL OPTIMIZATIONS
9# =============================================================================
10plugins:
11 - axolotl.integrations.liger.LigerPlugin # not sure if it works with Gemma 4 but it doesn't crash at least
12 - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin # must have! KV cache is too expensive otherwise
13cut_cross_entropy: true
14liger_rope: true
15liger_rms_norm: true
16liger_layer_norm: true
17liger_glu_activation: true
18liger_rms_norm_gated: true
19
20
21# =============================================================================
22# QUANTIZATION
23# =============================================================================
24load_in_8bit: false
25load_in_4bit: false
26
27
28# =============================================================================
29# DATASET
30# =============================================================================
31shuffle_merged_datasets: true
32datasets:
33 - path: allura-forge/musica-sft-v1-gemma4-pretok # finally, pretokenized datasets
34 ds_type: parquet
35 type:
36
37dataset_prepared_path: ./last_run_prepared
38val_set_size: 0
39
40
41# =============================================================================
42# OUTPUT & ADAPTER
43# =============================================================================
44output_dir: ./outputs/v1
45adapter: lora
46save_safetensors: true
47
48
49# =============================================================================
50# SEQUENCE & SAMPLE PACKING
51# =============================================================================
52sequence_len: 8192 # ideally 16384 but Gemma 4 31B has too expensive KV cache
53sample_packing: true # DOES in fact work with SDPA
54pad_to_sequence_len: false
55
56
57# =============================================================================
58# LORA
59# =============================================================================
60lora_r: 64
61lora_alpha: 64
62lora_dropout: 0.0
63lora_target_modules: 'model.language_model.layers.[\d]+.(_checkpoint_wrapped_module.)?(mlp|self_attn).(up|down|gate|q|k|v|o)_proj' # ... lists were too easy? We have regex now
64
65lora_mlp_kernel: false
66lora_qkv_kernel: false
67lora_o_kernel: false
68
69
70# =============================================================================
71# TRAINING HYPERPARAMETERS
72# =============================================================================
73gradient_accumulation_steps: 8
74micro_batch_size: 1
75num_epochs: 2
76optimizer: adamw_torch_fused
77lr_scheduler: constant_with_warmup
78learning_rate: 1e-5
79warmup_ratio: 0.05
80max_grad_norm: 0.5
81weight_decay: 0.05
82
83# =============================================================================
84# PRECISION
85# =============================================================================
86bf16: auto
87
88
89# =============================================================================
90# ATTENTION
91# =============================================================================
92sdp_attention: true
93#flash_attention: true # Doesn't work on Gemma 4 currently
94#flex_attention: true # up to 40% less memory use with compile, but slower than SDPA
95#torch_compile: true # speed up, but unreliable and breaks often
96#gemma4_hybrid_attn_impl: true
97
98# =============================================================================
99# LOGGING & MONITORING
100# =============================================================================
101use_comet: true # install comet-ml with pip and do comet login before starting
102comet_project_name: musica-31b
103logging_steps: 1
104
105
106# =============================================================================
107# CHECKPOINTING & SAVING
108# =============================================================================
109auto_resume_from_checkpoints: false
110evals_per_epoch: 0
111saves_per_epoch: 4
112save_total_limit: 4
113
114gradient_checkpointing: false
115gradient_checkpointing_kwargs:
116 use_reentrant: false
117
118
119# =============================================================================
120# FSDP
121# =============================================================================
122fsdp_config:
123 fsdp_version: 2
124 offload_params: false
125 cpu_ram_efficient_loading: false
126 auto_wrap_policy: TRANSFORMER_BASED_WRAP
127 transformer_layer_cls_to_wrap: Gemma4TextDecoderLayer
128 state_dict_type: FULL_STATE_DICT
129 sharding_strategy: FULL_SHARD
130 reshard_after_forward: true
131 activation_checkpointing: trueC7VeukWY16G3jr8xyN49AjytsLoHq2he8isEat39b8fg