AWS Security ChangesHomeSearch

AWS sagemaker documentation change

Service: sagemaker · 2026-06-28 · Documentation low

File: sagemaker/latest/dg/distributed-training-get-started.md

Summary

Updated documentation to include SageMaker Python SDK v3 (ModelTrainer) alongside v2 (legacy estimator classes) for distributed training setup. Added code examples for ModelTrainer and updated links.

Security assessment

The changes focus on SDK version updates and code examples without mentioning security vulnerabilities, access controls, encryption, or compliance. Updates to VPC/subnet references maintain existing security posture but don't introduce new security documentation.

Diff

diff --git a/sagemaker/latest/dg/distributed-training-get-started.md b/sagemaker/latest/dg/distributed-training-get-started.md
index 6f50fcc00..5b01009b9 100644
--- a//sagemaker/latest/dg/distributed-training-get-started.md
+++ b//sagemaker/latest/dg/distributed-training-get-started.md
@@ -17 +17,13 @@ The SageMaker AI distributed training libraries are optimized for the SageMaker
-SageMaker Training supports distributed training on a single instance as well as multiple instances, so you can run any size of training at scale. We recommend you to use the framework estimator classes such as [PyTorch](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator) and [TensorFlow](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/sagemaker.tensorflow.html#tensorflow-estimator) in the SageMaker Python SDK, which are the training job launchers with various distributed training options. When you create an estimator object, the object sets up distributed training infrastructure, runs the `CreateTrainingJob` API in the backend, finds the Region where your current session is running, and pulls one of the pre-built AWS deep learning container prepackaged with a number of libraries including deep learning frameworks, distributed training frameworks, and the [EFA](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html) driver. If you want to mount an FSx file system to the training instances, you need to pass your VPC subnet and security group ID to the estimator. Before running your distributed training job in SageMaker AI, read the following general guidance on the basic infrastructure setup.
+SageMaker Training supports distributed training on a single instance as well as multiple instances, so you can run any size of training at scale.
+
+SageMaker Python SDK v3
+    
+
+We recommend you to use the ModelTrainer class with [PyTorch](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html) and [TensorFlow](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html) in the SageMaker Python SDK, which are the training job launchers with various distributed training options. When you create a ModelTrainer object, the object sets up distributed training infrastructure, runs the `CreateTrainingJob` API in the backend, finds the Region where your current session is running, and pulls one of the pre-built AWS deep learning container prepackaged with a number of libraries including deep learning frameworks, distributed training frameworks, and the [EFA](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html) driver. If you want to mount an FSx file system to the training instances, you need to pass your VPC subnet and security group ID to the ModelTrainer.
+
+SageMaker Python SDK v2 (Legacy)
+    
+
+We recommend you to use the framework estimator classes such as [PyTorch](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator) and [TensorFlow](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/sagemaker.tensorflow.html#tensorflow-estimator) in the SageMaker Python SDK, which are the training job launchers with various distributed training options. When you create an estimator object, the object sets up distributed training infrastructure, runs the `CreateTrainingJob` API in the backend, finds the Region where your current session is running, and pulls one of the pre-built AWS deep learning container prepackaged with a number of libraries including deep learning frameworks, distributed training frameworks, and the [EFA](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html) driver. If you want to mount an FSx file system to the training instances, you need to pass your VPC subnet and security group ID to the estimator.
+
+Before running your distributed training job in SageMaker AI, read the following general guidance on the basic infrastructure setup.
@@ -30,0 +43,18 @@ The SMDDP library improves communication between nodes with implementations of `
+SageMaker Python SDK v3
+    
+    
+    
+    from sagemaker.train import ModelTrainer
+    from sagemaker.train.configs import Compute
+    from sagemaker.train.distributed import Torchrun
+    
+    model_trainer = ModelTrainer(
+        ...,
+        compute=Compute(instance_count=2, instance_type="ml.p4d.24xlarge"),
+        # Activate distributed training with SMDDP
+        distributed=Torchrun()
+    )
+
+SageMaker Python SDK v2 (Legacy)
+    
+    
@@ -50 +80,28 @@ SageMaker AI provides the SMP library and supports various distributed training
-To use SageMaker AI's model parallelism library, configure the `distribution` parameter of the SageMaker AI framework estimators. Supported framework estimators are [PyTorch](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator) and [TensorFlow](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/sagemaker.tensorflow.html#tensorflow-estimator). The following code example shows how to construct a framework estimator for distributed training with the model parallelism library on two `ml.p4d.24xlarge` instances.
+To use SageMaker AI's model parallelism library, configure the `distribution` parameter of the SageMaker AI framework estimators.
+
+SageMaker Python SDK v3
+    
+
+The ModelTrainer class supports [PyTorch](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html) and [TensorFlow](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html). The following code example shows how to construct a ModelTrainer for distributed training with the model parallelism library on two `ml.p4d.24xlarge` instances.
+
+SageMaker Python SDK v2 (Legacy)
+    
+
+Supported framework estimators are [PyTorch](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator) and [TensorFlow](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/sagemaker.tensorflow.html#tensorflow-estimator). The following code example shows how to construct a framework estimator for distributed training with the model parallelism library on two `ml.p4d.24xlarge` instances.
+
+SageMaker Python SDK v3
+    
+    
+    
+    from sagemaker.train import ModelTrainer
+    from sagemaker.train.configs import Compute
+    from sagemaker.train.distributed import Torchrun
+    
+    model_trainer = ModelTrainer(
+        ...,
+        compute=Compute(instance_count=2, instance_type="ml.p4d.24xlarge"),
+        distributed=Torchrun()
+    )
+
+SageMaker Python SDK v2 (Legacy)
+    
@@ -83 +140 @@ SageMaker AI also supports the following options to operate `mpirun` and `torchr
-  * To use [PyTorch DistributedDataParallel (DDP)](https://pytorch.org/docs/master/generated/torch.nn.parallel.DistributedDataParallel.html) in SageMaker AI with the `mpirun` backend, add `distribution={"pytorchddp": {"enabled": True}}` to your PyTorch estimator. For more information, see also [PyTorch Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#distributed-pytorch-training) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator)'s `distribution` argument in the _SageMaker Python SDK documentation_.
+  * To use [PyTorch DistributedDataParallel (DDP)](https://pytorch.org/docs/master/generated/torch.nn.parallel.DistributedDataParallel.html) in SageMaker AI with the `mpirun` backend, add `distribution={"pytorchddp": {"enabled": True}}` to your PyTorch estimator. For more information, see also [PyTorch Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#distributed-pytorch-training) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html)'s `distribution` argument in the _SageMaker Python SDK documentation_.
@@ -88,0 +146,16 @@ This option is available for PyTorch 1.12.0 and later.
+SageMaker Python SDK v3
+    
+    
+        from sagemaker.train import ModelTrainer
+    from sagemaker.train.configs import Compute
+    from sagemaker.train.distributed import Torchrun
+    
+    model_trainer = ModelTrainer(
+        ...,
+        compute=Compute(instance_count=2, instance_type="ml.p4d.24xlarge"),
+        distributed=Torchrun()  # runs torchrun in the backend
+    )
+
+SageMaker Python SDK v2 (Legacy)
+    
+    
@@ -107,0 +181,16 @@ The following code snippet shows an example of constructing a SageMaker AI PyTor
+SageMaker Python SDK v3
+    
+    
+        from sagemaker.train import ModelTrainer
+    from sagemaker.train.configs import Compute
+    from sagemaker.train.distributed import Torchrun
+    
+    model_trainer = ModelTrainer(
+        ...,
+        compute=Compute(instance_count=2, instance_type="ml.p4d.24xlarge"),
+        distributed=Torchrun()  # runs torchrun in the backend
+    )
+
+SageMaker Python SDK v2 (Legacy)
+    
+    
@@ -117 +206 @@ The following code snippet shows an example of constructing a SageMaker AI PyTor
-For more information, see [Distributed PyTorch Training](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#distributed-pytorch-training) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator)'s `distribution` argument in the _SageMaker Python SDK documentation_.
+For more information, see [Distributed PyTorch Training](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#distributed-pytorch-training) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html)'s `distribution` argument in the _SageMaker Python SDK documentation_.
@@ -135 +224 @@ To run your PyTorch training job on Trn1 instances with SageMaker AI, you should
-For more information, see [Distributed Training with PyTorch Neuron on Trn1 instances](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#id24) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator)'s `distribution` argument in the _SageMaker Python SDK documentation_.
+For more information, see [Distributed Training with PyTorch Neuron on Trn1 instances](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#id24) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html)'s `distribution` argument in the _SageMaker Python SDK documentation_.
@@ -145 +234 @@ For more information about using the MPI and parameter server options per framew
-    * [MXNet Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/mxnet/using_mxnet.html#distributed-training) and [SageMaker AI MXNet Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/mxnet/sagemaker.mxnet.html#mxnet-estimator)'s `distribution` argument
+    * [MXNet Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/mxnet/using_mxnet.html#distributed-training) and [SageMaker AI MXNet Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html)'s `distribution` argument
@@ -147 +236 @@ For more information about using the MPI and parameter server options per framew
-    * [PyTorch Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#distributed-pytorch-training) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html#pytorch-estimator)'s `distribution` argument
+    * [PyTorch Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#distributed-pytorch-training) and [SageMaker AI PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html)'s `distribution` argument
@@ -149 +238 @@ For more information about using the MPI and parameter server options per framew
-    * [TensorFlow Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/using_tf.html#distributed-training) and [SageMaker AI TensorFlow Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/sagemaker.tensorflow.html#tensorflow-estimator)'s `distribution` argument.
+    * [TensorFlow Distributed Training](https://sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/using_tf.html#distributed-training) and [SageMaker AI TensorFlow Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html)'s `distribution` argument.