Skip to content

Releases

v0.4.0

Choose a tag to compare

@acisseJZhong acisseJZhong released this 28 Oct 18:05
45e33cd

TorchTitan 0.4.0

TorchTitan 0.4.0 aligns with PyTorch 2.15, expands model coverage, improves large-scale MoE training, and unifies core training and TitanRL on a shared engine.

These highlights cover changes since 0.3.0. For broader updates and benchmarks, see TorchTitan Update: New SOTA Models, Performance at Scale, TitanRL.

New model implementations

  • Muse Spark Open: Adds the 816B-A42B model, including text and vision/audio configurations. Multimodal CUDA graphs remain unsupported. (#5420)
  • Kimi K3: Hybrid KDA/MLA attention, LatentMoE, and vision support, with tensor/sequence and expert parallelism plus a dedicated pipeline implementation for attention residuals. (#4025, #4312)
  • DeepSeek V4: Initial Flash/Pro support with sparse attention, indexer loss, optional multi-token prediction, and debug recipes. Full-scale checkpoint and convergence validation remain outstanding. (#3634, #4835)

Training performance and memory

  • Dist-MoE integration: Fuses expert dispatch, computation, and combine. DeepSeek V3 BF16/MXFP8 recipes for NVIDIA SM100+ GPUs include fused MLA and SwiGLU. (#4541, #4542)
  • Low-precision training: MXFP8 gains FSDP-managed prepared weights and fused weight-gradient accumulation across microbatches. Experimental NVFP4 support extends to grouped MoE linear layers. Both paths require supported Blackwell hardware and their respective optional dependencies. (#4203, #4911, #4821)
  • Local compilation: model.local_compile_regions selects functions such as SwiGLU, RoPE, and gated RMSNorm for independent compilation and kernel fusion with torch.compile. (#4894, #4931, #4985, #5026)
  • Faster router and LM-head layers: HiMidLoLinear uses BF16 matrix multiplications with FP32 outputs. Its backward pass combines two or three BF16 parts of each FP32 output gradient, improving accuracy over a single BF16 cast. (#4923)
  • CUDA graphs and pipeline memory: Adds pipeline forward/backward capture, shared training/validation graph memory, and per-microbatch-group replay, plus controls for FSDP parameter residency and unshard lookahead. (#4493, #5241, #4592)
  • Context parallelism: Adds Ulysses support for standard and variable-length attention, improves MLA communication, and adds native context-parallel paths for Qwen3.5 Gated DeltaNet and Kimi K3 KDA. (#4450, #4760, #5184)
  • Activation rematerialization: torch_remat controls activation saving and recomputation by region. DeepEP dispatch preserves token order during recomputation, preventing incorrect MoE gradients. (#4497, #5115)
  • FlexShard / DistMuon: Extends optimizer-compute layouts with variable-sized BlockShard partitions and BF16 redistribution of optimizer inputs and update directions. (#4840, #5279)

TitanRL

  • TitanRL moves out of the experimental folder: Now in torchtitan.rl (formerly torchtitan.experiments.rl), it shares the core TrainingEngine and supports pipeline and context parallel training. (#4773, #3980, #5424)
  • Extensible execution: ActorSystem separates service placement from RL logic, while GenerationEngine separates inference execution from request dispatch. Monarch and vLLM remain the provided defaults. (#5391, #5317)
  • Multi-turn and agentic workloads: Optional session KV retention reuses cached prefixes across turns. Adds Verifiers and Terminal-Bench examples, plus a Muse Glimmer recipe for Search-R1. (#5220, #4356, #4942, #4145)

Data, checkpointing, and debugging

  • Grain data pipeline: Composable dataset sources, mixing, packing, prefetching, and checkpointable iterator state replace the previous loader. Multi-turn text SFT adds renderer-based processing, tool metadata, and assistant-token loss masks. (#4088, #2769)
  • Batch dimension folding: Flattens language-model batches from [B, L, D] to [T, D], enabling token-based batching with less SFT padding. (#4121)
  • Checkpointing: Adds native Hugging Face safetensors loading via torch_checkpointing and parallel HF reads via DCP. Resume fixes initialize EMA when its state is absent and preserve configured BF16 Adam/AdamW moments. (#4277, #5087, #5141, #4615)
  • Deterministic replay: An optional SDC check replays forward/backward execution, including gradient accumulation and pipeline microbatches, to detect mismatches. Deterministic execution is required. (#4333, #4334)
  • GraphTrainer improvements: Adds full Inductor compilation, spmd_types tracing, and improved in-place weight-gradient accumulation to the experimental graph trainer. (#4222, #4325, #5208)

Compatibility and upgrade notes

  • Recipe configuration: Use fully qualified Python recipe modules with --module and --config; move general CLI overrides into your recipe function. Rebuild model configurations when changing sequence or expert parallelism. (configuration guide)
  • Removed features: Whole-TransformerBlock compilation in the standard trainer is replaced by model.local_compile_regions. Legacy Float8 training, MinimalAsyncEP, and the full_dtensor backend have been removed. (#4895, #4961, #4627, #4217)
  • MXFP8 dependencies: Use a TorchAO nightly build for MXFP8 training in TorchTitan 0.4.0. TorchAO 0.18 does not include the required kernels.

Thank you to everyone who contributed code, testing, bug reports, and feedback!

Full Changelog: v0.3.0...v0.4.0

v0.3.0

Choose a tag to compare

@acisseJZhong acisseJZhong released this 03 Sep 03:51

What's changed

Compared with v0.2.2, TorchTitan 0.3.0 adds typed Python configuration, expands model and declarative parallelism support, and enhances MoE execution, graph-native training, training efficiency, SFT, and RL.

Configuration architecture and extensibility

Recipes now support Python inheritance and typed CLI overrides. An opt-in override registry also lets external packages replace selected model or training components without modifying TorchTitan core.

Key PRs:

  • Python configuration refactor (#2386)
  • External override registry (#3396)

Models and architecture

This release adds Qwen3.5 with variable-length attention, Kimi K2.7 with DistributedMuon, Muse Glimmer 30B, DeepSeek V3 MTP and fused MLA, and Flux compilation with MXFP8.

Key PRs:

  • Qwen3.5 (#3371)
  • Qwen3.5 variable-length attention (#3801)
  • Kimi K2.7 (#3532)
  • Kimi K2.7 DistributedMuon overlap (#4060)
  • Muse Glimmer 30B (#4106)
  • Muse Glimmer FA3 and vLLM support (#4126)
  • DeepSeek V3 MTP (#3392)
  • DeepSeek V3 fused MLA (#4134)
  • Flux compile and MXFP8 (#2579)

Declarative SPMD

spmd_types is now the default SPMD backend, providing declarative state and activation sharding across Llama 3, Qwen3, DeepSeek V3, GPT-OSS, Flux, Qwen3.5, Kimi K2.7, Muse Glimmer, and the Transformers modeling backend.

Some GraphTrainer configurations continue to use the legacy partial_dtensor backend, where model-parallel axes use DTensor while FSDP is managed separately.

Read the SPMD types integration devlog for more details.

Key PRs:

MoE execution and expert parallelism

MoE is reorganized around a unified token-dispatcher interface that separates routing, token movement, and expert computation. Standard, MinimalAsyncEP, DeepEP, and HybridEP backends support communication overlap, CUDA graphs, and composition with TP, CP, PP, activation checkpointing, and compilation.

Key PRs:

  • Token dispatcher (#2842)
  • Dispatcher decomposition (#3389)
  • Unified dispatcher API (#3970)
  • SPMD sparse-mesh transitions (#3654)
  • MinimalAsyncEP (#3561)
  • MinimalAsyncEP composition (#4089)
  • HybridEP compilation (#3360)
  • DeepEP v2 (#3808)

GraphTrainer and GraphPP

GraphTrainer captures the forward, loss, and backward step as one graph that can be transformed, precompiled once, and reused across ranks. Its graph passes manage activation memory and overlap FSDP or expert-parallel communication with computation.

GraphPP partitions this graph into pipeline stages and supports schedules including DualPipeV.

Key PRs:

  • Whole-step tracing (#2561)
  • Rank-agnostic precompilation (#2713)
  • Activation-memory framework (#3118)
  • FSDP communication overlap (#3156)
  • EP communication overlap (#3328)
  • CUDA Graph execution (#2868)
  • GraphPP stage partitioning (#2726)
  • Backward splitting (#2727)
  • FSDP collective splitting (#3088)
  • GraphPP runner (#3089)
  • DualPipeV validation (#3090)

Precision, memory, and training efficiency

BF16 optimizer states, MXFP8, Float8, and NVFP4 reduce memory use and enable lower-precision training. Composable activation-checkpointing policies reduce activation memory, while Trainer CUDA graphs reduce CPU launch overhead.

Key PRs:

Supervised fine-tuning

ChatDataset and a new SFT recipe support training on chat-formatted conversations.

Key PR: ChatDataset and SFT (#2556)

TitanRL

Experimental TitanRL workflows add asynchronous and multi-turn rollouts, continuous batching, multi-generator routing, overlapped weight synchronization, checkpoint and resume support, and Search-R1 and DAPO recipes.

TitanRL requires additional dependencies. Follow the TitanRL quick-start guide before running these workflows.

Key PRs:

  • Async RL loop (#3642)
  • Continuous batching and multi-turn rollouts (#3593)
  • Overlapped weight sync (#3810)
  • Checkpoint and resume (#3751)
  • Search-R1 (#3602)
  • DAPO (#3951)

Compatibility

Component Validated version
Python 3.11, 3.12
PyTorch 2.14.0
torchvision 0.29.0
torchao 0.18.0

Installation

uv pip install torchtitan==0.3.0

v0.2.2

v0.2.2 Pre-release
Pre-release

Choose a tag to compare

@wwwjn wwwjn released this 20 Feb 22:47
73a0e69

Dependency

PyTorch Version: torch-2.12.0.dev20260220+cu126
TorchAO Version: torchao-0.17.0.dev20260220+cu126

What's changed

🚀 Features

🧠 Model

🐛 Bug Fixes

🧪 Experiments / CI / Infra

🔧 Typing / Lint Cleanup

  • [lint] Ignore all existing pyrefly errors (#2240) by @xmfan
  • [Typing] Fix CI Typing Issues (#2245) by @fegin
  • [Typing] Improve ModelProtocol typing (#2246) by @fegin
  • [Typing] Remove deprecated enable_symm_mem_for_group (#2260) by @fegin
  • [Typing] Remove unused pyrefly ignore (#2280) by @fegin
  • [Typing] Fix pyrefly-ignore in train.py (#2282) by @fegin
  • [Typing] Fix pyrefly ignores in checkpoint.py (#2283) by @fegin
  • [Typing] Fix the ignores in activation_checkpoint.py (#2284) by @fegin
  • [Typing] Fix the ignores in tokenizer.py (#2285) by @fegin
  • [Typing] Fix the ignores in validate.py (#2286) by @fegin
  • [Typing] Fix some pyrefly ignores in optimizer.py (#2294) by @fegin
  • [Typing] Improve typing for some distributed modules (#2295) by @fegin
  • [Typing] Fix the pyrefly ignores in llama3 model.py (#2302) by @fegin
  • [Typing] Fix pyrefly ignores in llama4 model.py (#2303) by @fegin
  • [Typing] Fix pyrefly ignores in qwen3 model.py (#2304) by @fegin
  • [Typing] Fix pyrefly ignores in deepseek model.py (#2305) by @fegin

v0.2.1

v0.2.1 Pre-release
Pre-release

Choose a tag to compare

@wwwjn wwwjn released this 26 Dec 23:29
81af883

Dependency

pytorch verison: torch-2.11.0.dev20251226+cu126
torchao version: torchao-0.16.0.dev20251226+cu126

What's Changed

Features

  • Use new DeviceMesh unflatten to rewrite parallel_dims by @fegin in #1660
  • Re:Run Torchtitan ROCm workflow on cron schedule & push to Main branch only by @akashveramd in #2018
  • adding variable length attention to llama3 8b by @liangel-02 in #2000
  • [Local Tensor] Replace dry_run.py with fake mode implementation by @fegin in #2057

Model

Bug Fix

  • [FLOPs] Fix attention FLOPs estimate by @shuhuayu in #1923
  • Fix apply_compile called multiple times in PP initialization by @xmfan in #2135
  • Fix qwen3 attention scaling calculation by @wwwjn in #2173

Experiments

Full Changelog: v0.2.0...v0.2.1

v0.2.0

v0.2.0 Pre-release
Pre-release

Choose a tag to compare

@wwwjn wwwjn released this 18 Oct 04:26
29624e3

Dependency

pytorch verison: torch-2.10.0.dev20251019+cu126
torchao version: torchao-0.15.0.dev20251015+cu126

Full Changelog: v0.1.0...v0.2.0

v0.1.0

v0.1.0 Pre-release
Pre-release

Choose a tag to compare

@tianyu-l tianyu-l released this 18 Jun 00:39
f7084fc

This is the first pre-release of torchtitan, following the release practice outlined in #688.

torch version: torch-2.8.0.dev20250617+cu126
torchao version: torchao-0.12.0.dev20250617+cu126