TorchTitan更新:支持Qwen3等SOTA模型及RL训练
TorchTitan Update: New SOTA Models, Performance at Scale, TitanRL
做大规模训练的同学必看,这次把主流开源模型和RL训练全打通了,还有GB300实测数据,直接拿来压测你的链路。
TorchTitan is a PyTorch-native platform for rapid experimentation and large-scale pre- and post-training of generative AI models. It is designed as a minimal, clean-room implementation of PyTorch-native techniques, with flexible extension points for users’ needs. This has enabled TorchTitan to find widespread adoption across research and production in academia and industry.
TorchTitan 是一个原生 PyTorch 平台,用于生成式 AI 模型的快速实验以及大规模预训练和后训练。它被设计为对 PyTorch 原生技术的最小化、洁净室实现,并为用户提供了灵活的扩展点。这使得 TorchTitan 在学术界和工业界的研究与生产环境中得到了广泛应用。
The TorchTitan team landed massive improvements in the past year, without losing its minimal, extensible ethos. Enhancements include support for SOTA models, dramatic improvements of out-the-box performance at scale, RL support and new communication features.
过去一年中,TorchTitan 团队实现了巨大的改进,同时保持了其最小化和可扩展的理念。增强功能包括对 SOTA(最先进)模型的支持、大规模开箱即用性能的显著提升、RL(强化学习)支持以及新的通信功能。
TorchTitan is for everyone – easy to use, providing SOTA performance and allowing users to start small and scale up seamlessly. We will present all these new improvements in the following sections, and we look forward to your feedback!
TorchTitan 面向所有人——易于使用,提供 SOTA 性能,并允许用户从小规模起步并无缝扩展。我们将在以下部分介绍所有这些新改进,并期待您的反馈!
New model support
新模型支持
SOTA model support is critical for the success of training frameworks, and TorchTitan aims to always provide the latest advancements when it comes to open-weights architecture. TorchTitan added PyTorch-native support for Muse Spark Open, Muse Glimmer, Qwen3-VL and Qwen3.5, Kimi K2.7, Kimi K3, and DeepSeek-V4. These were full training-stack integrations with support across TorchTitan’s 5D parallelism stack. This work also introduced a composable configuration system built around typed Python recipes, model-config transforms, and targeted component overrides. Users can change parallelization strategies, model components, or hardware-specific kernels without maintaining separate model forks. The same interfaces integrate optimized kernels from Attention Gym, including Gated DeltaNet, Kimi Delta Attention, and sparse-attention kernels, as well as opt-in Helion kernels such as fused RoPE, while remaining compatible with torch.compile.
SOTA 模型支持对于训练框架的成功至关重要,TorchTitan 旨在始终提供开放权重架构方面的最新进展。TorchTitan 增加了对 Muse Spark Open、Muse Glimmer、Qwen3-VL 和 Qwen3.5、Kimi K2.7、Kimi K3 以及 DeepSeek-V4 的原生 PyTorch 支持。这些集成涵盖了完整的训练栈,并支持 TorchTitan 的 5D 并行栈。这项工作还引入了一种围绕类型化 Python 配方、模型配置转换和针对性组件覆盖构建的可组合配置系统。用户可以在不维护单独模型分支的情况下更改并行化策略、模型组件或特定于硬件的内核。相同的接口集成了来自 Attention Gym 的优化内核,包括 Gated DeltaNet、Kimi Delta Attention 和稀疏注意力内核,以及可选的 Helion 内核(如融合 RoPE),同时保持与 torch.compile 的兼容性。
Each frontier model expands TorchTitan’s reusable toolkit, from multimodal data pipelines, sample packing, shared vision components, and Hugging Face checkpoint interoperability to composable 5D parallelism, declarative sharding, optimized Attention Gym and Helion kernels, and rigorous numerical validation. Developers can build on this foundation to bring newly released architectures to validated, scalable training faster, entirely in native PyTorch.
每个前沿模型都扩展了 TorchTitan 的可重用工具包,涵盖多模态数据管道、样本打包、共享视觉组件和 Hugging Face 检查点互操作性,到可组合的 5D 并行性、声明式分片、优化的 Attention Gym 和 Helion 内核,以及严格的数值验证。开发者可以在此基础上构建,以完全原生的 PyTorch 方式,更快地将新发布的架构带入经过验证的可扩展训练中。
TitanRL
TorchTitan now does reinforcement learning! Many RL stacks keep separate training and inference implementations of the model. Architecture changes have to stay aligned across both, and when a run goes sideways it is hard to tell whether the culprit is your reward, your algorithm, or the two copies quietly disagreeing. TitanRL keeps the same model from pretraining, post-training to inside vLLM, so you can do your work in one codebase.
TorchTitan 现在支持强化学习!许多 RL 框架将模型的训练和推理实现分开维护。架构变更必须在两者间保持同步,当运行出现异常时,很难判断问题出在奖励函数、算法还是两份代码的静默分歧上。TitanRL 从预训练、后训练到 vLLM 内部始终使用同一个模型,因此你可以在一个代码库中完成所有工作。
Agentic RL at scale
大规模智能体强化学习
TitanRL supports what you need to train agentic workloads. Rollouts run asynchronously – training and generation each scale with multiple forms of parallelism.
TitanRL 支持你训练智能体工作负载所需的一切。Rollouts( rollout 过程)异步运行——训练和生成各自通过多种并行形式进行扩展。
We tested it on several workloads, as seen below, demonstrating that it can perform stable training on MoEs and dense models, for hundreds of steps, on tasks that require long context, code execution, compaction, harness, self-play, etc.
我们在多个工作负载上对其进行了测试,如下所示,证明它能够在需要长上下文、代码执行、压缩、工具调用、自我对弈等任务上,对 MoE 和密集模型进行数百步的稳定训练。
Figure 1: Train/Validation on SWE-Rebench easy, model Qwen3.5-35B-A3B base, 64K context, 40 GB300
图 1:SWE-Rebench easy 上的训练/验证,模型 Qwen3.5-35B-A3B base,64K 上下文,40 GB300
Figure 2: Train on Tmax 15k, Eval on terminal bench 2.1, model Qwen3.5-35B-A3B base, 128K context, 20 GB300
图 2:Tmax 15k 上的训练,terminal bench 2.1 上的评估,模型 Qwen3.5-35B-A3B base,128K 上下文,20 GB300
Correctness and debugging
正确性与调试
TitanRL comes with strong correctness guarantees! Say you just enabled a new algorithm or kernel, launched a run, and the rewards differ from your baseline. Is that your change, or noise? Batch-invariant mode takes one source of noise off the table: in supported on-policy configurations, the trainer and generator produce bitwise identical log probabilities, so the gap between them is exactly zero at every step. A recent study with the TorchTitan team uses it to examine numerical mismatch in math and terminal-agent RL. This helps users focus on their research rather than infrastructure.
TitanRL 提供强大的正确性保证!假设你刚刚启用了新算法或内核并启动了一个运行,但奖励与基线不同。这是你的改动导致的,还是噪声?Batch-invariant(批次不变)模式消除了一类噪声来源:在支持的在线策略配置中,训练器和生成器会产生比特级一致的 log probabilities(对数概率),因此它们在每一步之间的差异恰好为零。TorchTitan 团队最近的一项研究利用该特性来检查数学和终端智能体 RL 中的数值不匹配。这有助于用户专注于研究工作而非基础设施问题。
Out-the-box Performance improvements
开箱即用的性能提升
TorchTitan shipped massive performance improvements for MoE models in the past year – around three focus areas: faster kernels for higher computer utilization, maximizing communication compute overlap, and fine grained control of memory.
过去一年,TorchTitan 为 MoE 模型带来了巨大的性能提升——主要集中在三个领域:更快的内核以提高计算利用率、最大化通信与计算的重叠,以及对内存的细粒度控制。
local_compile brings the benefits of native torch.compile without committing to full-graph or full-block tracing, allowing users to selectively optimize key regions while preserving numerics without maintaining custom kernels.
local_compile 在不承诺全图或全块追踪的情况下,带来了原生 torch.compile 的好处,允许用户选择性优化关键区域,同时在无需维护自定义内核的情况下保留数值精度。
For memory management, torch_remat offers a modern activation checkpointing API with fine-grained control over recomputed regions, avoiding CPU overhead and custom op wrapper requirements.
在内存管理方面,torch_remat 提供了一个现代的激活检查点 API,可对重新计算的区域进行细粒度控制,避免 CPU 开销和自定义 op 包装器的需求。
For distributed compute and scaling, Dist-MoE provides fused communication-compute kernels for NVIDIA SM100+ GPUs with activation packing for dynamic tensors to remain fully CUDA-graphable. Meanwhile, a fully revamped pipeline parallel package provides CUDA-graphable, deterministic execution with user control knobs to maximize overlap when composing FSDP and pipeline parallelism.
针对分布式计算和扩展,Dist-MoE 为 NVIDIA SM100+ GPU 提供了融合通信-计算内核,并通过动态张量的激活打包保持完全兼容 CUDA Graph。同时,全面重构的流水线并行包提供了支持 CUDA Graph、确定性执行的功能,并配备用户控制旋钮,以便在组合 FSDP 和流水线并行时最大化重叠。
Finally, TorchTitan overrides enable clean integration of specialized model-specific kernels—such as fused MLA, fused SwiGLU, and fused Complex RoPE – without sacrificing the simplicity and maintainability of the code.
最后,TorchTitan 的 override 机制实现了专用模型特定内核(如融合 MLA、融合 SwiGLU 和融合 Complex RoPE)的干净集成,同时不牺牲代码的简洁性和可维护性。
DSV3 671B Results
DSV3 671B 结果
By composing all of the above performance features we evaluated the performance and numerics of Deepseek V3 671b+MTP1 module on the MLPerf training benchmark on our internal GB300 cluster scaling only the PP, DP and EP axes. The quantization scheme used is MXFP8.
通过组合上述所有性能特性,我们在内部 GB300 集群上仅扩展 PP、DP 和 EP 轴的情况下,在 MLPerf 训练基准测试中评估了 Deepseek V3 671b+MTP1 模块的性能和数值精度。使用的量化方案为 MXFP8。
Results
结果
| Run | GPUs | PP / VPP / DP / EP | LBS / microbatches | TPS/GPU | Global TPS | TFLOPs/GPU | Peak HBM |
|---|---|---|---|---|---|---|---|
| PP2-256 | 256 | 2 / 8 / 128 / 64 | 120 / 120 | 5,324.21 | 1,362,998 | 1,553.89 | 243.86 GiB |
| PP2-512 | 512 | 2 / 8 / 256 / 64 | 60 / 60 | 5,262.68 | 2,694,493 | 1,535.93 | 224.65 GiB |
| PP4-256 | 256 | 4 / 4 / 64 / 64 | 240 / 240 | 5,178.22 | 1,325,624 | 1,511.28 | 238.08 GiB |
| PP4-512 | 512 | 4 / 4 / 128 / 64 | 120 / 120 | 5,087.99 | 2,605,049 | 1,484.95 | 221.14 GiB |
| PP8-512 | 512 | 8 / 2 / 64 / 64 | 240 / 240 | 4,780.79 | 2,447,763 | 1,395.29 | 233.96 GiB |
| 运行配置 | GPU 数量 | PP / VPP / DP / EP | LBS / 微批次 | TPS/GPU | 全局 TPS | TFLOPs/GPU | 峰值 HBM |
|---|---|---|---|---|---|---|---|
| PP2-256 | 256 | 2 / 8 / 128 / 64 | 120 / 120 | 5,324.21 | 1,362,998 | 1,553.89 | 243.86 GiB |
| PP2-512 | 512 | 2 / 8 / 256 / 64 | 60 / 60 | 5,262.68 | 2,694,493 | 1,535.93 | 224.65 GiB |
| PP4-256 | 256 | 4 / 4 / 64 / 64 | 240 / 240 | 5,178.22 | 1,325,624 | 1,511.28 | 238.08 GiB |
| PP4-512 | 512 | 4 / 4 / 128 / 64 | 120 / 120 | 5,087.99 | 2,605,049 | 1,484.95 | 221.14 GiB |
| PP8-512 | 512 | 8 / 2 / 64 / 64 | 240 / 240 | 4,780.79 | 2,447,763 | 1,395.29 | 233.96 GiB |
Muse Spark Open
For our MuseSpark 1.2 OSS release we showcase our high precision long context training efficiency demonstrating our TP, EP and CP scaling.
在 MuseSpark 1.2 OSS 发布版本中,我们展示了高精度长上下文训练效率,体现了我们的 TP、EP 和 CP 扩展能力。
Results
结果
| Routing | GPUs | Context | Parallelism | TPS/GPU | Global TPS | TFLOPS/GPU | MFU | Peak HBM |
|---|---|---|---|---|---|---|---|---|
| Learned | 256 | 96K | PP1/DP16/TP4/CP4/EP64 | 1,500.61 | 384,156 | 646.03 | 25.84% | 253.66 GiB |
| Forced balanced | 256 | 96K | PP1/DP16/TP4/CP4/EP64 | 1,839.52 | 470,918 | 791.95 | 31.68% | 253.66 GiB |
| Learned | 512 | 192K | PP1/DP16/TP4/CP8/EP64 | 1,335.86 | 683,961 | 781.66 | 31.27% | 235.64 GiB |
| Forced balanced | 512 | 192K | PP1/DP16/TP4/CP8/EP64 | 1,588.22 | 813,168 | 929.33 | 37.17% | 235.65 GiB |
| 路由策略 | GPU 数量 | 上下文长度 | 并行方式 | TPS/GPU | 全局 TPS | TFLOPS/GPU | MFU | 峰值 HBM |
|---|---|---|---|---|---|---|---|---|
| Learned | 256 | 96K | PP1/DP16/TP4/CP4/EP64 | 1,500.61 | 384,156 | 646.03 | 25.84% | 253.66 GiB |
| Forced balanced | 256 | 96K | PP1/DP16/TP4/CP4/EP64 | 1,839.52 | 470,918 | 791.95 | 31.68% | 253.66 GiB |
| Learned | 512 | 192K | PP1/DP16/TP4/CP8/EP64 | 1,335.86 | 683,961 | 781.66 | 31.27% | 235.64 GiB |
| Forced balanced | 512 | 192K | PP1/DP16/TP4/CP8/EP64 | 1,588.22 | 813,168 | 929.33 | 37.17% | 235.65 GiB |
Ecosystem integrations
生态系统集成
One of TorchTitan’s strengths is its simplicity and reusability. As a result, several projects in the ecosystem chose to integrate and offer TorchTitan as a trainer. In particular:
TorchTitan 的优势之一在于其简洁性和可复用性。因此,生态系统中的几个项目选择集成 TorchTitan 并将其作为训练器提供。特别是:
- TorchTitan has been integrated to veRL as a training backend (roadmap, code)
- TorchTitan has also been added to Miles (readme, post)
- TorchTitan is the default training backend for Meshy, and inspires the core implementation of Areal’s training engine Archon
- TorchTitan 已集成到 veRL 中作为训练后端(路线图,代码)
- TorchTitan 也已添加到 Miles 中(自述文件,帖子)
- TorchTitan 是 Meshy 的默认训练后端,并启发了 Areal 训练引擎 Archon 的核心实现
FlexShard
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力