Skip to content

Commit a50681f

Browse files
authored
Update readme (#5343)
* Update README for V3 * Small fixes to README * minor changes to readme * small update
1 parent 290fdc2 commit a50681f

File tree

1 file changed

+175
-30
lines changed

1 file changed

+175
-30
lines changed

README.rst

Lines changed: 175 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ SageMaker Python SDK
1010
:target: https://pypi.python.org/pypi/sagemaker
1111
:alt: Latest Version
1212

13-
.. image:: https://img.shields.io/conda/vn/conda-forge/sagemaker-python-sdk.svg
14-
:target: https://anaconda.org/conda-forge/sagemaker-python-sdk
15-
:alt: Conda-Forge Version
16-
1713
.. image:: https://img.shields.io/pypi/pyversions/sagemaker.svg
1814
:target: https://pypi.python.org/pypi/sagemaker
1915
:alt: Supported Python Versions
@@ -32,7 +28,7 @@ SageMaker Python SDK
3228

3329
SageMaker Python SDK is an open source library for training and deploying machine learning models on Amazon SageMaker.
3430

35-
With the SDK, you can train and deploy models using popular deep learning frameworks **Apache MXNet** and **TensorFlow**.
31+
With the SDK, you can train and deploy models using popular deep learning frameworks **Apache MXNet** and **PyTorch**.
3632
You can also train and deploy models with **Amazon algorithms**,
3733
which are scalable implementations of core machine learning algorithms that are optimized for SageMaker and GPU training.
3834
If you have **your own algorithms** built into SageMaker compatible Docker containers, you can train and host models using these as well.
@@ -49,34 +45,155 @@ Version 3.0.0 represents a significant milestone in our product's evolution. Thi
4945
**Important: Please review these breaking changes before upgrading.**
5046

5147
* Older interfaces such as Estimator, Model, Predictor and all their subclasses will not be supported in V3.
52-
* Please review documentation of interfaces for parameters support (especially ModelBuilder) in our V3 examples folder.
48+
* Please see our `V3 examples folder <https://github.com/aws/sagemaker-python-sdk/tree/master/v3-examples>`__ for example notebooks and usage patterns.
5349

54-
SageMaker V2 Examples
50+
51+
Migrating to V3
52+
----------------
53+
54+
**Upgrading to 3.x**
55+
56+
To upgrade to the latest version of SageMaker Python SDK 3.x:
57+
58+
::
59+
60+
pip install --upgrade sagemaker
61+
62+
If you prefer to downgrade to the 2.x version:
63+
64+
::
65+
66+
pip install sagemaker==2.*
67+
68+
See `SageMaker V2 Examples <#sagemaker-v2-examples>`__ for V2 documentation and examples.
69+
70+
**Key Benefits of 3.x**
71+
72+
* **Modular Architecture**: Separate PyPI packages for core, training, and serving capabilities
73+
74+
* `sagemaker-core <https://pypi.org/project/sagemaker-core/>`__
75+
* `sagemaker-train <https://pypi.org/project/sagemaker-train/>`__
76+
* `sagemaker-serve <https://pypi.org/project/sagemaker-serve/>`__
77+
* `sagemaker-mlops <https://pypi.org/project/sagemaker-mlops/>`__
78+
79+
* **Unified Training & Inference**: Single classes (ModelTrainer, ModelBuilder) replace multiple framework-specific classes
80+
* **Object-Oriented API**: Structured interface with auto-generated configs aligned with AWS APIs
81+
* **Simplified Workflows**: Reduced boilerplate and more intuitive interfaces
82+
83+
**Training Experience**
84+
85+
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.).
86+
87+
This example shows how to train a model using a custom training container with training data from S3.
88+
89+
*SageMaker Python SDK 2.x:*
90+
91+
.. code:: python
92+
93+
from sagemaker.estimator import Estimator
94+
estimator = Estimator(
95+
image_uri="my-training-image",
96+
role="arn:aws:iam::123456789012:role/SageMakerRole",
97+
instance_count=1,
98+
instance_type="ml.m5.xlarge",
99+
output_path="s3://my-bucket/output"
100+
)
101+
estimator.fit({"training": "s3://my-bucket/train"})
102+
103+
*SageMaker Python SDK 3.x:*
104+
105+
.. code:: python
106+
107+
from sagemaker.train import ModelTrainer
108+
from sagemaker.train.configs import InputData
109+
110+
trainer = ModelTrainer(
111+
training_image="my-training-image",
112+
role="arn:aws:iam::123456789012:role/SageMakerRole"
113+
)
114+
115+
train_data = InputData(
116+
channel_name="training",
117+
data_source="s3://my-bucket/train"
118+
)
119+
120+
trainer.train(input_data_config=[train_data])
121+
122+
**See more examples:** `SageMaker V3 Examples <#sagemaker-v3-examples>`__
123+
124+
**Inference Experience**
125+
126+
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.).
127+
128+
This example shows how to deploy a trained model for real-time inference.
129+
130+
*SageMaker Python SDK 2.x:*
131+
132+
.. code:: python
133+
134+
from sagemaker.model import Model
135+
from sagemaker.predictor import Predictor
136+
model = Model(
137+
image_uri="my-inference-image",
138+
model_data="s3://my-bucket/model.tar.gz",
139+
role="arn:aws:iam::123456789012:role/SageMakerRole"
140+
)
141+
predictor = model.deploy(
142+
initial_instance_count=1,
143+
instance_type="ml.m5.xlarge"
144+
)
145+
result = predictor.predict(data)
146+
147+
*SageMaker Python SDK 3.x:*
148+
149+
.. code:: python
150+
151+
from sagemaker.serve import ModelBuilder
152+
model_builder = ModelBuilder(
153+
model="my-model",
154+
model_path="s3://my-bucket/model.tar.gz"
155+
)
156+
endpoint = model_builder.build()
157+
result = endpoint.invoke(...)
158+
159+
**See more examples:** `SageMaker V3 Examples <#sagemaker-v3-examples>`__
160+
161+
SageMaker V3 Examples
55162
---------------------
56163

57-
#. `Using the SageMaker Python SDK <https://sagemaker.readthedocs.io/en/stable/overview.html>`__
58-
#. `Using MXNet <https://sagemaker.readthedocs.io/en/stable/using_mxnet.html>`__
59-
#. `Using TensorFlow <https://sagemaker.readthedocs.io/en/stable/using_tf.html>`__
60-
#. `Using Chainer <https://sagemaker.readthedocs.io/en/stable/using_chainer.html>`__
61-
#. `Using PyTorch <https://sagemaker.readthedocs.io/en/stable/using_pytorch.html>`__
62-
#. `Using Scikit-learn <https://sagemaker.readthedocs.io/en/stable/using_sklearn.html>`__
63-
#. `Using XGBoost <https://sagemaker.readthedocs.io/en/stable/using_xgboost.html>`__
64-
#. `SageMaker Reinforcement Learning Estimators <https://sagemaker.readthedocs.io/en/stable/using_rl.html>`__
65-
#. `SageMaker SparkML Serving <#sagemaker-sparkml-serving>`__
66-
#. `Amazon SageMaker Built-in Algorithm Estimators <src/sagemaker/amazon/README.rst>`__
67-
#. `Using SageMaker AlgorithmEstimators <https://sagemaker.readthedocs.io/en/stable/overview.html#using-sagemaker-algorithmestimators>`__
68-
#. `Consuming SageMaker Model Packages <https://sagemaker.readthedocs.io/en/stable/overview.html#consuming-sagemaker-model-packages>`__
69-
#. `BYO Docker Containers with SageMaker Estimators <https://sagemaker.readthedocs.io/en/stable/overview.html#byo-docker-containers-with-sagemaker-estimators>`__
70-
#. `SageMaker Automatic Model Tuning <https://sagemaker.readthedocs.io/en/stable/overview.html#sagemaker-automatic-model-tuning>`__
71-
#. `SageMaker Batch Transform <https://sagemaker.readthedocs.io/en/stable/overview.html#sagemaker-batch-transform>`__
72-
#. `Secure Training and Inference with VPC <https://sagemaker.readthedocs.io/en/stable/overview.html#secure-training-and-inference-with-vpc>`__
73-
#. `BYO Model <https://sagemaker.readthedocs.io/en/stable/overview.html#byo-model>`__
74-
#. `Inference Pipelines <https://sagemaker.readthedocs.io/en/stable/overview.html#inference-pipelines>`__
75-
#. `Amazon SageMaker Operators in Apache Airflow <https://sagemaker.readthedocs.io/en/stable/using_workflow.html>`__
76-
#. `SageMaker Autopilot <src/sagemaker/automl/README.rst>`__
77-
#. `Model Monitoring <https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_model_monitoring.html>`__
78-
#. `SageMaker Debugger <https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_debugger.html>`__
79-
#. `SageMaker Processing <https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_processing.html>`__
164+
**Training Examples**
165+
166+
#. `Custom Distributed Training Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/training-examples/custom-distributed-training-example.ipynb>`__
167+
#. `Distributed Local Training Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/training-examples/distributed-local-training-example.ipynb>`__
168+
#. `Hyperparameter Training Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/training-examples/hyperparameter-training-example.ipynb>`__
169+
#. `JumpStart Training Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/training-examples/jumpstart-training-example.ipynb>`__
170+
#. `Local Training Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/training-examples/local-training-example.ipynb>`__
171+
172+
**Inference Examples**
173+
174+
#. `HuggingFace Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/huggingface-example.ipynb>`__
175+
#. `In-Process Mode Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/in-process-mode-example.ipynb>`__
176+
#. `Inference Spec Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/inference-spec-example.ipynb>`__
177+
#. `JumpStart E2E Training Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/jumpstart-e2e-training-example.ipynb>`__
178+
#. `JumpStart Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/jumpstart-example.ipynb>`__
179+
#. `Local Mode Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/local-mode-example.ipynb>`__
180+
#. `Optimize Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/optimize-example.ipynb>`__
181+
#. `Train Inference E2E Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/inference-examples/train-inference-e2e-example.ipynb>`__
182+
183+
**ML Ops Examples**
184+
185+
#. `V3 Hyperparameter Tuning Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-hyperparameter-tuning-example/v3-hyperparameter-tuning-example.ipynb>`__
186+
#. `V3 Hyperparameter Tuning Pipeline <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-hyperparameter-tuning-example/v3-hyperparameter-tuning-pipeline.ipynb>`__
187+
#. `V3 Model Registry Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-model-registry-example/v3-model-registry-example.ipynb>`__
188+
#. `V3 PyTorch Processing Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-processing-job-pytorch/v3-pytorch-processing-example.ipynb>`__
189+
#. `V3 Pipeline Train Create Registry <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-pipeline-train-create-registry.ipynb>`__
190+
#. `V3 Processing Job Sklearn <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-processing-job-sklearn.ipynb>`__
191+
#. `V3 SageMaker Clarify <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-sagemaker-clarify.ipynb>`__
192+
#. `V3 Transform Job Example <https://github.com/aws/sagemaker-python-sdk/blob/master/v3-examples/ml-ops-examples/v3-transform-job-example.ipynb>`__
193+
194+
**Looking for V2 Examples?** See `SageMaker V2 Examples <#sagemaker-v2-examples>`__ below.
195+
196+
80197

81198

82199
Installing the SageMaker Python SDK
@@ -265,3 +382,31 @@ For more information about the different ``content-type`` and ``Accept`` formats
265382
``schema`` that SageMaker SparkML Serving recognizes, please see `SageMaker SparkML Serving Container`_.
266383

267384
.. _SageMaker SparkML Serving Container: https://github.com/aws/sagemaker-sparkml-serving-container
385+
386+
387+
SageMaker V2 Examples
388+
---------------------
389+
390+
#. `Using the SageMaker Python SDK <https://sagemaker.readthedocs.io/en/stable/overview.html>`__
391+
#. `Using MXNet <https://sagemaker.readthedocs.io/en/stable/using_mxnet.html>`__
392+
#. `Using TensorFlow <https://sagemaker.readthedocs.io/en/stable/using_tf.html>`__
393+
#. `Using Chainer <https://sagemaker.readthedocs.io/en/stable/using_chainer.html>`__
394+
#. `Using PyTorch <https://sagemaker.readthedocs.io/en/stable/using_pytorch.html>`__
395+
#. `Using Scikit-learn <https://sagemaker.readthedocs.io/en/stable/using_sklearn.html>`__
396+
#. `Using XGBoost <https://sagemaker.readthedocs.io/en/stable/using_xgboost.html>`__
397+
#. `SageMaker Reinforcement Learning Estimators <https://sagemaker.readthedocs.io/en/stable/using_rl.html>`__
398+
#. `SageMaker SparkML Serving <#sagemaker-sparkml-serving>`__
399+
#. `Amazon SageMaker Built-in Algorithm Estimators <src/sagemaker/amazon/README.rst>`__
400+
#. `Using SageMaker AlgorithmEstimators <https://sagemaker.readthedocs.io/en/stable/overview.html#using-sagemaker-algorithmestimators>`__
401+
#. `Consuming SageMaker Model Packages <https://sagemaker.readthedocs.io/en/stable/overview.html#consuming-sagemaker-model-packages>`__
402+
#. `BYO Docker Containers with SageMaker Estimators <https://sagemaker.readthedocs.io/en/stable/overview.html#byo-docker-containers-with-sagemaker-estimators>`__
403+
#. `SageMaker Automatic Model Tuning <https://sagemaker.readthedocs.io/en/stable/overview.html#sagemaker-automatic-model-tuning>`__
404+
#. `SageMaker Batch Transform <https://sagemaker.readthedocs.io/en/stable/overview.html#sagemaker-batch-transform>`__
405+
#. `Secure Training and Inference with VPC <https://sagemaker.readthedocs.io/en/stable/overview.html#secure-training-and-inference-with-vpc>`__
406+
#. `BYO Model <https://sagemaker.readthedocs.io/en/stable/overview.html#byo-model>`__
407+
#. `Inference Pipelines <https://sagemaker.readthedocs.io/en/stable/overview.html#inference-pipelines>`__
408+
#. `Amazon SageMaker Operators in Apache Airflow <https://sagemaker.readthedocs.io/en/stable/using_workflow.html>`__
409+
#. `SageMaker Autopilot <src/sagemaker/automl/README.rst>`__
410+
#. `Model Monitoring <https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_model_monitoring.html>`__
411+
#. `SageMaker Debugger <https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_debugger.html>`__
412+
#. `SageMaker Processing <https://sagemaker.readthedocs.io/en/stable/amazon_sagemaker_processing.html>`__

0 commit comments

Comments
 (0)