AI GitHub
torchtune for explicit PyTorch training recipes
Adapt language-model tuning recipes built around PyTorch and configurable components.
Key Takeaways
- A torchtune recipe describes a training loop and composes model, optimizer, data and checkpoint components.
- Choose a recipe compatible with your model and hardware.
- Run a small adapter recipe, save its configuration and reload the result for inference.
- Checkpoint formats and distributed assumptions vary.
How it works
A torchtune recipe describes a training loop and composes model, optimizer, data and checkpoint components. The boundaries are useful when investigating training behavior.
What you need
Choose a recipe compatible with your model and hardware. Review how the recipe separates configurable components from the training and checkpointing loop.
What to try first
Run a small adapter recipe, save its configuration and reload the result for inference. Compare loss, memory and a held-out task before modifying the recipe.
Compare artifacts from a completed run and an interrupted one. Check whether both preserve the information needed for evaluation and training recovery.
Where to look for failures
Checkpoint formats and distributed assumptions vary. Check whether a saved artifact is for resuming training, serving inference or both.
Related Franklin pages
Run a tiny supervised job and check the prepared examples before investing in a large run. Save the base checkpoint, data revision and validation outputs with the recipe.
- Train supported language models with configurable datasets and tuning methods. LlamaFactory for configuring model fine-tuning
- Describe model fine-tuning runs in configuration files and reuse the recipes across experiments. Axolotl for recipe-based language model training
For the distinction between training from scratch and adapting a checkpoint, see Franklin’s glossary. Fine-tuning
Project documentation
Try it for your workflow
Explore the project’s documentation for setup and usage, or save this page to a collection for later.
Read the project documentation ↗