

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 亚马逊 SageMaker AI 模型并行度库 v2 示例
<a name="distributed-model-parallel-v2-examples"></a>

本页提供了博客和 Jupyter 笔记本的列表，这些博客和 Jupyter 笔记本提供了实现 SageMaker 模型并行度 (SMP) 库 v2 以在 AI 上运行分布式训练作业的实际示例。 SageMaker 

## 博客和案例研究
<a name="distributed-model-parallel-v2-examples-blog"></a>

以下博客将讨论有关使用 SMP 版本 2 的案例研究。
+ [Amazon SageMaker 人工智能模型并行库现在可将 PyTorch FSDP 工作负载的速度提高多达 20%](https://aws.amazon.com/blogs/machine-learning/amazon-sagemaker-model-parallel-library-now-accelerates-pytorch-fsdp-workloads-by-up-to-20/)

## PyTorch 示例笔记本
<a name="distributed-model-parallel-examples-v2-pytorch"></a>

[SageMaker AI 示例 GitHub 存储库中提供了示例](https://github.com/aws/amazon-sagemaker-examples/tree/master/training/distributed_training/)笔记本。要下载示例，请运行以下命令克隆库并转到 `training/distributed_training/pytorch/model_parallel_v2`。

**注意**  
克隆并运行以下 SageMaker AI ML 中的示例笔记本 IDEs。  
[SageMaker JupyterLab](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-jl.html)（在 2023 年 12 月之后创建[的工作室](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated.html)中可用）
[SageMaker 代码编辑器](https://docs.aws.amazon.com/sagemaker/latest/dg/code-editor.html)（在 2023 年 12 月之后创建的 [Studio](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated.html) 中可用）
[Studio Classic](https://docs.aws.amazon.com/sagemaker/latest/dg/studio.html)（可作为 2023 年 12 月之后创建的 [Studio](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated.html) 中的应用程序使用）
[SageMaker 笔记本实例](https://docs.aws.amazon.com/sagemaker/latest/dg/nbi.html)

```
git clone https://github.com/aws/amazon-sagemaker-examples.git
cd amazon-sagemaker-examples/training/distributed_training/pytorch/model_parallel_v2
```

**SMP v2 示例笔记本**
+ [通过在 P5 实例上运行训练，使用 SMP v2、FS PyTorch DP 和 Transformer Engine 加速 Llama v2 的训练 FP8 ](https://github.com/aws/amazon-sagemaker-examples/blob/main/training/distributed_training/pytorch/model_parallel_v2/llama_v2/smp-train-llama-fsdp-tp-fp8.ipynb)
+ [使用张量并行度、混合分片和激活卸载对带有 SMP v2 和 PyTorch FSDP 的大规模微调 Llama v2](https://github.com/aws/amazon-sagemaker-examples/blob/main/training/distributed_training/pytorch/model_parallel_v2/llama_v2/smp-finetuning-llama-fsdp-tp.ipynb)
+ [使用 SMP v2 和 FSDP 大规模训练 GPT-Neox PyTorch ](https://github.com/aws/amazon-sagemaker-examples/blob/main/training/distributed_training/pytorch/model_parallel_v2/gpt-neox/smp-train-gpt-neox-fsdp-tp.ipynb)
+ [使用张量并行度、混合分片和激活卸载大规模微调 SMP v2 和 PyTorch FSDP 的 GPT-Neox](https://github.com/aws/amazon-sagemaker-examples/blob/main/training/distributed_training/pytorch/model_parallel_v2/gpt-neox/smp-finetuning-gpt-neox-fsdp-tp.ipynb)