pdfcoffee

soumyasankar99
from soumyasankar99 More from this publisher
09.05.2023 Views

Chapter 12After clicking Launch Instance, you can create your virtual machine in two simplesteps:1. Choose an Amazon Machine Image (AMI): Amazon offers a variety ofprebuilt AMIs for Deep Learning (https://aws.amazon.com/machinelearning/amis/).The Conda AMIs (on AWS Linux, Ubuntu, and WindowsOS) provide prebuilt Conda virtual environments for various Deep Learningframeworks including TensorFlow. The Base AMIs (on AWS Linux andUbuntu) have various versions of CUDA preinstalled, and the user needsto enable the appropriate CUDA version and install the framework of choice.As of November 2019, the existing AMIs in AmazonMarketplace do not support TensorFlow 2.x.2. Choose the Instance type: Amazon offers a wide range of instance selection,from general purpose computing to accelerated computing. For the purposeof deep learning we require instances with GPUs. P3, P2, G4, G3, and G2instances have GPU support (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html). So, forDL projects you should select one of these. Please note that AWS has instancelimits set on these, by default for all accelerated compute instances it is setto 0. You will need to first request for an increase in the instance limit (againremember each instance is not available in every region, so go through thedocumentation to know what regions to choose for your required instance).Now unless you want to do advanced network and security settings, your machineis ready to launch. Just review your selections and launch it. Amazon EC2 allowsyou to communicate with your virtual machine through the command line via SSHor using a web browser.An alternative to Amazon EC2 is Compute Instance, available on GCP.[ 449 ]

TensorFlow and CloudCompute Instance on GCPTo access Compute instance, go to the Google Cloud Console and select ComputeEngine, and you will reach the dashboard where you can select the configurationyou want for your virtual machine. Following is a screenshot of the Compute Enginedashboard. Select Create or Import (if you already have a saved VM configuration)to create a new virtual machine instance:Figure 5: The Compute Engine dashboardAlternatively, you can also choose the complete configuration from the marketplace,which will launch the environment with the corresponding (minimum)infrastructure. You then just need to deploy the instance. Each instance will havedifferent price rating per month depending upon the compute resources it requires.GCP Compute Engine offers two options for CPUs families, either Intel Skylakeplatform (also called N1; this series allows GPUs) or the Intel Cascade Lake platform.With your machine you have an option to add GPUs. At the time of writing thisbook, GCP offered four different GPUs (and TPUs; for more on TPUs refer toChapter 16, Tensor Processing Unit):[ 450 ]

Chapter 12

After clicking Launch Instance, you can create your virtual machine in two simple

steps:

1. Choose an Amazon Machine Image (AMI): Amazon offers a variety of

prebuilt AMIs for Deep Learning (https://aws.amazon.com/machinelearning/amis/).

The Conda AMIs (on AWS Linux, Ubuntu, and Windows

OS) provide prebuilt Conda virtual environments for various Deep Learning

frameworks including TensorFlow. The Base AMIs (on AWS Linux and

Ubuntu) have various versions of CUDA preinstalled, and the user needs

to enable the appropriate CUDA version and install the framework of choice.

As of November 2019, the existing AMIs in Amazon

Marketplace do not support TensorFlow 2.x.

2. Choose the Instance type: Amazon offers a wide range of instance selection,

from general purpose computing to accelerated computing. For the purpose

of deep learning we require instances with GPUs. P3, P2, G4, G3, and G2

instances have GPU support (https://docs.aws.amazon.com/AWSEC2/

latest/UserGuide/accelerated-computing-instances.html). So, for

DL projects you should select one of these. Please note that AWS has instance

limits set on these, by default for all accelerated compute instances it is set

to 0. You will need to first request for an increase in the instance limit (again

remember each instance is not available in every region, so go through the

documentation to know what regions to choose for your required instance).

Now unless you want to do advanced network and security settings, your machine

is ready to launch. Just review your selections and launch it. Amazon EC2 allows

you to communicate with your virtual machine through the command line via SSH

or using a web browser.

An alternative to Amazon EC2 is Compute Instance, available on GCP.

[ 449 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!