Open Source
Explore the latest AI open-source projects from GitHub and HuggingFace.
Explore the latest AI open-source projects from GitHub and HuggingFace.
torchtitan is PyTorch's own platform for large-scale training of generative AI models, maintained by the PyTorch team at Meta. Rather than being another all-in-one training library layered on top of PyTorch, it is a minimal, clean-room implementation of PyTorch-native scaling techniques — a reference codebase meant to show, in readable form, how the framework's newest distributed-training features fit together to pretrain modern LLMs. Its accompanying paper was accepted at ICLR 2025, and the project has become the canonical showcase for how to scale training the PyTorch way. ## PyTorch-Native Multi-Dimensional Parallelism torchtitan's defining feature is composable, multi-dimensional parallelism built entirely from native PyTorch primitives. It combines FSDP2 (fully sharded data parallel with per-parameter sharding), Tensor Parallel (including async tensor parallelism), Pipeline Parallel (with zero-bubble scheduling), and Context Parallel for extremely long sequences — the team has demonstrated training with sequence lengths up to one million tokens. The design goal is that turning these strategies on requires minimal changes to the model code itself, so researchers can mix and match parallelism dimensions to fit their hardware without rewriting their model. ## Modern Training Efficiency Beyond parallelism, torchtitan integrates the efficiency features that make frontier-scale training practical. It supports torch.compile, Float8 training (including Float8 all-gather in FSDP2), and MXFP8 low-precision training for dense and Mixture-of-Experts models on Blackwell GPUs. It adds meta-device initialization to sidestep memory spikes when constructing huge models, per-operation selective and full activation checkpointing to trade compute for memory, and distributed checkpointing with async support so that saving state does not stall training. Checkpoints are interoperable with torchtune, letting a pretraining run flow directly into fine-tuning. ## A Clean, Extensible Codebase The project's guiding principles are readability and extensibility. It deliberately keeps a small, clean core of reusable, swappable components and pushes new ideas into a dedicated experiments folder so the main codebase stays understandable. Extension points let developers add custom parallelism strategies, models, or components without forking the whole system. This makes torchtitan as much a teaching artifact and research substrate as a production trainer — it is designed to be understood and built upon, not treated as a black box. ## Models and Ecosystem torchtitan ships production-grade recipes for pretraining Llama 3.1 across model sizes, and it now covers supervised fine-tuning (SFT) with chat-formatted datasets, DDP and HSDP, and TorchFT integration for fault-tolerant training that can survive machine failures during long runs. The ecosystem around it is active: PyTorch released v0.2.0 in late 2025, AMD published an optimized fork for its GPUs, and SkyPilot added first-class support for launching torchtitan jobs across clouds. Because it lives inside the PyTorch org and tracks the framework closely, it is often the first place new distributed features land in a runnable, end-to-end form. ## Trade-offs and Limitations torchtitan is squarely aimed at teams with real multi-GPU or multi-node infrastructure; it is not a single-GPU fine-tuning convenience tool, and the README notes it is under extensive development and recommends recent PyTorch nightlies to access the latest features. That fast pace means APIs can shift, and getting the most from features like async TP, Float8, or MXFP8 depends on specific hardware (for example, Blackwell GPUs for MXFP8). Its minimalist philosophy is a strength for understanding and extension but means it intentionally offers fewer turnkey conveniences than heavier training frameworks. In short, the ceiling is high but the on-ramp assumes a distributed-training audience. ## Who Should Use This torchtitan is the natural choice for ML researchers and infrastructure engineers who want to pretrain or scale generative models on PyTorch-native tooling, and for anyone who wants to learn how modern multi-dimensional parallelism actually works from a clean, authoritative reference. Teams building custom training stacks can use its extension points as a foundation, while those simply fine-tuning a small model on one GPU are better served by lighter tools. For serious, large-scale LLM training on PyTorch, it is the closest thing to an official blueprint.