Skip to content

Commit b88fae3

Browse files
authored
documentation: Mention for custom Docker Image (aws#4270)
1 parent 3d07154 commit b88fae3

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

doc/frameworks/pytorch/using_pytorch.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,49 @@ Using third-party libraries
132132
---------------------------
133133

134134
When running your training script on SageMaker, it will have access to some pre-installed third-party libraries including ``torch``, ``torchvision``, and ``numpy``.
135-
For more information on the runtime environment, including specific package versions, see `SageMaker PyTorch Docker containers <https://github.com/aws/deep-learning-containers/tree/master/pytorch>`_.
136135

137136
If there are other packages you want to use with your script, you can include a ``requirements.txt`` file in the same directory as your training script to install other dependencies at runtime. Both ``requirements.txt`` and your training script should be put in the same folder. You must specify this folder in ``source_dir`` argument when creating PyTorch estimator.
138137

139138
The function of installing packages using ``requirements.txt`` is supported for all PyTorch versions during training. When serving a PyTorch model, support for this function varies with PyTorch versions. For PyTorch 1.3.1 or newer, ``requirements.txt`` must be under folder ``code``. The SageMaker PyTorch Estimator will automatically save ``code`` in ``model.tar.gz`` after training (assuming you set up your script and ``requirements.txt`` correctly as stipulated in the previous paragraph). 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``. For PyTorch 1.2.0, ``requirements.txt`` is not supported for inference. For PyTorch 0.4.0 to 1.1.0, ``requirements.txt`` must be in ``source_dir``.
140139

141140
A ``requirements.txt`` file is a text file that contains a list of items that are installed by using ``pip install``. You can also specify the version of an item to install. For information about the format of a ``requirements.txt`` file, see `Requirements Files <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`__ in the pip documentation.
142141

142+
If you were to use your own custom Docker Image, the `SageMaker Python SDK` and the `SageMaker Training Toolkit <https://github.com/aws/sagemaker-training-toolkit/>`__ need to be installed.
143+
144+
To do so, you can add the following lines to your ``requirements.txt`` file:
145+
146+
.. code:: text
147+
148+
sagemaker
149+
sagemaker-training
150+
151+
Deep Learning Framework-Specific SageMaker Toolkits and Containers
152+
------------------------------------------------------------------
153+
154+
Framework-specific Toolkits exist. You might want to use them in your applications for framework-specific features.
155+
156+
For Training Toolkits, see:
157+
158+
- `SageMaker PyTorch Training Toolkit <https://github.com/aws/sagemaker-pytorch-training-toolkit>`__
159+
- `SageMaker MXNet Training Toolkit <https://github.com/aws/sagemaker-mxnet-training-toolkit>`__
160+
- `SageMaker TensorFlow Training Toolkit <https://github.com/aws/sagemaker-tensorflow-training-toolkit>`__
161+
162+
For Inference Toolkits, see:
163+
164+
- `SageMaker PyTorch Inference Toolkit <https://github.com/aws/sagemaker-pytorch-inference-toolkit>`__
165+
- `SageMaker MXNet Inference Toolkit <https://github.com/aws/sagemaker-mxnet-training-toolkit>`__
166+
- `SageMaker TensorFlow Inference Toolkit <https://github.com/aws/sagemaker-tensorflow-inference-toolkit>`__
167+
- `SageMaker HuggingFace Inference Toolkit <https://github.com/aws/sagemaker-huggingface-inference-toolkit>`__
168+
169+
Moreover, for more information on the container runtime environment, including specific framework versions and configurations,
170+
see `AWS Deep Learning Containers <https://github.com/aws/deep-learning-containers/>`_. More specifically, see:
171+
172+
- `Images for PyTorch <https://github.com/aws/deep-learning-containers/tree/master/pytorch>`__
173+
- `Images for MXNet <https://github.com/aws/deep-learning-containers/tree/master/mxnet>`__
174+
- `Images for TensorFlow <https://github.com/aws/deep-learning-containers/tree/master/tensorflow>`__
175+
- `Images for HuggingFace <https://github.com/aws/deep-learning-containers/tree/master/huggingface>`__
176+
177+
143178
Create an Estimator
144179
===================
145180

0 commit comments

Comments
 (0)