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
20 changes: 15 additions & 5 deletions recipes/smollm3/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@

# Instructions to train SmolLM3-3B

We are open-sourcing all the artifacts to train [SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B). You can find the configuration files for the three post-training stages in the [`sft`](https://github.com/huggingface/alignment-handbook/tree/main/recipes/smollm3/sft) and [`dpo`](https://github.com/huggingface/alignment-handbook/tree/main/recipes/smollm3/dpo) directories.

We are currently working on the code release, so this README will contain the instructions to run training after we release the code on the week of July 14, 2025.
We are open-sourcing all the artifacts to train [SmolLM3-3B](https://huggingface.co/HuggingFaceTB/SmolLM3-3B). You can find the configuration files for the three post-training stages (mid-training, SFT, and DPO) in the [`sft`](https://github.com/huggingface/alignment-handbook/tree/main/recipes/smollm3/sft) and [`dpo`](https://github.com/huggingface/alignment-handbook/tree/main/recipes/smollm3/dpo) directories.

## Setup

[WIP]
Make sure you followed the installation instructions in the [README.md](README.md) file. We tested the training setup with 8 GPUs (80GB of VRAM) to train the full model.

## Full training examples

```shell
# Step 1 - Mid-Training
ACCELERATE_LOG_LEVEL=info accelerate launch --config_file recipes/accelerate_configs/zero3.yaml scripts/sft.py --config recipes/smollm3/sft/mid.yaml --gradient_accumulation_steps 16

# Step 2 - SFT
ACCELERATE_LOG_LEVEL=info accelerate launch --config_file recipes/accelerate_configs/zero3.yaml scripts/sft.py --config recipes/smollm3/sft/sft.yaml --gradient_accumulation_steps 16

# Step 2 - DPO
ACCELERATE_LOG_LEVEL=info accelerate launch --config_file recipes/accelerate_configs/zero3.yaml scripts/dpo.py --config recipes/smollm3/dpo/apo.yaml --gradient_accumulation_steps 4
```
2 changes: 1 addition & 1 deletion recipes/smollm3/sft/sft.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Config for 8 nodes
# Config for 8 nodes with GBS 128
# Model arguments
model_name_or_path: HuggingFaceTB/SmolLM3-3B-checkpoints
model_revision: it-mid-training
Expand Down