Skip to content

Commit 4d30d03

Browse files
authored
Merge branch 'master' into ioFollowup2
2 parents c80b63d + f1d34ad commit 4d30d03

20 files changed

+383
-158
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ venv/
2525
*~
2626
.pytest_cache/
2727
*.swp
28-
tests/data/local_mode_lock
28+
.docker/

CHANGELOG.md

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

3+
## v1.28.3 (2019-06-20)
4+
5+
### Bug fixes and other changes
6+
7+
* update Sagemaker Neo regions and instance families
8+
9+
### Documentation changes
10+
11+
* fix punctuation in MXNet version list
12+
* clean up MXNet and TF documentation
13+
14+
## v1.28.2 (2019-06-19)
15+
16+
### Bug fixes and other changes
17+
18+
* prevent race condition in vpc tests
19+
320
## v1.28.1 (2019-06-17)
421

522
### Bug fixes and other changes

README.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ As a managed service, Amazon SageMaker performs operations on your behalf on the
8484
Amazon SageMaker can perform only operations that the user permits.
8585
You can read more about which permissions are necessary in the `AWS Documentation <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html>`__.
8686

87-
The SageMaker Python SDK should not require any additional permissions.
87+
The SageMaker Python SDK should not require any additional permissions aside from what is required for using SageMaker.
8888
However, if you are using an IAM role with a path in it, you should grant permission for ``iam:GetRole``.
8989

9090
Licensing
@@ -117,27 +117,28 @@ To run the unit tests with tox, run:
117117
To run the integration tests, the following prerequisites must be met
118118

119119
1. AWS account credentials are available in the environment for the boto3 client to use.
120-
2. The AWS account has an IAM role named :code:`SageMakerRole` with the AmazonSageMakerFullAccess policy attached.
120+
2. The AWS account has an IAM role named :code:`SageMakerRole`.
121+
It should have the AmazonSageMakerFullAccess policy attached as well as a policy with `the necessary permissions to use Elastic Inference <https://docs.aws.amazon.com/sagemaker/latest/dg/ei-setup.html>`__.
121122

122123
We recommend selectively running just those integration tests you'd like to run. You can filter by individual test function names with:
123124

124125
::
125126

126-
pytest -k 'test_i_care_about'
127+
tox -- -k 'test_i_care_about'
127128

128129

129130
You can also run all of the integration tests by running the following command, which runs them in sequence, which may take a while:
130131

131132
::
132133

133-
pytest tests/integ
134+
tox -- tests/integ
134135

135136

136137
You can also run them in parallel:
137138

138139
::
139140

140-
pytest -n auto tests/integ
141+
tox -- -n auto tests/integ
141142

142143

143144
Building Sphinx docs
@@ -149,16 +150,16 @@ Building Sphinx docs
149150

150151
make html
151152

152-
You can edit the templates for any of the pages in the docs by editing the .rst files in the "doc" directory and then running "``make html``" again.
153+
You can edit the templates for any of the pages in the docs by editing the .rst files in the ``doc`` directory and then running ``make html`` again.
153154

154155
MXNet SageMaker Estimators
155156
--------------------------
156157

157-
By using MXNet SageMaker ``Estimators``, you can train and host MXNet models on Amazon SageMaker.
158+
By using MXNet SageMaker Estimators, you can train and host MXNet models on Amazon SageMaker.
158159

159-
Supported versions of MXNet: ``1.3.0``, ``1.2.1``, ``1.1.0``, ``1.0.0``, ``0.12.1``.
160+
Supported versions of MXNet: ``0.12.1``, ``1.0.0``, ``1.1.0``, ``1.2.1``, ``1.3.0``, ``1.4.0``.
160161

161-
Supported versions of MXNet for Elastic Inference: ``1.3.0``
162+
Supported versions of MXNet for Elastic Inference: ``1.3.0``, ``1.4.0``.
162163

163164
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
164165

@@ -170,7 +171,7 @@ For more information, see `Using MXNet with the SageMaker Python SDK`_.
170171
TensorFlow SageMaker Estimators
171172
-------------------------------
172173

173-
By using TensorFlow SageMaker ``Estimators``, you can train and host TensorFlow models on Amazon SageMaker.
174+
By using TensorFlow SageMaker Estimators, you can train and host TensorFlow models on Amazon SageMaker.
174175

175176
Supported versions of TensorFlow: ``1.4.1``, ``1.5.0``, ``1.6.0``, ``1.7.0``, ``1.8.0``, ``1.9.0``, ``1.10.0``, ``1.11.0``, ``1.12.0``.
176177

@@ -186,47 +187,47 @@ For more information, see `Using TensorFlow with the SageMaker Python SDK`_.
186187
Chainer SageMaker Estimators
187188
----------------------------
188189

189-
By using Chainer SageMaker ``Estimators``, you can train and host Chainer models on Amazon SageMaker.
190+
By using Chainer SageMaker Estimators, you can train and host Chainer models on Amazon SageMaker.
190191

191192
Supported versions of Chainer: ``4.0.0``, ``4.1.0``, ``5.0.0``.
192193

193194
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
194195

195196
For more information about Chainer, see https://github.com/chainer/chainer.
196197

197-
For more information about Chainer SageMaker ``Estimators``, see `Using Chainer with the SageMaker Python SDK`_.
198+
For more information about Chainer SageMaker Estimators, see `Using Chainer with the SageMaker Python SDK`_.
198199

199200
.. _Using Chainer with the SageMaker Python SDK: https://sagemaker.readthedocs.io/en/stable/using_chainer.html
200201

201202

202203
PyTorch SageMaker Estimators
203204
----------------------------
204205

205-
With PyTorch SageMaker ``Estimators``, you can train and host PyTorch models on Amazon SageMaker.
206+
With PyTorch SageMaker Estimators, you can train and host PyTorch models on Amazon SageMaker.
206207

207208
Supported versions of PyTorch: ``0.4.0``, ``1.0.0``.
208209

209210
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
210211

211212
For more information about PyTorch, see https://github.com/pytorch/pytorch.
212213

213-
For more information about PyTorch SageMaker ``Estimators``, see `Using PyTorch with the SageMaker Python SDK`_.
214+
For more information about PyTorch SageMaker Estimators, see `Using PyTorch with the SageMaker Python SDK`_.
214215

215216
.. _Using PyTorch with the SageMaker Python SDK: https://sagemaker.readthedocs.io/en/stable/using_pytorch.html
216217

217218

218219
Scikit-learn SageMaker Estimators
219220
---------------------------------
220221

221-
With Scikit-learn SageMaker ``Estimators``, you can train and host Scikit-learn models on Amazon SageMaker.
222+
With Scikit-learn SageMaker Estimators, you can train and host Scikit-learn models on Amazon SageMaker.
222223

223224
Supported versions of Scikit-learn: ``0.20.0``.
224225

225226
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
226227

227228
For more information about Scikit-learn, see https://scikit-learn.org/stable/
228229

229-
For more information about Scikit-learn SageMaker ``Estimators``, see `Using Scikit-learn with the SageMaker Python SDK`_.
230+
For more information about Scikit-learn SageMaker Estimators, see `Using Scikit-learn with the SageMaker Python SDK`_.
230231

231232
.. _Using Scikit-learn with the SageMaker Python SDK: https://sagemaker.readthedocs.io/en/stable/using_sklearn.html
232233

@@ -236,13 +237,13 @@ SageMaker Reinforcement Learning Estimators
236237

237238
With Reinforcement Learning (RL) Estimators, you can use reinforcement learning to train models on Amazon SageMaker.
238239

239-
Supported versions of Coach: ``0.10.1`` with TensorFlow, ``0.11.0`` with TensorFlow or MXNet.
240+
Supported versions of Coach: ``0.10.1``, ``0.11.1`` with TensorFlow, ``0.11.0`` with TensorFlow or MXNet.
240241
For more information about Coach, see https://github.com/NervanaSystems/coach
241242

242-
Supported versions of Ray: ``0.5.3`` with TensorFlow.
243+
Supported versions of Ray: ``0.5.3``, ``0.6.5`` with TensorFlow.
243244
For more information about Ray, see https://github.com/ray-project/ray
244245

245-
For more information about SageMaker RL ``Estimators``, see `SageMaker Reinforcement Learning Estimators`_.
246+
For more information about SageMaker RL Estimators, see `SageMaker Reinforcement Learning Estimators`_.
246247

247248
.. _SageMaker Reinforcement Learning Estimators: src/sagemaker/rl/README.rst
248249

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.28.2.dev0
1+
1.28.4.dev0

doc/overview.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,33 @@ Likewise, when you create ``Transformer`` from the ``Estimator`` using ``transfo
559559
# Transform Job container instances will run in your VPC
560560
mxnet_vpc_transformer.transform('s3://my-bucket/batch-transform-input')
561561
562+
Secure Training with Network Isolation (Internet-Free) Mode
563+
-------------------------------------------------------------------------
564+
You can enable network isolation mode when running training and inference on Amazon SageMaker.
565+
566+
For more information about Amazon SageMaker network isolation mode, see the `SageMaker documentation on network isolation or internet-free mode <https://docs.aws.amazon.com/sagemaker/latest/dg/mkt-algo-model-internet-free.html>`__.
567+
568+
To train a model in network isolation mode, set the optional parameter ``enable_network_isolation`` to ``True`` in any network isolation supported Framework Estimator.
569+
570+
.. code:: python
571+
572+
# set the enable_network_isolation parameter to True
573+
sklearn_estimator = SKLearn('sklearn-train.py',
574+
train_instance_type='ml.m4.xlarge',
575+
framework_version='0.20.0',
576+
hyperparameters = {'epochs': 20, 'batch-size': 64, 'learning-rate': 0.1},
577+
enable_network_isolation=True)
578+
579+
# SageMaker Training Job will in the container without any inbound or outbound network calls during runtime
580+
sklearn_estimator.fit({'train': 's3://my-data-bucket/path/to/my/training/data',
581+
'test': 's3://my-data-bucket/path/to/my/test/data'})
582+
583+
When this training job is created, the SageMaker Python SDK will upload the files in ``entry_point``, ``source_dir``, and ``dependencies`` to S3 as a compressed ``sourcedir.tar.gz`` file (``'s3://mybucket/sourcedir.tar.gz'``).
584+
585+
A new training job channel, named ``code``, will be added with that S3 URI. Before the training docker container is initialized, the ``sourcedir.tar.gz`` will be downloaded from S3 to the ML storage volume like any other offline input channel.
586+
587+
Once the training job begins, the training container will look at the offline input ``code`` channel to install dependencies and run the entry script. This isolates the training container, so no inbound or outbound network calls can be made.
588+
562589
563590
FAQ
564591
---

doc/using_mxnet.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@ In the following sections, we'll discuss how to prepare a training script for ex
3535
Preparing the MXNet training script
3636
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3737

38-
+----------------------------------------------------------------------------------------------------------------------------------------------------------+
39-
| WARNING |
40-
+==========================================================================================================================================================+
41-
| The structure for training scripts changed starting at MXNet version 1.3. |
42-
| Make sure you refer to the correct section of this README when you prepare your script. |
43-
| For information on how to upgrade an old script to the new format, see `"Updating your MXNet training script" <#updating-your-mxnet-training-script>`__. |
44-
+----------------------------------------------------------------------------------------------------------------------------------------------------------+
38+
.. warning::
39+
The structure for training scripts changed starting at MXNet version 1.3.
40+
Make sure you refer to the correct section of this README when you prepare your script.
41+
For information on how to upgrade an old script to the new format, see `"Updating your MXNet training script" <#updating-your-mxnet-training-script>`__.
4542

4643
For versions 1.3 and higher
4744
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -142,7 +139,7 @@ You don't have to use all the arguments, arguments you don't care about can be i
142139
def train(hyperparameters, num_gpus, **kwargs):
143140
pass
144141
145-
**Note: Writing a training script that imports correctly**
142+
**Note: Writing a training script that imports correctly:**
146143
When SageMaker runs your training script, it imports it as a Python module and then invokes ``train`` on the imported module. Consequently, you should not include any statements that won't execute successfully in SageMaker when your module is imported. For example, don't attempt to open any local files in top-level statements in your training script.
147144

148145
If you want to run your training script locally via the Python interpreter, look at using a ``___name__ == '__main__'`` guard, discussed in more detail here: https://stackoverflow.com/questions/419163/what-does-if-name-main-do .
@@ -701,12 +698,12 @@ This one function should handle processing the input, performing a prediction, a
701698
The return object should be one of the following:
702699

703700
For versions 1.4 and higher:
704-
----------------------------
701+
705702
- a tuple with two items: the response data and ``accept_type`` (the content type of the response data), or
706-
- the response data: (the content type of the response will be set to either the accept header in the initial request or default to application/json)
703+
- the response data: (the content type of the response will be set to either the accept header in the initial request or default to "application/json")
707704

708705
For versions 1.3 and lower:
709-
---------------------------
706+
710707
- a tuple with two items: the response data and ``accept_type`` (the content type of the response data), or
711708
- a Flask response object: http://flask.pocoo.org/docs/1.0/api/#response-objects
712709

@@ -828,5 +825,7 @@ The Docker images extend Ubuntu 16.04.
828825
You can select version of MXNet by passing a ``framework_version`` keyword arg to the MXNet Estimator constructor. Currently supported versions are listed in the above table. You can also set ``framework_version`` to only specify major and minor version, e.g ``1.2``, which will cause your training script to be run on the latest supported patch version of that minor version, which in this example would be 1.2.1.
829826
Alternatively, you can build your own image by following the instructions in the SageMaker MXNet containers repository, and passing ``image_name`` to the MXNet Estimator constructor.
830827

831-
You can visit the SageMaker MXNet training containers repository here: https://github.com/aws/sagemaker-mxnet-container
832-
You can visit the SageMaker MXNet serving containers repository here: https://github.com/aws/sagemaker-mxnet-serving-container
828+
You can visit the SageMaker MXNet container repositories here:
829+
830+
- training: https://github.com/aws/sagemaker-mxnet-container
831+
- serving: https://github.com/aws/sagemaker-mxnet-serving-container

doc/using_tf.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ models on SageMaker Hosting.
88

99
**Note:** This topic describes how to use script mode for TensorFlow versions 1.11 and later.
1010
For Documentation of the previous Legacy Mode versions, see:
11+
1112
* `1.4.1 <https://github.com/aws/sagemaker-python-sdk/tree/v1.0.0#tensorflow-sagemaker-estimators>`_
1213
* `1.5.0 <https://github.com/aws/sagemaker-python-sdk/tree/v1.1.0#tensorflow-sagemaker-estimators>`_
1314
* `1.6.0 <https://github.com/aws/sagemaker-python-sdk/blob/v1.5.0/src/sagemaker/tensorflow/README.rst#tensorflow-sagemaker-estimators-and-models>`_
@@ -16,18 +17,15 @@ For Documentation of the previous Legacy Mode versions, see:
1617
* `1.9.0 <https://github.com/aws/sagemaker-python-sdk/blob/v1.9.2/src/sagemaker/tensorflow/README.rst#tensorflow-sagemaker-estimators-and-models>`_
1718
* `1.10.0 <https://github.com/aws/sagemaker-python-sdk/blob/v1.10.0/src/sagemaker/tensorflow/README.rst#tensorflow-sagemaker-estimators-and-models>`_
1819

19-
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
20-
| WARNING |
21-
+=============================================================================================================================================================================+
22-
| We have added a new format of your TensorFlow training script with TensorFlow version 1.11. |
23-
| This new way gives the user script more flexibility. |
24-
| This new format is called Script Mode, as opposed to Legacy Mode, which is what we support with TensorFlow 1.11 and older versions. |
25-
| In addition we are adding Python 3 support with Script Mode. |
26-
| Last supported version of Legacy Mode will be TensorFlow 1.12. |
27-
| Script Mode is available with TensorFlow version 1.11 and newer. |
28-
| Make sure you refer to the correct version of this README when you prepare your script. |
29-
| You can find the Legacy Mode README `here <https://github.com/aws/sagemaker-python-sdk/tree/v1.12.0/src/sagemaker/tensorflow#tensorflow-sagemaker-estimators-and-models>`_. |
30-
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
20+
.. warning::
21+
We have added a new format of your TensorFlow training script with TensorFlow version 1.11.
22+
This new way gives the user script more flexibility.
23+
This new format is called Script Mode, as opposed to Legacy Mode, which is what we support with TensorFlow 1.11 and older versions.
24+
In addition we are adding Python 3 support with Script Mode.
25+
Last supported version of Legacy Mode will be TensorFlow 1.12.
26+
Script Mode is available with TensorFlow version 1.11 and newer.
27+
Make sure you refer to the correct version of this README when you prepare your script.
28+
You can find the Legacy Mode README `here <https://github.com/aws/sagemaker-python-sdk/tree/v1.12.0/src/sagemaker/tensorflow#tensorflow-sagemaker-estimators-and-models>`_.
3129

3230
.. contents::
3331

@@ -507,4 +505,7 @@ You can select version of TensorFlow by passing a ``framework_version`` keyword
507505
Alternatively, you can build your own image by following the instructions in the SageMaker TensorFlow containers
508506
repository, and passing ``image_name`` to the TensorFlow Estimator constructor.
509507

510-
For more information on the contents of the images, see the SageMaker TensorFlow containers repository here: https://github.com/aws/sagemaker-tensorflow-containers/
508+
For more information on the contents of the images, see the SageMaker TensorFlow containers repositories here:
509+
510+
- training: https://github.com/aws/sagemaker-tensorflow-container
511+
- serving: https://github.com/aws/sagemaker-tensorflow-serving-container

0 commit comments

Comments
 (0)