You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+20-19Lines changed: 20 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ As a managed service, Amazon SageMaker performs operations on your behalf on the
84
84
Amazon SageMaker can perform only operations that the user permits.
85
85
You can read more about which permissions are necessary in the `AWS Documentation <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html>`__.
86
86
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.
88
88
However, if you are using an IAM role with a path in it, you should grant permission for ``iam:GetRole``.
89
89
90
90
Licensing
@@ -117,27 +117,28 @@ To run the unit tests with tox, run:
117
117
To run the integration tests, the following prerequisites must be met
118
118
119
119
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>`__.
121
122
122
123
We recommend selectively running just those integration tests you'd like to run. You can filter by individual test function names with:
123
124
124
125
::
125
126
126
-
pytest -k 'test_i_care_about'
127
+
tox -- -k 'test_i_care_about'
127
128
128
129
129
130
You can also run all of the integration tests by running the following command, which runs them in sequence, which may take a while:
130
131
131
132
::
132
133
133
-
pytest tests/integ
134
+
tox -- tests/integ
134
135
135
136
136
137
You can also run them in parallel:
137
138
138
139
::
139
140
140
-
pytest -n auto tests/integ
141
+
tox -- -n auto tests/integ
141
142
142
143
143
144
Building Sphinx docs
@@ -149,16 +150,16 @@ Building Sphinx docs
149
150
150
151
make html
151
152
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.
153
154
154
155
MXNet SageMaker Estimators
155
156
--------------------------
156
157
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.
158
159
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``.
160
161
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``.
162
163
163
164
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
164
165
@@ -170,7 +171,7 @@ For more information, see `Using MXNet with the SageMaker Python SDK`_.
170
171
TensorFlow SageMaker Estimators
171
172
-------------------------------
172
173
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.
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``inany network isolation supported Framework Estimator.
569
+
570
+
.. code:: python
571
+
572
+
# set the enable_network_isolation parameter to True
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.
| 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>`__. |
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>`__.
45
42
46
43
For versions 1.3 and higher
47
44
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -142,7 +139,7 @@ You don't have to use all the arguments, arguments you don't care about can be i
142
139
deftrain(hyperparameters, num_gpus, **kwargs):
143
140
pass
144
141
145
-
**Note: Writing a training script that imports correctly**
142
+
**Note: Writing a training script that imports correctly:**
146
143
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.
147
144
148
145
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
701
698
The return object should be one of the following:
702
699
703
700
For versions 1.4 and higher:
704
-
----------------------------
701
+
705
702
- 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")
707
704
708
705
For versions 1.3 and lower:
709
-
---------------------------
706
+
710
707
- a tuple with two items: the response data and ``accept_type`` (the content type of the response data), or
711
708
- a Flask response object: http://flask.pocoo.org/docs/1.0/api/#response-objects
712
709
@@ -828,5 +825,7 @@ The Docker images extend Ubuntu 16.04.
828
825
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.
829
826
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.
830
827
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:
| 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>`_. |
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>`_.
31
29
32
30
.. contents::
33
31
@@ -507,4 +505,7 @@ You can select version of TensorFlow by passing a ``framework_version`` keyword
507
505
Alternatively, you can build your own image by following the instructions in the SageMaker TensorFlow containers
508
506
repository, and passing ``image_name`` to the TensorFlow Estimator constructor.
509
507
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:
0 commit comments