跳到主要内容Skip to main content
训练与微调Training & Fine-tuning规模 / 性能Scale / performance

DeepSpeed

deepspeedai / DeepSpeed

微软的大模型训练优化库:ZeRO、Offload、混合精度与 MoE 训练,把显存与吞吐压到可用。Microsoft's large-model training library: ZeRO, offload, mixed precision and MoE training to make VRAM and throughput usable.

43.3k stars 5080 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-11-19

为什么选Why choose it

  • ZeRO 分片让单机多卡能训更大模型。ZeRO sharding lets one multi-GPU node train larger models.
  • 与 Hugging Face Trainer 集成,改几行配置就能用。Integrates with Hugging Face Trainer; a few config lines are enough.
  • 支持 CPU/NVMe offload,显存不够时有退路。CPU/NVMe offload provides a fallback when VRAM is short.

不适合Not for

小模型单卡微调,用不到这么重的分布式栈。Small single-GPU fine-tuning does not need this heavy distributed stack.
配置复杂,调错会变慢而不是变快。Configuration is complex; a wrong setting makes it slower, not faster.

最小上手Minimum setup

  1. 先用单机多卡跑 ZeRO-2,记录每卡显存与吞吐。Start with ZeRO-2 on one multi-GPU node; record per-GPU VRAM and throughput.
  2. 显存仍不够再开 ZeRO-3 或 offload,比较吞吐损失。If VRAM is still short, enable ZeRO-3 or offload and compare the throughput loss.
  3. 把配置固定成 JSON,和 Axolotl/TRL 的启动命令一起版本化。Freeze the config as JSON and version it alongside Axolotl/TRL launch commands.

依赖与成本Dependencies and cost

Python + PyTorch/CUDA;多机要 InfiniBand/高速网络;offload 需要足够内存或 NVMe。Python + PyTorch/CUDA; multi-node needs InfiniBand/high-speed network; offload needs enough RAM or NVMe.

许可与使用边界License and usage boundaries

代码 Apache-2.0;模型权重与数据集另有许可。Code is Apache-2.0; 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

  • TorchTitan — 规模 / 性能Scale / performance,PyTorch 官方的大模型训练配方:张量并行、流水并行、FSDP 与分布式检查点,按 Llama 3 路线给参考实现。PyTorch's official large-model training recipe: tensor parallelism, pipeline parallelism, FSDP and distributed checkpoints, following the Llama 3 path.
  • 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

快照口径:stars / forks / language / license / pushed_at 来自 GitHub API 2026-11-20 快照;之后的变化没有回写。标签与“适合 / 不适合”是编辑判断,不是 GitHub 元数据。Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
不背书:本站只做索引与风险提示,不审计代码、不保证安全、不替你做许可判断。仓库脚本与模型权重请自行审查。No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.