If you're not familiar with Google Colab, it basically lets you run Python and other languages,
if you get creative, in the cloud in a virtual machine that gives you access to a GPU, as well.
So you can run python in Jupyter notebooks, again other environments if you get creative,
and experience your code on potentially a more powerful machine than what your local
instance would be. If you're running a Mac, this is particularly useful because you can use a GPU
that's actually compatible with things like Keras and TensorFlow, whereas macs currently don't have
NVIDIA GPUs and and probably won't in the future because they're going more their own internal
direction with the new M1. Which is getting some support but, that's another topic so what I want
to talk to you about in this video is, and this is going to be a quick video, is ColabPro, where you
pay extra money, worth it in first quarter 2021, and I put the date in here because this changes
rapidly with Colab, as google puts more and more features into this. So let's take a look!
Oh and if you could possibly like this video, that really helps with the YouTube algorithm, and if
you want to see more of this kind of things please subscribe. So let's jump right into it, first of
all is CoLabPro even available in your region? I have listed the regions here. So they've improved
this a lot. It used to be just United States and Canada, which was unfortunate for the rest of the
world. Most of the subscribers and people watching my channel seem to be first from the United States
with India a very very close second, maybe even overtaking! Definitely go India!! So let's get in
to the side by side comparison. I wrote a notebook here that you can compare the non-pro version
versus the pro version and the difference is nine dollars a month. So I think it's very much worth
the $9.99 (USD) a month that they're charging US dollars. I am a subscriber of this and have been
really since it first came out. You can look at the notebook that I have here. I'll have it linked
in the description to this video so you can take a look and see where I actually got the data from.
Let's look at the data a little more friendly of a format. Here you can see the two really side by
side CoLab standard and Pro. They both have the same CPU on it it's a 2.2 GHz. Now this is Xenon,
so these tend to not be as super fast because their data center. Heat is everything there. Both
have two cores but the GPU that you get on these, now if you're watching this video in the future,
this changes. I remember when this used to be primarily K80 on standard now
we see a lot more T4s. I have not seen a k80 in a while and that's great because the T4s are faster.
Collab Pro, what I'm currently seeing in first quarter of 2021, is usually I get a V100 sometimes
I get a P100. I'm not really sure how this works in terms of when you get what. Like say for
example I train GANs for a couple of days. Are they going to punish me and give me p100s in in
the future? I don't know exactly how. GPU memory you're going to have 16 on the T4 so both of these
are right at about 16 gigabytes and 12 on the L80 this is really the sweet spot of what you want for
space on your actual GPU. You can do a lot with this and if you're running, if you're hitting the
ceiling adjust your batch size that's usually the best way to deal with this. System RAM is quite
different. Now you have to request the system ram in the Colab Pro environment or you won't
you won't get it and don't just request it for the heck of it. They detect if you're using their GPU
or if you're using your system RAM or not and they they warn you about it and say hey you're you're
being wasteful so you want very much to make sure that you're using that efficiently is in theory
the the google AI watchers might might throttle you. This is important the virtual machine
lifespan 12 hours on standard and I routinely run these full 24 hours now you have to do something
so that they don't actually toss you out because they think you're no longer interacting with the
system and we'll see that in just a second, but for me the the V100 alone cinches this that it's
it's worth it if you're going to be training GANs and my next video is going to be on training GANs
on Colab, so definitely take take a look at that. Subscribe so you don't miss it,
and this little bit of code here I'll put this in the description. You can find this
all over reddit and StackOverflow, but this basically shows you this is JavaScript that you
put right in to the console. I'll show you that in a moment and you it's not going to time out
on you it will hit that 24-hour thing and it'll it'll knock you off, but that is just the way that
works. When you do hit that ceiling, you're going to see something like this. And you can also see
all this stuff going on here a lot of the yellow is just the normal vomit that JavaScript throws
at you while it's running. I have never seen JavaScript on a website not just throw
all kinds of warnings, it's it's JavaScript, it's the cockroach that survived the language wars of
the web. But JavaScript is great the web has ran on it but what you'll see here is these connect
push that's my that's my script basically running and keeping this thing active ultimately when you
hit the 24 hours you will see this or if you hit the 12 hours. If you're not paying for Colab Pro,
this is a great product as well on Pro or Non-Pro and I'll do a little benchmarking between the two,
because I'm doing a video soon on how to train GANs on these and I do want to show you
the this tremendous speed boost that you get for that v100 that NVIDIA has and Google... if you
ever want to add A100s to this this, this would be great I'm sure they will at some point but
I have no idea when that will when that will happen, and then a few of the restrictions
just to mention on this. The biggest one is you cannot sublet. So you can't go in on this with
your friend and both of you share it, uh kind of like Netflix. And all of these ,it's it's hard
for them to police that. But probably don't do that so basically the first the first three of
these almost are all, so basically these can be summarized as don't mine cryptocurrency,
don't use it to distribute software, and don't share your account with other people. Now,
I will say some of the limitations that I find with this. First of all the 24 hour thing is just
a pain to me, I have to restart that manually. I'll show you how you can deal with that in
the next video on how to train StyleGAN on this. For a business situation, or for some of the the
research projects that I've worked on, that I just I just don't want to deal with that, I'll buy my
own GPU and deal with it or I'll run it in the cloud. Now in the cloud this is very similar to
what you have to deal with around spot instances in Amazon, which can let you get basically a 70%
discount on this. If you if you want to see a video on spot instances definitely tell me,
I'd be glad to to do that and by the way, no you can't earn a profit on cryptocurrency with spot,
and the day that you could earn a profit on cryptocurrency with AWS would be the day that
AWS basically gets DDOSed into the ground by by Cryptominers. Other limitation that I will say
and again this gets to research and some of the business projects that I work on, you are at the
whim of google in terms of what software is installed. So, you if you want to run
software that Google doesn't have, you have to uninstall others and reinstall and it's
just hard to have reproducible research in Colab, because if you can't just capture a Docker image
or a requirements.txt or something like that and truly capture what your what your code
was running. So that's that's definitely another complaint that I have also you've whatever machine
is running this you've got to have that machine up and running because if you just close your laptop
it's gonna it's gonna time out if you're going to take your laptop and go from home to StarBucks,
one day COVID will be over and I can do that again but you will you're gonna lose your connection,
whereas if you're running this in the cloud or at home I can remote connect into my machine
or I can run it on the cloud. So it's not as professional as what you're going to see
using the cloud or using your own GPU, but to get started you you just can't beat this,
and I have advanced GPUs and I use the I use the cloud and I still make use of Colab
because for quick POC this is great and I don't necessarily want to interrupt my my
home GPU from whatever it's currently working on. So, if you're not familiar with Jupiter notebooks
this this is what Colab actually looks like, and just to see
how I train GANs in it. I'll put a more finalized version of it but this is basically what I what
I do to give you an idea of how I deal with the timeouts and things like that I mount my GDrive
and this is the only control that they give you as far as what versions of things that you're running
and I'm not even using TensorFlow, so I don't even know why I have this here. This is actually using
PyTorch, but you mount your GDrive and then I am basically going to install whatever I want
to run in this case it's StyleGAN ADA PyTorch and then I'm going to run these commands,
because basically, I want to run actual python .py files not Jupyter notebooks, so I will run this
in this case I'm converting images and you you basically run all your commands like this you get
the output saved here. But the important thing is I am using my GDrive to do all the check pointing
and storing my intermediate forms of this that way when inevitably this thing shuts me down.
Which you can see here here is training training training moving happily along notice we're at like
20 hours here and then bam it's dead. Here was my last checkpoint so that saved it to my GDrive and
I can go retrieve the pickle file and continue so long as your software is designed to do that and
then these ticks that continued they were wasted because they were ran on Colab but they were never
checkpointed it didn't it didn't get it so this is a issue with setting your your checkpoint size.
Thank you for watching this video and if you found this interesting you want to see more about CoLab,
I use it extensively in my YouTube videos because I want to make sure everything that
I put out there is compatible with CoLab because pretty much everything I do uses an NVIDIA GPU
and this is a way. If you don't have that kind of processing power on your actual
computer to be able to make use of what I put on the channel so please subscribe
to my channel and think about giving this video a like thank you very much.