PyTorch library for LLM post-training and experimentation
Top 9.5% on sourcepulse
torchtune is a PyTorch-native library for post-training LLMs, offering hackable recipes for SFT, KD, RLHF, and QAT. It supports popular models like Llama, Gemma, and Mistral, prioritizing memory efficiency and performance through YAML configurations and integration with PyTorch's latest APIs. This library is ideal for researchers and engineers looking to fine-tune and experiment with LLMs efficiently.
How It Works
torchtune employs a modular, recipe-driven approach, allowing users to configure training, evaluation, quantization, or inference via YAML files. It leverages PyTorch's advanced features like FSDP2 for distributed training, torchao for quantization, and torch.compile
for performance gains. The library emphasizes memory efficiency through techniques like activation offloading, packed datasets, and fused optimizers, enabling larger models and batch sizes on limited hardware.
Quick Start & Requirements
pip install torchtune
(stable) or pip install --pre --upgrade torchtune --extra-index-url https://download.pytorch.org/whl/nightly/cpu
(nightly).tune --help
to list commands.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Knowledge Distillation is not supported for full weight updates across multiple devices or nodes. PPO and GRPO have limited multi-device/node support for full weight updates. QAT is not supported on single devices.
1 day ago
1 day