PyTorch on AWS

Easily build and deploy deep learning models in the cloud

PyTorch is an open source, deep learning framework that makes it easy to develop machine learning models and deploy them to production. PyTorch provides a hybrid front-end that allows developers to iterate quickly on their models in the prototyping stage without sacrificing performance in the production stage. Using this hybrid front-end, developers can seamlessly transition between eager mode, which performs computations immediately for easy development, and graph mode which creates computational graphs for efficient execution in production environment. PyTorch supports dynamic computation graphs, which provides a flexible structure that is intuitive to work with and easy to debug. PyTorch also offers distributed training, deep integration into Python, and a rich ecosystem of tools and libraries, making it popular with researchers and engineers.

You can get started on AWS with a fully-managed PyTorch experience with Amazon SageMaker, a platform to easily build, train, and deploy machine learning models at scale. If you need to build custom environments and workflows, you can use the PyTorch integration with the AWS Deep Learning AMIs.



Seamlessly transition between rapid prototyping and production scale to take models from idea to implementation quickly.


Deep integration into Python allows the easy use of popular libraries and packages, such as Pillow, scipy, NLTK, and others for building neural network layers.


A rich ecosystem of tools and libraries, including Crayon, tensorboardX, AllenNLP, and torchvision, extends PyTorch and supports development in computer vision, natural language processing, and more.

Getting Started

It’s easy to get started with PyTorch on Amazon SageMaker using the FAIRSeq model example. Developed by Facebook’s Artificial Intelligence Research team, FAIRSeq can train and run models that achieve state-of-the-art performance on machine translation and summarization tasks. FAIRSeq provides multi-GPU training capability on one machine or across multiple machines. It includes reference implementations of various sequence-to-sequence models including Long Short-Term Memory (LSTM) networks and a novel convolutional neural network (CNN) that can generate translations many times faster than comparable recurrent neural network (RNN) models.

The following examples show you how to integrate FAIRSeq into PyTorch and Amazon SageMaker by creating your own container and then using it to train and serve predictions. Example notebooks include:

  • Complete training-to-serving example utilizing either a German-to-English or English-to-French translation model
  • Complete training-to-serving example of the same German-to-English model utilizing multi-GPU parallel training
  • Serving a pre-trained English-to-French model

Learn how to get started with PyTorch on Amazon SageMaker

Learn more about Amazon SageMaker

Amazon SageMaker is a fully-managed service that enables developers and data scientists to quickly and easily build, train, and deploy machine learning models at any scale. Amazon SageMaker supports popular deep learning frameworks including PyTorch and TensorFlow so you can use the framework you are already familiar with.

Ready to build?
Try the AWS Deep Learning AMIs
Have more questions?
Contact us