Analyzing CPU vs GPU Performance for AWS Machine Learning


72 students completed the lab in ~27m

Total available time: 45m

25 students rated this lab!

Lab Overview

Graphics processing units (GPUs) and other hardware accelerators can dramatically reduce the time taken to train complex machine learning models. In this lab, you will take control of a p2.xlarge instance equipped with an NVIDIA Tesla K80 GPU to perform a CPU vs GPU performance analysis for Amazon Machine Learning. The instance is based on the AWS deep learning AMI that comes with many machine learning libraries pre-installed. You will create a Jupyter Notebook to write code and visualize results in a single document. The TensorFlow library is used for the CPU and GPU benchmark code.

Lab Objectives

Upon completion of this Lab you will be able to:

  • Run Jupyter Notebook server and create Jupyter Notebooks for machine learning experiments
  • Configure an SSH tunnel to forward instance ports through an encrypted channel
  • Understand when GPUs can be advantageous in machine learning, and to what extent

Lab Prerequisites

You should be familiar with:

  • Working with Linux on the command-line
  • Knowledge of the Python programming language is beneficial, but not required

Lab Environment

Before completing the Lab instructions, the environment will look as follows:

After completing the Lab instructions, the environment should look similar to:

Follow these steps to learn by building helpful cloud resources

Logging in to the Amazon Web Services Console

Your first step to start the Lab experience

Connecting to the Virtual Machine using SSH

Create a secure connection to a remote machine

Starting a Jupyter Notebook Server

Start a Jupyter notebook server in order to create your own notebook

Forwarding a Virtual Machine Port through an SSH Tunnel

Forward a virtual machine port through an encrypted SSH tunnel

Setting Up the CPU vs. GPU Experiment

Prepare to run the CPU versus GPU experiment

Running the CPU vs. GPU Experiment

Run the Jupyter notebook to gather the experiment results

Analyzing the CPU vs. GPU Experiment Results

Analyze the results of the experiment from various perspectives