Views
No views yet
0.13.0.dev01# Automatically upload checkpoint and final model to HF
2# hub_model_id: username/custom_model_name
3# 是否以 8-bit 精度加载模型
4load_in_8bit: false
5# 是否以 4-bit 精度加载模型(与QLoRA绑定, 强制使用)
6load_in_4bit: false
7# 是否严格匹配模型结构,关闭表示可加载少部分差异结构(如以适配 adapter)
8# strict: false
9base_model: Qwen/Qwen3-4B-Instruct-2507
10# 数据集设置
11chat_template: qwen3
12datasets:
13 - path: /workspace/axolotl/train_dir/tool_agent_train_data.json # - 表示列表(list)中的一项, 即可以同时使用多个数据集
14 type: chat_template # chat_template(自定义格式) alpaca
15 roles_to_train: ["assistant"]
16 field_messages: messages # 标识的字段
17 message_property_mappings: # message_property_mappings={'role':'role', 'content':'content'})
18 role: role
19 content: content
20dataset_prepared_path:
21val_set_size: 0.05
22output_dir: checkpoints/0917-test-03
23sequence_len: 16384 # 模型所能处理的最大上下文长度(默认2048)
24pad_to_sequence_len: true
25# context_parallel_size: 2 # 长序列拆分至多个GPU(强制要求 mirco_batch_size: 1)
26sample_packing: false # 在训练时将多个样本拼接(packing)成一个长序列(sequence_len)输入到模型中,以提高训练效率。
27eval_sample_packing: false # 评估时拼接多个样本
28# 训练超参数
29adapter: lora # lora qlora
30lora_model_dir:
31lora_r: 16 # lora_r默认首选 16,平衡精度与显存
32lora_alpha: 64 # 缩放系数,用于控制 LoRA 的影响力, 一般设为 2*r 或 4*r
33lora_dropout: 0.05
34lora_target_linear: true
35micro_batch_size: 4 # 微批次大小 94G的H100可以设为4(Token为1w)
36gradient_accumulation_steps: 8 # 梯度累积: 将多个微批次的梯度(micro_batch_size)累积起来,然后更新模型权重 有效 Batch 常取 16: 小于 8 训练会抖,大于 32 只会更耗时、收益有限
37auto_find_batch_size: false # 允许Axolotl不断调整batch_size ⚠️Zero-3不适用
38num_epochs: 1
39optimizer: adamw_torch_fused
40lr_scheduler: cosine
41learning_rate: 2e-5
42# bf16: auto + tf32: true,可获得更好的稳定性和性能。
43bf16: auto
44tf32: true
45# early_stopping_patience:
46gradient_checkpointing: true
47gradient_checkpointing_kwargs:
48 use_reentrant: false
49# auto_resume_from_checkpoints: true #自动从output_dir寻找最新checkpoint断点恢复
50logging_steps: 1
51flash_attention: true
52warmup_steps: 10
53evals_per_epoch: 4
54saves_per_epoch: 1
55weight_decay: 0.0
56# deepspeed: /workspace/deepspeed_configs/zero2.json
57# fsdp:
58# - full_shard
59# - auto_wrap
60# fsdp_config:
61# fsdp_limit_all_gathers: true
62# fsdp_sync_module_states: true
63# fsdp_offload_params: true
64# fsdp_use_orig_params: false
65# fsdp_cpu_ram_efficient_loading: true
66# fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
67# fsdp_transformer_layer_cls_to_wrap: Qwen3DecoderLayer
68# fsdp_state_dict_type: FULL_STATE_DICT
69# fsdp_sharding_strategy: FULL_SHARD
70# special_tokens:
71# wandb_project:
72# wandb_entity:
73# wandb_watch:
74# wandb_name:
75# wandb_log_model:| Training Loss | Epoch | Step | Validation Loss | Active (gib) | Allocated (gib) | Reserved (gib) |
|---|---|---|---|---|---|---|
| No log | 0 | 0 | 0.7356 | 103.1 | 103.1 | 103.76 |
| 0.5188 | 0.2689 | 8 | 0.5580 | 103.39 | 103.39 | 135.41 |
| 0.1782 | 0.5378 | 16 | 0.1617 | 103.39 | 103.39 | 137.25 |
| 0.1164 | 0.8067 | 24 | 0.1236 | 103.39 | 103.39 | 137.25 |