

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon SageMaker AI 模型平行化程式庫 v2 範例
<a name="distributed-model-parallel-v2-examples"></a>

此頁面提供部落格和 Jupyter 筆記本的清單，其中提供實作 SageMaker 模型平行化 (SMP) 程式庫 v2 以在 SageMaker AI 上執行分散式訓練任務的實際範例。

## 部落格與案例研究
<a name="distributed-model-parallel-v2-examples-blog"></a>

下列部落格討論有關使用 SMP v2 的案例研究。
+ [Amazon SageMaker AI 模型平行化程式庫現在可將 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 IDE 中複製並執行範例筆記本。  
[SageMaker JupyterLab](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-jl.html) (可在 2023 年 12 月之後建立的 [Studio](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 執行個體上執行 FP8 訓練，使用 SMP v2、PyTorch FSDP 和 Transformer Engine 加速 Llama v2 的訓練](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 和 PyTorch FSDP 大規模訓練 GPT-NeoX](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)