mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2026-09-14 19:25:43 +08:00
[v1] Support multimodal Ulysses CP and memory-efficient chunk loss for SFT (#10762)
This commit is contained in:
27
examples/v1/train_full/train_full_chunk_loss.yaml
Normal file
27
examples/v1/train_full/train_full_chunk_loss.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
model: Qwen/Qwen3-0.6B
|
||||
trust_remote_code: true
|
||||
model_class: llm
|
||||
|
||||
kernel_config:
|
||||
name: auto
|
||||
|
||||
# FSDP Config
|
||||
dist_config:
|
||||
name: fsdp2
|
||||
dcp_path: null
|
||||
|
||||
### data
|
||||
train_dataset: data/v1_sft_demo.yaml
|
||||
|
||||
### training
|
||||
output_dir: outputs/test_chunk_loss
|
||||
micro_batch_size: 1
|
||||
cutoff_len: 2048
|
||||
# Maximum flattened token rows per logits/CE chunk; this is not the sequence length.
|
||||
chunk_loss_size: 256
|
||||
learning_rate: 1.0e-4
|
||||
max_steps: 10
|
||||
|
||||
### sample
|
||||
sample_backend: hf
|
||||
max_new_tokens: 128
|
||||
25
examples/v1/train_full/train_full_multimodal_ulysses_cp.yaml
Normal file
25
examples/v1/train_full/train_full_multimodal_ulysses_cp.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
model: Qwen/Qwen3.5-0.8B
|
||||
trust_remote_code: true
|
||||
model_class: llm
|
||||
|
||||
flash_attn: flash_attention_2
|
||||
|
||||
# FSDP Config
|
||||
dist_config:
|
||||
name: fsdp2
|
||||
dcp_path: null
|
||||
|
||||
cp_mode: ulysses
|
||||
cp_size: 2
|
||||
|
||||
### data
|
||||
train_dataset: data/v1_multimodal_demo.yaml
|
||||
|
||||
### training
|
||||
output_dir: outputs/test_multimodal_ulysses_cp
|
||||
micro_batch_size: 1
|
||||
batching_strategy: normal
|
||||
cutoff_len: 2048
|
||||
learning_rate: 1.0e-4
|
||||
bf16: false
|
||||
max_steps: 10
|
||||
Reference in New Issue
Block a user