Deep Learning on the Cloud - GPU TO LEARN FASTER

CodeEmporium · Beginner ·☁️ DevOps & Cloud ·8y ago

Key Takeaways

Training deep learning models on the cloud using Amazon EC2 and leveraging GPU computation power with tools like TensorFlow and Jupyter Notebook

Full Transcript

some of you watching this video might just be breaking into the fields of machine learning or deep learning others may have some knowledge of executing models through packages like scikit-learn and some of you may even know about deep learning frameworks like Karros with the tensorflow Theano or c NT k backend regardless of your experience if you've ever trained a model on your computer you know that it can take a while like a really long time this is especially true for training neural networks because of the sheer amount of data we need for training computers take a lot of time because it only uses the CPU for performing millions of mathematical operations nowadays this task can be extended to other parts of our computer specifically the GPU GPUs were traditionally used for gaming and video rendering but we also find it useful in training models for deep learning some computers may come with built-in GPUs but they're probably enough just to render basic graphics kind of like iris on MacBooks or Nvidia on window PCs and laptops the latter being more powerful nine out of ten times this processing power is still not enough to train models with all the data that is required by many problems and even for models that can be trained the training is very slow I'm making this video because I ran into a problem not too long ago I wanted to train a DC again to generate some digit images using the Emnes data set I wrote a program and it worked but there was a problem it was training slow like very very slow it would take a significant amount of time to train the CNN and addy convolutional network over 3,000 iterations chances are it would have taken an entire day to train this hello world model with again imagine the time I would have taken to train a really complicated model with a really large data set it's crazy one way to solve this problem like I said is to use GPUs you could get an external GPU and configured for your computer but GPUs are several hundreds of dollars and you'll have to deal with the hardware maintenance nowadays technology advances you fast to keep track of it what'd you buy today will probably be obsolete next year furthermore I'm on a Mac and I saw this concerning message about tensorflow GPU support and how it would discontinue at version 1.2 so this led me to another option using the cloud so in this video we're gonna talk about the steps we need to take to get an ami instance up and running for training your large models in Amazon's ec2 a lot of words yeah but I'll explain everything you first need to create an account the link to this page will be down in the description below it'll ask for basic information including credit or debit card info make sure you choose the developer account which is $29.99 at the time of making this video the free basic account doesn't allow you to access as many resources you might as well just run the programs on your own laptop once logged in you should see a console page that looks something like this what do you want to do from here is search for ec2 easy to by the way stands for elastic cloud compute this will link you to the dashboard you can do a lot of stuff here but I'm only going to go through the essentials to get you up and running with an a my instance Amazon does well explaining themselves here so you can come back to it when you have time for now click on the limits link you'll see the available instances and their capacities you have in the current plan which is at least developer I hope I'm running you through this section because when I first set up my account the first thing I wanted to do was launch an instance and get my program running really late in the instance setup I realized that it kept failing because I didn't see this page I know I've been throwing the terms instance an ami a lot so a few words on this before I actually continue basically Amazon provides many services one of which they call Amazon Elastic cloud compute or Amazon ec2 as soon as you hear the word cloud you're probably gonna ask a question about what kind of cloud service model is it this particular service is an infrastructure as a service so why is that I say so because the underlying hardware and store which is abstract it from the user but the user has control over operating system resources like setting up a virtual machine for example this distinguishes it from a pass a platform as a service and obviously a software as a service a SAS now in this infrastructure they provide something called a Mis Amazon machine images an ami is basically a virtual appliance and like any virtual appliance ami consists of a template which is a layout of an operating system and a software configuration this is used to generate virtual machines also known as instances we can generate many instances from a single ami okay we got that theory out of Hawaii on this Limits page each instance listed provides different resources and different amounts of resources in the free tier for example you have access to create a t2 micro instance t2s are typically used for general CPU computations it's already available to you so you can just begin launching an instance in my opinion your laptop may already have more computing power and so you're better off training these models on your laptop what we need now is GPU computation power and this is provided by p2 instances one problem though is that they're not immediately available to us so I cannot just say create a p2 x-large instance right off the bat we need to request for a limit increase on this resource so why does AWS do this the idea is to protect their infrastructure and ensure that their clients only use what they need to use and want to use if there were to say grant 10 of these p2 instances from the get-go then you would be compelled to use all of them utilizing all these resources would cost them thousands of dollars well no matter when putting forward a request usually they deal with it pretty quickly it may take a few hours for them to send a response and another day or two to actually grant the request though once the limit instance is taken care of you'll see the update on the page let us now see how we can generate this instance go back to the dashboard and click Launch instance by this we mean creating a virtual machine instance now we just have to follow a sequence of seven steps will first choose the AMI every ami listed here has the name as well as when you want to use it since I want to perform deep learning with Carolyn tensorflow I choose the deep learning AMI Amazon Linux version 3.0 next we determine the type of instance we want this ami to generate remember we need GPU computation power so it makes sense to choose from that family alone we choose the p2x large instance and click review and launch if everything is okay here then click launch now we create a key pair and download it as a dot PEM file you if everything is looking good QlikView instances on the bottom as a first-time user you will only see one instance running now to use the instance will need to remotely log in go to the terminal and enter the directory where you have the key pair file downloaded first off change the permissions of the file to be slightly more restrictive I changed it to 600 so only the file owner can read and write to this file next type in the secure shell command where we'll be using port 8080 d8 type the name of the key para file followed by the user and the public IP address of our ami instance once we're in start an environment with tensorflow and caras and khuda' for GPU utility you we are now ready to code let's open a Jupiter notebook and execute the digit recognition model for the Emnes data set this is a built-in test program already available to us so there's really no need to code just execute the cell if you're using GPU computation instance you'll notice that the program execution speed is several times faster than that on a local machine you can see why we use this now when you're done remember to stop you're launched incense so you're not charged when it's not in use and that's how we train a deep learning model in the cloud hope this video helps you get started with launching instances in Amazon's easy too if you liked the video hit that like button and subscribe for more awesome content oh and sharing is caring so share the video and I'll see you in the next one bye bye

Original Description

We talk about how you can train your models on the cloud with a p2.xlarge instance, leveraging GPU computation power. If you like the video, like and SUBSCRIBE to the channel for more amazing content! LINKS Create an account: https://aws.amazon.com Instances & AMI: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instances-and-amis.html
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from CodeEmporium · CodeEmporium · 4 of 60

1 Linear Regression and Multiple Regression
Linear Regression and Multiple Regression
CodeEmporium
2 Logistic Regression - THE MATH YOU SHOULD KNOW!
Logistic Regression - THE MATH YOU SHOULD KNOW!
CodeEmporium
3 Generative Adversarial Networks - FUTURISTIC & FUN AI !
Generative Adversarial Networks - FUTURISTIC & FUN AI !
CodeEmporium
Deep Learning on the Cloud - GPU TO LEARN FASTER
Deep Learning on the Cloud - GPU TO LEARN FASTER
CodeEmporium
5 Deep Mind's AlphaGo Zero - EXPLAINED
Deep Mind's AlphaGo Zero - EXPLAINED
CodeEmporium
6 Mask Region based Convolution Neural Networks - EXPLAINED!
Mask Region based Convolution Neural Networks - EXPLAINED!
CodeEmporium
7 Attention in Neural Networks
Attention in Neural Networks
CodeEmporium
8 Depthwise Separable Convolution - A FASTER CONVOLUTION!
Depthwise Separable Convolution - A FASTER CONVOLUTION!
CodeEmporium
9 One Neural network learns EVERYTHING ?!
One Neural network learns EVERYTHING ?!
CodeEmporium
10 Neural Voice Cloning
Neural Voice Cloning
CodeEmporium
11 AI creates Image Classifiers…by DRAWING?
AI creates Image Classifiers…by DRAWING?
CodeEmporium
12 Unpaired Image-Image Translation using CycleGANs
Unpaired Image-Image Translation using CycleGANs
CodeEmporium
13 K-Means Clustering - EXPLAINED!
K-Means Clustering - EXPLAINED!
CodeEmporium
14 Random Forest Classification
Random Forest Classification
CodeEmporium
15 Data Science in Finance
Data Science in Finance
CodeEmporium
16 Hypothesis testing with Applications in Data Science
Hypothesis testing with Applications in Data Science
CodeEmporium
17 A/B Testing - Simply Explained
A/B Testing - Simply Explained
CodeEmporium
18 The Kernel Trick - THE MATH YOU SHOULD KNOW!
The Kernel Trick - THE MATH YOU SHOULD KNOW!
CodeEmporium
19 Support Vector Machines - THE MATH YOU  SHOULD KNOW
Support Vector Machines - THE MATH YOU SHOULD KNOW
CodeEmporium
20 Principal Component Analysis (PCA) - THE MATH YOU SHOULD KNOW!
Principal Component Analysis (PCA) - THE MATH YOU SHOULD KNOW!
CodeEmporium
21 History of Calculus - Animated
History of Calculus - Animated
CodeEmporium
22 Curiosity in AI
Curiosity in AI
CodeEmporium
23 DropBlock - A BETTER DROPOUT for Neural Networks
DropBlock - A BETTER DROPOUT for Neural Networks
CodeEmporium
24 Autoencoders - EXPLAINED
Autoencoders - EXPLAINED
CodeEmporium
25 Recurrent Neural Networks - EXPLAINED!
Recurrent Neural Networks - EXPLAINED!
CodeEmporium
26 LSTM Networks - EXPLAINED!
LSTM Networks - EXPLAINED!
CodeEmporium
27 Building an Image Captioner with Neural Networks
Building an Image Captioner with Neural Networks
CodeEmporium
28 10 Machine Learning Questions - ANSWERED!
10 Machine Learning Questions - ANSWERED!
CodeEmporium
29 How do neural networks work?
How do neural networks work?
CodeEmporium
30 Evolution of Face Generation |  Evolution of GANs
Evolution of Face Generation | Evolution of GANs
CodeEmporium
31 How does Google Translate's AI work?
How does Google Translate's AI work?
CodeEmporium
32 How to keep up with AI research?
How to keep up with AI research?
CodeEmporium
33 How does YouTube recommend videos? - AI EXPLAINED!
How does YouTube recommend videos? - AI EXPLAINED!
CodeEmporium
34 Variational Autoencoders - EXPLAINED!
Variational Autoencoders - EXPLAINED!
CodeEmporium
35 Logistic Regression - VISUALIZED!
Logistic Regression - VISUALIZED!
CodeEmporium
36 Gradient Descent - THE MATH YOU SHOULD KNOW
Gradient Descent - THE MATH YOU SHOULD KNOW
CodeEmporium
37 Boosting - EXPLAINED!
Boosting - EXPLAINED!
CodeEmporium
38 Transformer Neural Networks - EXPLAINED! (Attention is all you need)
Transformer Neural Networks - EXPLAINED! (Attention is all you need)
CodeEmporium
39 Loss Functions - EXPLAINED!
Loss Functions - EXPLAINED!
CodeEmporium
40 Optimizers - EXPLAINED!
Optimizers - EXPLAINED!
CodeEmporium
41 NLP with Neural Networks & Transformers
NLP with Neural Networks & Transformers
CodeEmporium
42 Batch Normalization - EXPLAINED!
Batch Normalization - EXPLAINED!
CodeEmporium
43 Activation Functions - EXPLAINED!
Activation Functions - EXPLAINED!
CodeEmporium
44 Data Scientist Answers Interview Questions
Data Scientist Answers Interview Questions
CodeEmporium
45 Why use GPU with Neural Networks?
Why use GPU with Neural Networks?
CodeEmporium
46 How do GPUs speed up Neural Network training?
How do GPUs speed up Neural Network training?
CodeEmporium
47 BERT Neural Network - EXPLAINED!
BERT Neural Network - EXPLAINED!
CodeEmporium
48 ConvNets Scaled Efficiently
ConvNets Scaled Efficiently
CodeEmporium
49 Transformer Neural Net makes music! (JukeboxAI)
Transformer Neural Net makes music! (JukeboxAI)
CodeEmporium
50 What do filters of Convolution Neural Network learn?
What do filters of Convolution Neural Network learn?
CodeEmporium
51 We're hosting a Machine Learning Conference!
We're hosting a Machine Learning Conference!
CodeEmporium
52 MLconfEU 2020: Machine Learning Conference for Software Engineers
MLconfEU 2020: Machine Learning Conference for Software Engineers
CodeEmporium
53 Are Neural Networks Intelligent?
Are Neural Networks Intelligent?
CodeEmporium
54 Time Series Forecasting with Machine Learning
Time Series Forecasting with Machine Learning
CodeEmporium
55 Few Shot Learning - EXPLAINED!
Few Shot Learning - EXPLAINED!
CodeEmporium
56 How does a Data Scientist Fight FRAUD?
How does a Data Scientist Fight FRAUD?
CodeEmporium
57 How would a Data Scientist analyze Customer Churn?
How would a Data Scientist analyze Customer Churn?
CodeEmporium
58 Expectations with Machine Learning
Expectations with Machine Learning
CodeEmporium
59 Why Logistic Regression DOESN'T return probabilities?!
Why Logistic Regression DOESN'T return probabilities?!
CodeEmporium
60 How you SHOULD code Machine Learning
How you SHOULD code Machine Learning
CodeEmporium

This video teaches how to train deep learning models on the cloud using Amazon EC2 and GPU acceleration, leveraging tools like TensorFlow and Jupyter Notebook. It covers creating an account, launching an instance, and executing a digit recognition model. By following these steps, viewers can speed up their model training and reduce costs.

Key Takeaways
  1. Create an account on Amazon Web Services
  2. Choose the developer account
  3. Search for EC2 in the console page
  4. Click on the limits link to view available instances and their capacities
  5. Launch an instance and configure it for training
  6. Change file permissions to 600
  7. Type secure shell command with port 8080
  8. Start environment with TensorFlow and GPU utility
  9. Open Jupyter notebook
  10. Execute digit recognition model for Emnes dataset
💡 Using GPU acceleration on the cloud can significantly speed up deep learning model training, making it a cost-effective and efficient alternative to traditional hardware-based training

Related Reads

📰
What Is an MCP Registry? (And the NxM Problem It Solves)
Learn about MCP registries and how they solve the NxM problem by providing a centralized catalog of MCP servers
Dev.to · Sahajmeet Kaur
📰
Built a suite of client-side dev tools to fix the "production data" privacy gap
Learn how to build client-side dev tools to address production data privacy gaps and improve development efficiency
Dev.to · Rayan Ahmad
📰
5 Best BrowserStack Alternatives to Optimize Your Testing Infrastructure
Discover the top 5 BrowserStack alternatives to optimize testing infrastructure for better execution speed, pricing, and test management
Medium · DevOps
📰
️ The Lifecycle Symphony: A Senior SRE’s Deep Dive into Init and Sidecar Containers
Learn how to optimize container initialization and sidecar containers for resilient multi-cloud platforms
Medium · DevOps
Up next
Containers on Amazon ECS with Mama J
AWS Developers
Watch →