TorchTitan
pytorch / torchtitan
PyTorch 官方的大模型训练配方:张量并行、流水并行、FSDP 与分布式检查点,按 Llama 3 路线给参考实现。PyTorch's official large-model training recipe: tensor parallelism, pipeline parallelism, FSDP and distributed checkpoints, following the Llama 3 path.
为什么选Why choose it
- 官方维护,和 PyTorch 新特性同步快。Officially maintained and quick to adopt new PyTorch features.
- 并行组合与检查点写法清楚,适合做规模化基线。Clear parallelism combinations and checkpoint patterns — a good scaling baseline.
- 代码结构干净,方便改成自己的模型。Clean code structure, easy to adapt to your own model.
不适合Not for
只想微调一个小模型,直接用 Hugging Face Trainer。For small-model fine-tuning, use Hugging Face Trainer.
不是开箱即用的产品,需要读代码与调参。It is not a turnkey product; expect to read code and tune.
最小上手Minimum setup
- 按官方 README 拉起一个单机多卡 Llama 3 配置。Launch an official single-node multi-GPU Llama 3 config.
- 确认张量并行度与 GPU 数匹配,记录 tokens/s。Match tensor-parallel degree to GPU count and record tokens/s.
- 用分布式检查点保存再恢复一次,验证断点续训。Save and restore a distributed checkpoint once to verify resume.
依赖与成本Dependencies and cost
Python + PyTorch nightly/CUDA;多机需要高速互联;大规模训练要配专用存储。Python + PyTorch nightly/CUDA; multi-node needs high-speed interconnect; large runs need dedicated storage.
许可与使用边界License and usage boundaries
代码 BSD-3-Clause;模型权重与数据集另有许可。Code is BSD-3-Clause; model weights and datasets carry their own licenses.
开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.
替代与相邻Alternatives and neighbors
- DeepSpeed — 规模 / 性能Scale / performance,微软的大模型训练优化库:ZeRO、Offload、混合精度与 MoE 训练,把显存与吞吐压到可用。Microsoft's large-model training library: ZeRO, offload, mixed precision and MoE training to make VRAM and throughput usable.
- Axolotl — 生产可用Production,一份 YAML 配置跑通微调:支持 LoRA、QLoRA、全参、DPO、GRPO 与多机训练。One YAML config for fine-tuning: LoRA, QLoRA, full-parameter, DPO, GRPO and multi-node training.
下一步Next steps
- 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
- 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
- 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.
GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare