From dde0d50a461d630622f7a3765caa0886fb52f7a0 Mon Sep 17 00:00:00 2001 From: aviruthen <91846056+aviruthen@users.noreply.github.com> Date: Tue, 25 Nov 2025 11:11:53 -0800 Subject: [PATCH 1/4] Update README for V3 --- README.rst | 229 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 205 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index 9e362053b1..eb31801f1b 100644 --- a/README.rst +++ b/README.rst @@ -51,32 +51,185 @@ Version 3.0.0 represents a significant milestone in our product's evolution. Thi * Older interfaces such as Estimator, Model, Predictor and all their subclasses will not be supported in V3. * Please review documentation of interfaces for parameters support (especially ModelBuilder) in our V3 examples folder. -SageMaker V2 Examples + + + +Migrating to V3 +---------------- + +**Upgrading to 3.x** + +To upgrade to the latest version of SageMaker Python SDK 3.x: + +:: + + pip install --upgrade sagemaker + +If you prefer to downgrade to the 2.x version: + +:: + + pip install sagemaker==2.* + +**Key Benefits of 3.x** + +* **Modular Architecture**: Separate PyPI packages for core, training, and serving capabilities + + * `sagemaker-core `__ + * `sagemaker-train `__ + * `sagemaker-serve `__ + * `sagemaker-mlops `__ + +* **Unified Training & Inference**: Single classes (ModelTrainer, ModelBuilder) replace multiple framework-specific classes +* **Object-Oriented API**: Structured interface with auto-generated configs aligned with AWS APIs +* **Simplified Workflows**: Reduced boilerplate and more intuitive interfaces + +**Training Experience** + +V3 introduces the unified ModelTrainer class to reduce complexity of initial setup and deployment for model training. This replaces the V2 Estimator class and framework-specific classes (PyTorchEstimator, SKLearnEstimator, etc.). + +This example shows how to train a model using a custom training container with training data from S3. + +*SageMaker Python SDK 2.x:* + +.. code:: python + + from sagemaker.estimator import Estimator + estimator = Estimator( + image_uri="my-training-image", + role="arn:aws:iam::123456789012:role/SageMakerRole", + instance_count=1, + instance_type="ml.m5.xlarge", + output_path="s3://my-bucket/output" + ) + estimator.fit({"training": "s3://my-bucket/train"}) + +*SageMaker Python SDK 3.x:* + +.. code:: python + + from sagemaker.train import ModelTrainer + from sagemaker.train.configs import InputData + + trainer = ModelTrainer( + training_image="my-training-image", + role="arn:aws:iam::123456789012:role/SageMakerRole" + ) + + train_data = InputData( + channel_name="training", + data_source="s3://my-bucket/train" + ) + + trainer.train(input_data_config=[train_data]) + +**See more examples:** `SageMaker V3 Examples <#sagemaker-v3-examples>`__ + +**Inference Experience** + +V3 introduces the unified ModelBuilder class for model deployment and inference. This replaces the V2 Model class and framework-specific classes (PyTorchModel, TensorFlowModel, SKLearnModel, XGBoostModel, etc.). + +This example shows how to deploy a trained model for real-time inference. + +*SageMaker Python SDK 2.x:* + +.. code:: python + + from sagemaker.model import Model + from sagemaker.predictor import Predictor + model = Model( + image_uri="my-inference-image", + model_data="s3://my-bucket/model.tar.gz", + role="arn:aws:iam::123456789012:role/SageMakerRole" + ) + predictor = model.deploy( + initial_instance_count=1, + instance_type="ml.m5.xlarge" + ) + result = predictor.predict(data) + +*SageMaker Python SDK 3.x:* + +.. code:: python + + from sagemaker.serve import ModelBuilder + model_builder = ModelBuilder( + model="my-model", + model_path="s3://my-bucket/model.tar.gz" + ) + endpoint = model_builder.build() + result = endpoint.invoke(...) + +**See more examples:** `SageMaker V3 Examples <#sagemaker-v3-examples>`__ + +**SageMaker Core Experience** + +V3 provides an object-oriented interface for interacting with SageMaker resources, with auto-generated config classes and methods based on SageMaker API inputs and outputs. This replaces V2 config classes with SageMaker Core config objects. + +*SageMaker Python SDK 2.x:* + +.. code:: python + + from sagemaker.model import Model + model = Model( + image_uri="my-image", + model_data="s3://my-bucket/model.tar.gz", + role="arn:aws:iam::123456789012:role/SageMakerRole" + ) + predictor = model.deploy( + initial_instance_count=1, + instance_type="ml.m5.xlarge", + endpoint_name="my-endpoint" + ) + +*SageMaker Python SDK 3.x:* + +.. code:: python + + model = Model.get(model_name="my-model") + + endpoint = model.deploy( + endpoint_name="my-endpoint", + instance_type="ml.m5.xlarge", + initial_instance_count=1 + ) + +SageMaker V3 Examples --------------------- -#. `Using the SageMaker Python SDK `__ -#. `Using MXNet `__ -#. `Using TensorFlow `__ -#. `Using Chainer `__ -#. `Using PyTorch `__ -#. `Using Scikit-learn `__ -#. `Using XGBoost `__ -#. `SageMaker Reinforcement Learning Estimators `__ -#. `SageMaker SparkML Serving <#sagemaker-sparkml-serving>`__ -#. `Amazon SageMaker Built-in Algorithm Estimators `__ -#. `Using SageMaker AlgorithmEstimators `__ -#. `Consuming SageMaker Model Packages `__ -#. `BYO Docker Containers with SageMaker Estimators `__ -#. `SageMaker Automatic Model Tuning `__ -#. `SageMaker Batch Transform `__ -#. `Secure Training and Inference with VPC `__ -#. `BYO Model `__ -#. `Inference Pipelines `__ -#. `Amazon SageMaker Operators in Apache Airflow `__ -#. `SageMaker Autopilot `__ -#. `Model Monitoring `__ -#. `SageMaker Debugger `__ -#. `SageMaker Processing `__ +**Training Examples** + +#. `Custom Distributed Training Example `__ +#. `Distributed Local Training Example `__ +#. `Hyperparameter Training Example `__ +#. `JumpStart Training Example `__ +#. `Local Training Example `__ + +**Inference Examples** + +#. `HuggingFace Example `__ +#. `In-Process Mode Example `__ +#. `Inference Spec Example `__ +#. `JumpStart E2E Training Example `__ +#. `JumpStart Example `__ +#. `Local Mode Example `__ +#. `Optimize Example `__ +#. `Train Inference E2E Example `__ + +**ML Ops Examples** + +#. `V3 Hyperparameter Tuning Example `__ +#. `V3 Hyperparameter Tuning Pipeline `__ +#. `V3 Model Registry Example `__ +#. `V3 PyTorch Processing Example `__ +#. `V3 Pipeline Train Create Registry `__ +#. `V3 Processing Job Sklearn `__ +#. `V3 SageMaker Clarify `__ +#. `V3 Transform Job Example `__ + +**Looking for V2 Examples?** See `SageMaker V2 Examples <#sagemaker-v2-examples>`__ below. + + Installing the SageMaker Python SDK @@ -265,3 +418,31 @@ For more information about the different ``content-type`` and ``Accept`` formats ``schema`` that SageMaker SparkML Serving recognizes, please see `SageMaker SparkML Serving Container`_. .. _SageMaker SparkML Serving Container: https://github.com/aws/sagemaker-sparkml-serving-container + + +SageMaker V2 Examples +--------------------- + +#. `Using the SageMaker Python SDK `__ +#. `Using MXNet `__ +#. `Using TensorFlow `__ +#. `Using Chainer `__ +#. `Using PyTorch `__ +#. `Using Scikit-learn `__ +#. `Using XGBoost `__ +#. `SageMaker Reinforcement Learning Estimators `__ +#. `SageMaker SparkML Serving <#sagemaker-sparkml-serving>`__ +#. `Amazon SageMaker Built-in Algorithm Estimators `__ +#. `Using SageMaker AlgorithmEstimators `__ +#. `Consuming SageMaker Model Packages `__ +#. `BYO Docker Containers with SageMaker Estimators `__ +#. `SageMaker Automatic Model Tuning `__ +#. `SageMaker Batch Transform `__ +#. `Secure Training and Inference with VPC `__ +#. `BYO Model `__ +#. `Inference Pipelines `__ +#. `Amazon SageMaker Operators in Apache Airflow `__ +#. `SageMaker Autopilot `__ +#. `Model Monitoring `__ +#. `SageMaker Debugger `__ +#. `SageMaker Processing `__ \ No newline at end of file From 6aa577e24323708e2983c1263bba4003224f3b06 Mon Sep 17 00:00:00 2001 From: aviruthen <91846056+aviruthen@users.noreply.github.com> Date: Tue, 25 Nov 2025 11:25:52 -0800 Subject: [PATCH 2/4] Small fixes to README --- README.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index eb31801f1b..5658212405 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ SageMaker Python SDK SageMaker Python SDK is an open source library for training and deploying machine learning models on Amazon SageMaker. -With the SDK, you can train and deploy models using popular deep learning frameworks **Apache MXNet** and **TensorFlow**. +With the SDK, you can train and deploy models using popular deep learning frameworks **Apache MXNet** and **PyTorch**. You can also train and deploy models with **Amazon algorithms**, which are scalable implementations of core machine learning algorithms that are optimized for SageMaker and GPU training. If you have **your own algorithms** built into SageMaker compatible Docker containers, you can train and host models using these as well. @@ -49,7 +49,7 @@ Version 3.0.0 represents a significant milestone in our product's evolution. Thi **Important: Please review these breaking changes before upgrading.** * Older interfaces such as Estimator, Model, Predictor and all their subclasses will not be supported in V3. -* Please review documentation of interfaces for parameters support (especially ModelBuilder) in our V3 examples folder. +* Please review documentation of interfaces for parameter support in our `V3 examples folder `__. @@ -71,6 +71,8 @@ If you prefer to downgrade to the 2.x version: pip install sagemaker==2.* +See `SageMaker V2 Examples <#sagemaker-v2-examples>`__ for V2 documentation and examples. + **Key Benefits of 3.x** * **Modular Architecture**: Separate PyPI packages for core, training, and serving capabilities From c351583a855c6e686db9d5d53df3b6f67f35f63c Mon Sep 17 00:00:00 2001 From: aviruthen <91846056+aviruthen@users.noreply.github.com> Date: Tue, 25 Nov 2025 11:36:19 -0800 Subject: [PATCH 3/4] minor changes to readme --- README.rst | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 5658212405..ff1c4d51b4 100644 --- a/README.rst +++ b/README.rst @@ -10,10 +10,6 @@ SageMaker Python SDK :target: https://pypi.python.org/pypi/sagemaker :alt: Latest Version -.. image:: https://img.shields.io/conda/vn/conda-forge/sagemaker-python-sdk.svg - :target: https://anaconda.org/conda-forge/sagemaker-python-sdk - :alt: Conda-Forge Version - .. image:: https://img.shields.io/pypi/pyversions/sagemaker.svg :target: https://pypi.python.org/pypi/sagemaker :alt: Supported Python Versions @@ -49,9 +45,7 @@ Version 3.0.0 represents a significant milestone in our product's evolution. Thi **Important: Please review these breaking changes before upgrading.** * Older interfaces such as Estimator, Model, Predictor and all their subclasses will not be supported in V3. -* Please review documentation of interfaces for parameter support in our `V3 examples folder `__. - - +* Please see our `V3 examples folder `__ for example notebooks and usage patterns. Migrating to V3 From f9cf7bf621c9d0ee205565c93d663b193fecbe9f Mon Sep 17 00:00:00 2001 From: aviruthen <91846056+aviruthen@users.noreply.github.com> Date: Tue, 25 Nov 2025 11:43:33 -0800 Subject: [PATCH 4/4] small update --- README.rst | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/README.rst b/README.rst index ff1c4d51b4..7482dd5667 100644 --- a/README.rst +++ b/README.rst @@ -158,38 +158,6 @@ This example shows how to deploy a trained model for real-time inference. **See more examples:** `SageMaker V3 Examples <#sagemaker-v3-examples>`__ -**SageMaker Core Experience** - -V3 provides an object-oriented interface for interacting with SageMaker resources, with auto-generated config classes and methods based on SageMaker API inputs and outputs. This replaces V2 config classes with SageMaker Core config objects. - -*SageMaker Python SDK 2.x:* - -.. code:: python - - from sagemaker.model import Model - model = Model( - image_uri="my-image", - model_data="s3://my-bucket/model.tar.gz", - role="arn:aws:iam::123456789012:role/SageMakerRole" - ) - predictor = model.deploy( - initial_instance_count=1, - instance_type="ml.m5.xlarge", - endpoint_name="my-endpoint" - ) - -*SageMaker Python SDK 3.x:* - -.. code:: python - - model = Model.get(model_name="my-model") - - endpoint = model.deploy( - endpoint_name="my-endpoint", - instance_type="ml.m5.xlarge", - initial_instance_count=1 - ) - SageMaker V3 Examples ---------------------