Skip to content

Commit 67453e2

Browse files
authored
Merge branch 'zwei' into add-serde-params
2 parents ef53cc5 + a6f51b7 commit 67453e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1392
-181
lines changed

CHANGELOG.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,79 @@
11
# Changelog
22

3+
## v1.72.0 (2020-07-29)
4+
5+
### Features
6+
7+
* Neo: Add Granular Target Description support for compilation
8+
9+
### Documentation Changes
10+
11+
* Add xgboost doc on bring your own model
12+
* fix typos on processing docs
13+
14+
## v1.71.1 (2020-07-27)
15+
16+
### Bug Fixes and Other Changes
17+
18+
* remove redundant information from the user_agent string.
19+
20+
### Testing and Release Infrastructure
21+
22+
* use unique model name in TFS integ tests
23+
* use pytest-cov instead of coverage
24+
25+
## v1.71.0 (2020-07-23)
26+
27+
### Features
28+
29+
* Add mpi support for mxnet estimator api
30+
31+
### Bug Fixes and Other Changes
32+
33+
* use 'sagemaker' logger instead of root logger
34+
* account for "py36" and "py37" in image tag parsing
35+
36+
## v1.70.2 (2020-07-22)
37+
38+
### Bug Fixes and Other Changes
39+
40+
* convert network_config in processing_config to dict
41+
42+
### Documentation Changes
43+
44+
* Add ECR URI Estimator example
45+
46+
## v1.70.1 (2020-07-21)
47+
48+
### Bug Fixes and Other Changes
49+
50+
* Nullable fields in processing_config
51+
52+
## v1.70.0 (2020-07-20)
53+
54+
### Features
55+
56+
* Add model monitor support for us-gov-west-1
57+
* support TFS 2.2
58+
59+
### Bug Fixes and Other Changes
60+
61+
* reshape Artifacts into data frame in ExperimentsAnalytics
62+
63+
### Documentation Changes
64+
65+
* fix MXNet version info for requirements.txt support
66+
67+
## v1.69.0 (2020-07-09)
68+
69+
### Features
70+
71+
* Add ModelClientConfig Fields for Batch Transform
72+
73+
### Documentation Changes
74+
75+
* add KFP Processing component
76+
377
## v2.0.0.rc1 (2020-07-08)
478

579
### Breaking Changes

buildspec-unittests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ phases:
77
- TOX_PARALLEL_NO_SPINNER=1
88
- PY_COLORS=0
99
- start_time=`date +%s`
10-
- tox -e flake8,pylint,twine,black-check
10+
- tox -e flake8,pylint,twine,black-check --parallel all
1111
- ./ci-scripts/displaytime.sh 'flake8,pylint,twine,black-check' $start_time
1212

1313
- start_time=`date +%s`
14-
- tox -e sphinx,doc8
14+
- tox -e sphinx,doc8 --parallel all
1515
- ./ci-scripts/displaytime.sh 'sphinx,doc8' $start_time
1616

1717
# run unit tests

doc/amazon_sagemaker_processing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Amazon SageMaker Processing allows you to run steps for data pre- or post-proces
1010
Background
1111
==========
1212

13-
Amazon SageMaker lets developers and data scientists train and deploy machine learning models. With Amazon SageMaker Processing, you can run processing jobs on for data processing steps in your machine learning pipeline, which accept data from Amazon S3 as input, and put data into Amazon S3 as output.
13+
Amazon SageMaker lets developers and data scientists train and deploy machine learning models. With Amazon SageMaker Processing, you can run processing jobs for data processing steps in your machine learning pipeline. Processing jobs accept data from Amazon S3 as input and store data into Amazon S3 as output.
1414

1515
.. image:: ./amazon_sagemaker_processing_image1.png
1616

1717
Setup
1818
=====
1919

20-
The fastest way to run get started with Amazon SageMaker Processing is by running a Jupyter notebook. You can follow the `Getting Started with Amazon SageMaker`_ guide to start running notebooks on Amazon SageMaker.
20+
The fastest way to get started with Amazon SageMaker Processing is by running a Jupyter notebook. You can follow the `Getting Started with Amazon SageMaker`_ guide to start running notebooks on Amazon SageMaker.
2121

2222
.. _Getting Started with Amazon SageMaker: https://docs.aws.amazon.com/sagemaker/latest/dg/gs.html
2323

doc/api/utility/image_uris.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Image URIs
2+
----------
3+
4+
.. automodule:: sagemaker.image_uris
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

doc/frameworks/mxnet/using_mxnet.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,14 @@ If there are other packages you want to use with your script, you can include a
159159
Both ``requirements.txt`` and your training script should be put in the same folder.
160160
You must specify this folder in ``source_dir`` argument when creating an MXNet estimator.
161161

162-
The function of installing packages using ``requirements.txt`` is supported for all MXNet versions during training.
162+
The function of installing packages using ``requirements.txt`` is supported for MXNet versions 1.3.0 and higher during training.
163+
163164
When serving an MXNet model, support for this function varies with MXNet versions.
164165
For MXNet 1.6.0 or newer, ``requirements.txt`` must be under folder ``code``.
165166
The SageMaker MXNet Estimator automatically saves ``code`` in ``model.tar.gz`` after training (assuming you set up your script and ``requirements.txt`` correctly as stipulated in the previous paragraph).
166167
In the case of bringing your own trained model for deployment, you must save ``requirements.txt`` under folder ``code`` in ``model.tar.gz`` yourself or specify it through ``dependencies``.
167-
For MXNet 1.4.1, ``requirements.txt`` is not supported for inference.
168-
For MXNet 0.12.1-1.3.0, ``requirements.txt`` must be in ``source_dir``.
168+
For MXNet 0.12.1-1.2.1, 1.4.0-1.4.1, ``requirements.txt`` is not supported for inference.
169+
For MXNet 1.3.0, ``requirements.txt`` must be in ``source_dir``.
169170

170171
A ``requirements.txt`` file is a text file that contains a list of items that are installed by using ``pip install``.
171172
You can also specify the version of an item to install.

doc/frameworks/tensorflow/using_tf.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,28 @@ To use Python 3.7, please specify both of the args:
178178
Where the S3 url is a path to your training data within Amazon S3.
179179
The constructor keyword arguments define how SageMaker runs your training script.
180180

181+
Specify a Docker image using an Estimator
182+
-----------------------------------------
183+
184+
There are use cases, such as extending an existing pre-built Amazon SageMaker images, that require specifing a Docker image when creating an Estimator by directly specifying the ECR URI instead of the Python and framework version. For a full list of available container URIs, see `Available Deep Learning Containers Images <https://github.com/aws/deep-learning-containers/blob/master/available_images.md>`__ For more information on using Docker containers, see `Use Your Own Algorithms or Models with Amazon SageMaker <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html>`__.
185+
186+
When specifying the image, you must use the ``image_name=''`` arg to replace the following arg:
187+
188+
- ``py_version=''``
189+
190+
You should still specify the ``framework_version=''`` arg because the SageMaker Python SDK accomodates for differences in the images based on the version.
191+
192+
The following example uses the ``image_name=''`` arg to specify the container image, Python version, and framework version.
193+
194+
.. code:: python
195+
196+
tf_estimator = TensorFlow(entry_point='tf-train.py',
197+
role='SageMakerRole',
198+
train_instance_count=1,
199+
train_instance_type='ml.p2.xlarge',
200+
image_name='763104351884.dkr.ecr.<region>.amazonaws.com/<framework>-<job type>:<framework version>-<cpu/gpu>-<python version>-ubuntu18.04',
201+
script_mode=True)
202+
181203
For more information about the sagemaker.tensorflow.TensorFlow estimator, see `SageMaker TensorFlow Classes`_.
182204

183205
Call the fit Method

doc/frameworks/xgboost/using_xgboost.rst

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,56 @@ The function should return a byte array of data serialized to ``content_type``.
392392
The default implementation expects ``prediction`` to be a NumPy array and can serialize the result to JSON, CSV, or NPY.
393393
It accepts response content types of "application/json", "text/csv", and "application/x-npy".
394394

395+
Bring Your Own Model
396+
--------------------
397+
398+
You can deploy an XGBoost model that you trained outside of SageMaker by using the Amazon SageMaker XGBoost container.
399+
Typically, you save an XGBoost model by pickling the ``Booster`` object or calling ``booster.save_model``.
400+
The XGBoost `built-in algorithm mode <https://docs.aws.amazon.com/sagemaker/latest/dg/xgboost.html#xgboost-modes>`_
401+
supports both a pickled ``Booster`` object and a model produced by ``booster.save_model``.
402+
You can also deploy an XGBoost model by using XGBoost as a framework.
403+
By using XGBoost as a framework, you have more flexibility.
404+
To deploy an XGBoost model by using XGBoost as a framework, you need to:
405+
406+
- Write an inference script.
407+
- Create the XGBoostModel object.
408+
409+
Write an Inference Script
410+
^^^^^^^^^^^^^^^^^^^^^^^^^
411+
412+
You must create an inference script that implements (at least) the ``model_fn`` function that calls the loaded model to get a prediction.
413+
414+
Optionally, you can also implement ``input_fn`` and ``output_fn`` to process input and output,
415+
and ``predict_fn`` to customize how the model server gets predictions from the loaded model.
416+
For information about how to write an inference script, see `SageMaker XGBoost Model Server <#sagemaker-xgboost-model-server>`_.
417+
Pass the filename of the inference script as the ``entry_point`` parameter when you create the `XGBoostModel` object.
418+
419+
Create an XGBoostModel Object
420+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
421+
422+
To create a model object, call the ``sagemaker.xgboost.model.XGBoostModel`` constructor,
423+
and then call its ``deploy()`` method to deploy your model for inference.
424+
425+
.. code:: python
426+
427+
xgboost_model = XGBoostModel(
428+
model_data="s3://my-bucket/my-path/model.tar.gz",
429+
role="my-role",
430+
entry_point="inference.py",
431+
framework_version="1.0-1"
432+
)
433+
434+
predictor = xgboost_model.deploy(
435+
instance_type='ml.c4.xlarge',
436+
initial_instance_count=1
437+
)
438+
439+
# If payload is a string in LIBSVM format, we need to change serializer.
440+
predictor.serializer = str
441+
predictor.predict("<label> <index1>:<value1> <index2>:<value2>")
442+
443+
To get predictions from your deployed model, you can call the ``predict()`` method.
444+
395445
Host Multiple Models with Multi-Model Endpoints
396446
-----------------------------------------------
397447

@@ -403,7 +453,6 @@ in the AWS documentation.
403453
For a sample notebook that uses Amazon SageMaker to deploy multiple XGBoost models to an endpoint, see the
404454
`Multi-Model Endpoint XGBoost Sample Notebook <https://github.com/awslabs/amazon-sagemaker-examples/blob/master/advanced_functionality/multi_model_xgboost_home_value/xgboost_multi_model_endpoint_home_value.ipynb>`_.
405455

406-
407456
*************************
408457
SageMaker XGBoost Classes
409458
*************************

doc/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.. important::
2-
We are working on v2.0.0. See https://github.com/aws/sagemaker-python-sdk/issues/1459
3-
for more info on our plans and to leave feedback!
4-
51
###########################
62
Amazon SageMaker Python SDK
73
###########################

doc/v2.rst

Lines changed: 75 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
1-
##########################################################
2-
Use Version 2.0 of the SageMaker Python SDK (experimental)
3-
##########################################################
4-
5-
Development on v2.0.0 of the SageMaker Python SDK is underway.
6-
For more info on our plans, see https://github.com/aws/sagemaker-python-sdk/issues/1459.
1+
###########################################
2+
Use Version 2.x of the SageMaker Python SDK
3+
###########################################
74

85
.. contents::
96
:local:
7+
:depth: 2
108

119
************
1210
Installation
1311
************
1412

15-
.. warning::
16-
Version 2.0.0 is currently experimental, so proceed with caution. If you do run into issues or have any other feedback,
17-
please let us know by `opening an issue <https://github.com/aws/sagemaker-python-sdk/issues/new/choose>`_
18-
or `commenting on our planning issue <https://github.com/aws/sagemaker-python-sdk/issues/1459>`_.
19-
20-
To install the latest release candidate:
21-
22-
.. code:: bash
23-
24-
pip install git+git://github.com/aws/[email protected]
25-
26-
To install the latest version of v2:
13+
To install the latest version:
2714

2815
.. code:: bash
2916
30-
pip install git+git://github.com/aws/sagemaker-python-sdk.git@zwei
17+
pip install --upgrade sagemaker
3118
3219
If you are executing this pip install command in a notebook, make sure to restart your kernel.
3320

34-
*******
35-
Changes
36-
*******
21+
****************
22+
Breaking Changes
23+
****************
3724

3825
This section is for major changes that may require updates to your SageMaker Python SDK code.
39-
You can also see what changes have been made in the `CHANGELOG <https://github.com/aws/sagemaker-python-sdk/blob/zwei/CHANGELOG.md>`_.
26+
For the full list of changes, see the `CHANGELOG <https://github.com/aws/sagemaker-python-sdk/blob/master/CHANGELOG.md>`_.
4027

4128
Deprecations
4229
============
@@ -134,8 +121,46 @@ write MIME types as a string,
134121
| ``CONTENT_TYPE_NPY`` | ``"application/x-npy"`` |
135122
+-------------------------------+--------------------------------+
136123

124+
Image URI Functions (e.g. ``get_image_uri``)
125+
--------------------------------------------
126+
127+
The following functions have been deprecated in favor of :func:`sagemaker.image_uris.retrieve`:
128+
129+
- ``sagemaker.amazon_estimator.get_image_uri()``
130+
- ``sagemaker.fw_utils.create_image_uri()``
131+
- ``sagemaker.fw_registry.registry()``
132+
- ``sagemaker.utils.get_ecr_image_uri_prefix()``
133+
134+
For more information about usage, see :func:`sagemaker.image_uris.retrieve`.
135+
136+
SageMaker Python SDK CLI
137+
------------------------
138+
139+
The SageMaker Python SDK CLI has been deprecated.
140+
(This is different from the AWS CLI.)
141+
142+
``enable_cloudwatch_metrics`` for Estimators and Models
143+
-------------------------------------------------------
144+
145+
The parameter ``enable_cloudwatch_metrics`` has been deprecated.
146+
CloudWatch metrics are already emitted for all Training Jobs, etc.
147+
148+
``sagemaker.fw_utils.parse_s3_url``
149+
-----------------------------------
150+
151+
The ``sagemaker.fw_utils.parse_s3_url`` function has been deprecated.
152+
Please use :func:`sagemaker.s3.parse_s3_url` instead.
153+
154+
``sagemaker.session.ModelContainer``
155+
------------------------------------
156+
157+
The class ``sagemaker.session.ModelContainer`` has been deprecated, as it is not needed for creating inference pipelines.
158+
159+
Changes in Default Behavior
160+
===========================
161+
137162
Require ``framework_version`` and ``py_version`` for Frameworks
138-
===============================================================
163+
---------------------------------------------------------------
139164

140165
Framework estimator and model classes now require ``framework_version`` and ``py_version`` instead of supplying defaults,
141166
unless an image URI is explicitly supplied.
@@ -165,6 +190,19 @@ For example:
165190
py_version="py3", # now required
166191
)
167192
193+
Log Display Behavior with ``attach()``
194+
--------------------------------------
195+
196+
Logs are no longer printed when using ``attach()`` with an estimator.
197+
To view logs after attaching a training job to an estimator, use :func:`sagemaker.estimator.EstimatorBase.logs`.
198+
199+
``HyperparameterTuner.fit()`` and ``Transformer.transform()``
200+
-------------------------------------------------------------
201+
202+
:func:`sagemaker.tuner.HyperparameterTuner.fit` and :func:`sagemaker.transformer.Transformer.transform` now wait
203+
until the completion of the Hyperparameter Tuning Job or Batch Transform Job, respectively.
204+
To make the function non-blocking, use ``wait=False``.
205+
168206
Parameter and Class Name Changes
169207
================================
170208

@@ -288,6 +326,19 @@ TensorFlow Serving Predictor
288326
(For the previous implementation of that class, see `Deprecate Legacy TensorFlow <#deprecate-legacy-tensorflow>`_).
289327

290328

329+
Inputs
330+
------
331+
332+
``s3_input``
333+
~~~~~~~~~~~~
334+
335+
``sagemaker.session.s3_input`` has been renamed to :class:`sagemaker.inputs.TrainingInput`.
336+
337+
``ShuffleConfig``
338+
~~~~~~~~~~~~~~~~~
339+
340+
``sagemaker.session.ShuffleConfig`` has been renamed to :class:`sagemaker.inputs.ShuffleConfig`.
341+
291342
Airflow
292343
-------
293344

doc/workflows/kubernetes/amazon_sagemaker_components_for_kubeflow_pipelines.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ Pipelines workflow. For more information, see \ `SageMaker
8989
hyperparameter optimization Kubeflow Pipeline
9090
component <https://github.com/kubeflow/pipelines/tree/master/components/aws/sagemaker/hyperparameter_tuning>`__.
9191

92+
**Processing**
93+
94+
The Processing component enables you to submit processing jobs to Amazon SageMaker directly from a Kubeflow Pipelines workflow. For more information, see \ `SageMaker Processing Kubeflow Pipeline component <https://github.com/kubeflow/pipelines/tree/master/components/aws/sagemaker/process>`__.
95+
9296
Inference components
9397
^^^^^^^^^^^^^^^^^^^^
9498

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def read_version():
3333

3434
# Declare minimal set for installation
3535
required_packages = [
36-
"boto3>=1.13.24",
36+
"boto3>=1.14.12",
3737
"google-pasta",
3838
"numpy>=1.9.0",
3939
"protobuf>=3.1",

0 commit comments

Comments
 (0)