评价此页

分布式#

分布式训练是一种模型训练范式,它将训练工作负载分散到多个工作节点上,从而显著提高训练速度和模型准确性。虽然分布式训练可用于任何类型的机器学习模型训练,但它对于大型模型和计算密集型任务(如深度学习)最为有益。

在 PyTorch 中有几种方法可以执行分布式训练,每种方法在特定的用例中都有其优势。

分布式概述中阅读更多关于这些选项的信息。

学习 DDP#

DDP 介绍视频教程

一个循序渐进的视频系列,教您如何开始使用 DistributedDataParallel 并进阶到更复杂的主题

https://pytorch.ac.cn/tutorials/beginner/ddp_series_intro.html?utm_source=distr_landing&utm_medium=ddp_series_intro
分布式数据并行入门

本教程简要介绍了 PyTorch 分布式数据并行。

https://pytorch.ac.cn/tutorials/intermediate/ddp_tutorial.html?utm_source=distr_landing&utm_medium=intermediate_ddp_tutorial
使用 Join 上下文管理器处理不均匀输入的分布式训练

本教程描述了 Join 上下文管理器,并演示了它与 DistributedData Parallel 的用法。

https://pytorch.ac.cn/tutorials/advanced/generic_join.html?utm_source=distr_landing&utm_medium=generic_join

学习 FSDP2#

FSDP2 入门

本教程演示了如何使用 FSDP2 对 Transformer 模型进行分布式训练。

https://pytorch.ac.cn/tutorials/intermediate/FSDP_tutorial.html?utm_source=distr_landing&utm_medium=FSDP_getting_started

学习张量并行 (TP)#

使用张量并行 (TP) 进行大规模 Transformer 模型训练

本教程演示了如何使用张量并行和完全分片数据并行在数百到数千个 GPU 上训练一个类似 Transformer 的大型模型。

https://pytorch.ac.cn/tutorials/intermediate/TP_tutorial.html

学习 DeviceMesh#

DeviceMesh 入门

在本教程中,您将学习 DeviceMesh 以及它如何帮助进行分布式训练。

https://pytorch.ac.cn/tutorials/recipes/distributed_device_mesh.html?highlight=devicemesh

学习 RPC#

分布式 RPC 框架入门

本教程演示了如何开始使用基于 RPC 的分布式训练。

https://pytorch.ac.cn/tutorials/intermediate/rpc_tutorial.html?utm_source=distr_landing&utm_medium=rpc_getting_started
使用分布式 RPC 框架实现参数服务器

本教程将引导您通过一个简单的示例,使用 PyTorch 的分布式 RPC 框架实现一个参数服务器。

https://pytorch.ac.cn/tutorials/intermediate/rpc_param_server_tutorial.html?utm_source=distr_landing&utm_medium=rpc_param_server_tutorial
使用异步执行实现批处理 RPC

在本教程中,您将使用 @rpc.functions.async_execution 装饰器构建批处理 RPC 应用程序。

https://pytorch.ac.cn/tutorials/intermediate/rpc_async_execution.html?utm_source=distr_landing&utm_medium=rpc_async_execution
结合 Distributed DataParallel 和分布式 RPC 框架

在本教程中,您将学习如何将分布式数据并行与分布式模型并行相结合。

https://pytorch.ac.cn/tutorials/advanced/rpc_ddp_tutorial.html?utm_source=distr_landing&utm_medium=rpc_plus_ddp

自定义扩展#

使用 Cpp 扩展自定义进程组后端

在本教程中,您将学习如何实现自定义的 ProcessGroup 后端,并使用 Cpp 扩展将其插入到 PyTorch 分布式包中。

https://pytorch.ac.cn/tutorials/intermediate/process_group_cpp_extension_tutorial.html?utm_source=distr_landing&utm_medium=custom_extensions_cpp