Using Deep Learning Containers with Amazon Deep Learning Containers on Amazon ECS - Amazon Elastic Inference

Using Deep Learning Containers with Amazon Deep Learning Containers on Amazon ECS

Amazon Deep Learning Containers are a set of Docker images for training and serving models in TensorFlow, Apache MXNet (MXNet), and PyTorch on Amazon Elastic Container Service (Amazon ECS). Deep Learning Containers provide optimized environments with TensorFlow, MXNet, and PyTorch. They are available in Amazon Elastic Container Registry (Amazon ECR).

This tutorial describes how to use Deep Learning Containers with Elastic Inference on Amazon ECS.

Prerequisites

Your Amazon ECS container instances require at least version 1.30.0 of the container agent. For information about checking your agent version and updating to the latest version, see Updating the Amazon ECS Container Agent.

Resource Setup

To complete the tutorial, set up the following resources in the AWS Console

  1. Perform the steps for Setting Up Deep Learning Containers on ECS.

    • If you create a VPC and security group, ensure that there is a subnet in an Availability Zone with Elastic Inference available. 

  2. Follow the instructions for Setting Up EI with the following modifications:

    Complete all sections except Launching an Instance with Elastic Inference.

    Create a security group (use the default VPC, or create a VPC with an internet gateway) and open the ports necessary for your desired inference server:

    • Both frameworks require: 22 for SSH and 443 for HTTPS

    • TensorFlow inference: 8500 and 8501 open to TCP traffic

    • MXNet and PyTorch inference: 80 and 8081 open to TCP traffic

    Add the ec2-role-trust-policy.json IAM policy described in the Elastic Inference setup instructions to the ecsInstanceRole IAM role.