torchtitan is a clean-room, PyTorch-native implementation of large-scale
training. One readable codebase takes a model from pretraining through
supervised fine-tuning to reinforcement learning, composing FSDP, tensor,
pipeline, context, and expert parallelism without rewriting the model.
Composable parallelism. Models declare how they shard; FSDP2, TP, PP, CP,
and EP stack into N-D layouts through DeviceMesh and DTensor.
Built for research. Minimal, hackable code; every run is a Python
recipe you can read, copy, and modify.
Pretraining to RL in one stack.TitanRL runs the
same model definitions and kernels in the trainer and in vLLM generation, with
a bitwise-reproducible batch-invariant mode.
Frontier models and techniques. DeepSeek, Qwen, Kimi, gpt-oss, Llama, and
FLUX, with MXFP8/NVFP4 low precision, Dist-MoE, CUDA graphs, and more.
[!NOTE]
torchtitan is under active development. To use the latest features, use a
recent PyTorch nightly.
Latest news
[2026/08]TitanRL is a hackable RL stack for scaling and debugging. It reuses TorchTitan model definitions and kernels across training and vLLM generation and supports batch-invariant mode.
[2025/11] AMD released an optimized fork of torchtitan for AMD GPUs.
Every model has debug configurations exercised in CI. Verified recipes have
been run in training, convergence, or performance workflows. To add a model, see
the model guide.
Replace cu132 with another CUDA version or a ROCm build (e.g. rocm10.0).
Stable releases
pip install torchtitan
# or
conda install conda-forge::torchtitan
Each stable release pins the nightly versions of torch and torchao it was
validated against; see RELEASE.md.
Optional dependencies
Low precision (MXFP8, NVFP4): install a torchao nightly matching your
torch build. It is not in requirements.txt so it cannot be resolved
against a different torch:
RL:scripts/install_rl_env.sh installs the vLLM, Monarch, and TorchStore
nightlies and the FlashAttention build for your GPU. See the
RL quick start.
Extras for vision, FLUX, RL, and development are also available as
pip install -e ".[vlm,flux,rl,dev]".
Importing from elsewhere: the source tree runs as is; to import
torchtitan from another directory, install it in editable mode without
re-resolving dependencies: pip install -e . --no-deps.
Multi-node training with Slurm
Submit scripts/multinode_trainer.slurm with
sbatch from the repository root. Set the node count in both the #SBATCH
header and the torchrun --nnodes argument:
@inproceedings{
liang2025torchtitan,
title={TorchTitan: One-stop PyTorch native solution for production ready {LLM} pretraining},
author={Wanchao Liang and Tianyu Liu and Less Wright and Will Constable and Andrew Gu and Chien-Chin Huang and Iris Zhang and Wei Feng and Howard Huang and Junjie Wang and Sanket Purandare and Gokul Nadathur and Stratos Idreos},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=SFN6Wm7YBI}
}
License
Source code is made available under a BSD 3 license. You may have
other legal obligations that govern your use of other content linked in this
repository, such as the license or terms of service for third-party data and
models.
Alternatives
Use instead of torchtitan: tools that do the same job, closest first.