AWS Security ChangesHomeSearch

AWS sagemaker documentation change

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

File: sagemaker/latest/dg/processing-job-frameworks-pytorch.md

Summary

Updated PyTorch processing job documentation: 1) Minor apostrophe correction in text 2) Added new SDK v3 code example for ProcessingJob API 3) Reorganized content to separate SDK v2 (legacy) example 4) Updated link to PyTorch Estimator documentation

Security assessment

No security vulnerabilities or weaknesses are addressed. Changes consist of documentation restructuring, code example updates, and minor text corrections. The new SDK v3 example shows standard job configuration without security-specific parameters. No evidence of patching vulnerabilities or mitigating threats.

Diff

diff --git a/sagemaker/latest/dg/processing-job-frameworks-pytorch.md b/sagemaker/latest/dg/processing-job-frameworks-pytorch.md
index 1ced694f5..979c90b3f 100644
--- a//sagemaker/latest/dg/processing-job-frameworks-pytorch.md
+++ b//sagemaker/latest/dg/processing-job-frameworks-pytorch.md
@@ -9 +9 @@
-PyTorch is an open-source machine learning framework. The `PyTorchProcessor` in the Amazon SageMaker Python SDK provides you with the ability to run processing jobs with PyTorch scripts. When you use the `PyTorchProcessor`, you can leverage an Amazon-built Docker container with a managed PyTorch environment so that you don’t need to bring your own container.
+PyTorch is an open-source machine learning framework. The `PyTorchProcessor` in the Amazon SageMaker Python SDK provides you with the ability to run processing jobs with PyTorch scripts. When you use the `PyTorchProcessor`, you can leverage an Amazon-built Docker container with a managed PyTorch environment so that you don't need to bring your own container.
@@ -11 +11 @@ PyTorch is an open-source machine learning framework. The `PyTorchProcessor` in
-The following code example shows how you can use the `PyTorchProcessor` to run your Processing job using a Docker image provided and maintained by SageMaker AI. Note that when you run the job, you can specify a directory containing your scripts and dependencies in the `source_dir` argument, and you can have a `requirements.txt` file located inside your `source_dir` directory that specifies the dependencies for your processing script(s). SageMaker Processing installs the dependencies in `requirements.txt` in the container for you.
+The following code example shows how you can run your Processing job using a Docker image provided and maintained by SageMaker AI. Note that when you run the job, you can specify a directory containing your scripts and dependencies in the `source_dir` argument, and you can have a `requirements.txt` file located inside your `source_dir` directory that specifies the dependencies for your processing script(s). SageMaker Processing installs the dependencies in `requirements.txt` in the container for you.
@@ -14,0 +15,36 @@ For the PyTorch versions supported by SageMaker AI, see the available [ Deep Lea
+SageMaker Python SDK v3
+    
+    
+    
+    from sagemaker.core.resources import ProcessingJob
+    from sagemaker.core.helper.session_helper import get_execution_role
+    
+    # Create a processing job with a PyTorch container
+    processing_job = ProcessingJob.create(
+        processing_job_name='frameworkprocessor-PT',
+        role_arn=get_execution_role(),
+        app_specification={
+            "image_uri": "pytorch-processing-image-uri",
+            "container_entrypoint": ["python3", "/opt/ml/processing/input/code/processing-script.py"]
+        },
+        processing_resources={
+            "cluster_config": {"instance_count": 1, "instance_type": "ml.m5.xlarge", "volume_size_in_gb": 30}
+        },
+        processing_inputs=[
+            {"input_name": "data", "s3_input": {"s3_uri": f"s3://{{BUCKET}}/{{S3_INPUT_PATH}}", "local_path": "/opt/ml/processing/input", "s3_data_type": "S3Prefix", "s3_input_mode": "File"}},
+            {"input_name": "code", "s3_input": {"s3_uri": "s3://path/to/scripts/", "local_path": "/opt/ml/processing/input/code", "s3_data_type": "S3Prefix", "s3_input_mode": "File"}}
+        ],
+        processing_output_config={
+            "outputs": [
+                {"output_name": "data_structured", "s3_output": {"s3_uri": f"s3://{{BUCKET}}/{{S3_OUTPUT_PATH}}", "local_path": "/opt/ml/processing/tmp/data_structured", "s3_upload_mode": "EndOfJob"}},
+                {"output_name": "train", "s3_output": {"s3_uri": f"s3://{{BUCKET}}/{{S3_OUTPUT_PATH}}", "local_path": "/opt/ml/processing/output/train", "s3_upload_mode": "EndOfJob"}},
+                {"output_name": "validation", "s3_output": {"s3_uri": f"s3://{{BUCKET}}/{{S3_OUTPUT_PATH}}", "local_path": "/opt/ml/processing/output/val", "s3_upload_mode": "EndOfJob"}},
+                {"output_name": "test", "s3_output": {"s3_uri": f"s3://{{BUCKET}}/{{S3_OUTPUT_PATH}}", "local_path": "/opt/ml/processing/output/test", "s3_upload_mode": "EndOfJob"}},
+                {"output_name": "logs", "s3_output": {"s3_uri": f"s3://{{BUCKET}}/{{S3_OUTPUT_PATH}}", "local_path": "/opt/ml/processing/logs", "s3_upload_mode": "EndOfJob"}}
+            ]
+        }
+    )
+
+SageMaker Python SDK v2 (Legacy)
+    
+    
@@ -49 +85 @@ For the PyTorch versions supported by SageMaker AI, see the available [ Deep Lea
-If you have a `requirements.txt` file, it should be a list of libraries you want to install in the container. The path for `source_dir` can be a relative, absolute, or Amazon S3 URI path. However, if you use an Amazon S3 URI, then it must point to a tar.gz file. You can have multiple scripts in the directory you specify for `source_dir`. To learn more about the `PyTorchProcessor` class, see [PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/sagemaker.pytorch.html) in the _Amazon SageMaker Python SDK_.
+If you have a `requirements.txt` file, it should be a list of libraries you want to install in the container. The path for `source_dir` can be a relative, absolute, or Amazon S3 URI path. However, if you use an Amazon S3 URI, then it must point to a tar.gz file. You can have multiple scripts in the directory you specify for `source_dir`. To learn more about the `PyTorchProcessor` class, see [PyTorch Estimator](https://sagemaker.readthedocs.io/en/stable/api/sagemaker_train.html) in the _Amazon SageMaker Python SDK_.