In this tutorial, I will walk you through the steps involved in hosting a PyTorch model on Amazon Web Services’ EC2 backed by an EFS file system. This article is a part of the series on making AWS Lambda functions stateful with Amazon EFS (Part 1, Part 2).
Assuming you followed the steps mentioned in the previous tutorial, you should have an EC2 instance with a mounted EFS file system. We will now configure it to run a Flask server that exposes a PyTorch inference API.
Our goal is to install all the dependencies of PyTorch and test the inference on EC2 before running it in AWS Lambda.
Read the entire article at The New Stack