Views
No views yet
0.8.0.dev01# 学習のベースモデルに関する設定
2base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
3model_type: AutoModelForCausalLM
4tokenizer_type: AutoTokenizer
5
6# 学習後のモデルのHFへのアップロードに関する設定
7hub_model_id: kazuyamaa/DeepSeek-R1-Distill-Qwen-32B-axolotl-sft-v1.0
8hub_strategy: "end"
9push_dataset_to_hub:
10hf_use_auth_token: true
11
12# Liger Kernelの設定(学習の軽量・高速化)
13plugins:
14 - axolotl.integrations.liger.LigerPlugin
15liger_cross_entropy: false
16liger_rope: true
17liger_rms_norm: true
18liger_swiglu: true
19liger_fused_linear_cross_entropy: true
20
21# 量子化に関する設定
22load_in_8bit: false
23load_in_4bit: true
24
25# SFTに利用するchat templateの設定
26chat_template: gemma
27
28# 学習データセットの前処理に関する設定
29datasets:
30 - path: kanhatakeyama/ramdom-to-fixed-multiturn-Calm3
31 split: 20240806filtered[0:10000]
32 type: chat_template
33 field_messages: messages
34 message_field_role: role
35 message_field_content: content
36 - path: Aratako/Magpie-Tanuki-Qwen2.5-72B-Answered
37 split: train[0:10000]
38 type: chat_template
39 field_messages: messages
40 message_field_role: role
41 message_field_content: content
42 - path: Aratako/magpie-qwen2.5-32b-reasoning-100k-formatted
43 split: train[0:10000]
44 type: chat_template
45 field_messages: conversations
46 message_field_role: role
47 message_field_content: content
48 - path: Aratako/magpie-reasoning-llama-nemotron-70b-100k-filtered
49 split: train[0:10000]
50 type: chat_template
51 field_messages: conversations
52 message_field_role: role
53 message_field_content: content
54 - path: Aratako/Open-Platypus-Japanese-masked-formatted
55 split: train[0:10000]
56 type: chat_template
57 field_messages: conversations
58 message_field_role: role
59 message_field_content: content
60 - path: kanhatakeyama/wizardlm8x22b-logical-math-coding-sft_additional-ja
61 split: train[0:10000]
62 type: chat_template
63 field_messages: messages
64 message_field_role: role
65 message_field_content: content
66 - path: Aratako/magpie-ultra-v0.1-formatted
67 split: train[0:10000]
68 type: chat_template
69 field_messages: conversations
70 message_field_role: role
71 message_field_content: content
72 - path: Aratako/orca-agentinstruct-1M-v1-selected
73 split: train[0:10000]
74 type: chat_template
75 field_messages: messages
76 message_field_role: role
77 message_field_content: content
78 - path: Aratako/Synthetic-JP-EN-Coding-Dataset-801k-50k
79 split: train[0:10000]
80 type: chat_template
81 field_messages: messages
82 message_field_role: role
83 message_field_content: content
84
85# データセット、モデルの出力先に関する設定
86shuffle_merged_datasets: true
87dataset_prepared_path: /workspace/data/sft-data
88output_dir: /content/output/DeepSeek-R1-Distill-Qwen-32B-axolotl-sft-v1.0
89
90# valid datasetのサイズ
91val_set_size: 0.05
92
93# LoRAに関する設定(フルファインチューニングしたい場合は全て空欄にする)
94adapter: qlora
95lora_model_dir:
96lora_r: 16
97lora_alpha: 32
98lora_dropout: 0.05
99lora_target_linear: true
100lora_fan_in_fan_out:
101
102# wandbに関する設定
103#wandb_project: axolotl
104#wandb_entity: kazukitakayamas051
105#wandb_watch:
106#wandb_name: sft-lora-1
107#wandb_log_model:
108
109# 学習に関する様々な設定
110sequence_len: 4096
111sample_packing: true
112eval_sample_packing: false
113pad_to_sequence_len: true
114
115gradient_accumulation_steps: 16
116micro_batch_size: 1
117num_epochs: 1
118optimizer: paged_adamw_8bit
119lr_scheduler: cosine
120cosine_min_lr_ratio: 0.1
121learning_rate: 3e-4
122
123train_on_inputs: false
124group_by_length: false
125bf16: auto
126fp16:
127tf32: false
128
129gradient_checkpointing: false
130early_stopping_patience:
131auto_resume_from_checkpoints: true
132local_rank:
133logging_steps: 1
134xformers_attention:
135flash_attention: true
136
137save_strategy: steps
138save_steps: 50
139save_total_limit: 2
140
141warmup_steps: 10
142eval_steps: 50
143eval_batch_size: 1
144eval_table_size:
145eval_max_new_tokens:
146debug:
147deepspeed: /workspace/axolotl/deepspeed_configs/zero3_bf16.json
148weight_decay: 0.01
149fsdp:
150fsdp_config:
151special_tokens:
152 pad_token: <pad>1!apt-get update
2!apt-get install -y libopenmpi-dev
3
4!git clone https://github.com/axolotl-ai-cloud/axolotl
5
6cd axolotl
7!pip install -e .
8!pip install packaging ninja
9!pip install flash-attn
10!pip install deepspeed
11!pip install mpi4py
12
13# write権限のあるtokenを利用してHFにログイン(学習後のモデルアップロードに必要)
14!huggingface-cli login --token WRITE ME
15# wandbにログイン(wandbに学習ログを残したい場合)
16!wandb login WRITE ME
17
18import axolotl
19
20!python -m axolotl.cli.preprocess /workspace/deepseek-32b-ver001-simpo.yml --debug
21
22! accelerate launch -m axolotl.cli.train /workspace/deepseek-32b-ver001-simpo.yml --deepspeed deepspeed_configs/zero3_bf16.json
23| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.0196 | 0.0008 | 1 | 0.9386 |
| 0.732 | 0.0381 | 50 | 0.7104 |
| 0.7803 | 0.0763 | 100 | 0.6853 |
| 0.6013 | 0.1144 | 150 | 0.6712 |
| 0.6767 | 0.1526 | 200 | 0.6628 |
| 0.701 | 0.1907 | 250 | 0.6565 |
| 0.6976 | 0.2289 | 300 | 0.6520 |
| 0.7022 | 0.2670 | 350 | 0.6487 |
| 0.6889 | 0.3051 | 400 | 0.6449 |
| 0.6673 | 0.3433 | 450 | 0.6411 |
| 0.6067 | 0.3814 | 500 | 0.6382 |
| 0.644 | 0.4196 | 550 | 0.6357 |
| 0.9572 | 0.4577 | 600 | 0.6336 |
| 0.6466 | 0.4959 | 650 | 0.6310 |
| 0.6781 | 0.5340 | 700 | 0.6291 |
| 0.6473 | 0.5721 | 750 | 0.6274 |
| 0.6235 | 0.6103 | 800 | 0.6255 |
| 0.6564 | 0.6484 | 850 | 0.6238 |
| 0.6009 | 0.6866 | 900 | 0.6221 |
| 0.5759 | 0.7247 | 950 | 0.6208 |
| 0.5817 | 0.7628 | 1000 | 0.6197 |
| 0.6438 | 0.8010 | 1050 | 0.6190 |
| 0.6102 | 0.8391 | 1100 | 0.6180 |
| 0.5997 | 0.8773 | 1150 | 0.6170 |
| 0.5896 | 0.9154 | 1200 | 0.6164 |
| 0.5713 | 0.9536 | 1250 | 0.6158 |
| 0.6164 | 0.9917 | 1300 | 0.6154 |