Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ Training is configured via YAML files. YAML is recommended for better readabilit
### Training Launch

```bash
# Recommended: torchrun
# Recommended: torchrun with YAML config
torchrun --nproc_per_node=8 --nnodes=1 --node_rank=0 \
--master_addr="127.0.0.1" --master_port="8000" \
-m lmms_engine.launch.cli --config path/to/config.yaml
-m lmms_engine.launch.cli config_yaml=path/to/config.yaml

# Alternative: accelerate
accelerate launch --use_fsdp [options] \
-m lmms_engine.launch.cli --config path/to/config.yaml
# Hydra overrides (no config file needed)
torchrun --nproc_per_node=8 --nnodes=1 --node_rank=0 \
--master_addr="127.0.0.1" --master_port="8000" \
-m lmms_engine.launch.cli \
trainer_type=fsdp2_trainer \
model_config.load_from_pretrained_path="model/path" \
trainer_args.output_dir="./output" \
trainer_args.num_train_epochs=3
```

### Development Setup
Expand Down
20 changes: 19 additions & 1 deletion docs/getting_started/train.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,30 @@ Here are frequently used parameters you can override:

See `examples/qwen3_vl/qwen3_vl_8b_train.sh` for a complete training script using Hydra overrides with comprehensive parameter configuration for multi-GPU training.

### Overriding Existing YAML Config

You can use a YAML config file as a base and override specific parameters via CLI using Hydra's config-path and config-name:

```bash
torchrun --nproc_per_node="8" \
--nnodes="1" \
--node_rank="0" \
--master_addr="127.0.0.1" \
--master_port="8000" \
-m lmms_engine.launch.cli \
--config-path /path/to/config_yaml/directory \
--config-name qwen2_5_vl_dp \
trainer_args.max_steps=100
```

This loads all settings from `qwen2_5_vl_dp.yaml` in the specified directory and only overrides the specified parameters (CLI overrides take precedence).

### Tips

- Use quotes for string values: `processor_name="Qwen/Qwen2.5-VL-7B-Instruct"`
- Use dot notation for nested configs: `trainer_args.learning_rate=1.0e-06`
- Boolean values: `packing=true` or `packing=false`
- For complex values (lists/arrays), use Hydra's syntax: `trainer_args.fsdp_config.transformer_layer_cls_to_wrap=["Qwen2_5_VLDecoderLayer"]`
- You can mix YAML config files with CLI overrides: `config_yaml=${CONFIG} trainer_args.learning_rate=1.0e-05` (CLI overrides take precedence)
- Add new parameters with `+`: `+dataset_config.extra_kwargs.image_max_pixels=4194304`