YUFENG GUO: Previously on AI Adventures,
we looked at Colab as a great way
to get started in the data science and machine learning
world.
But there are some models out there
that need to run for a long time or you want
to get more memory or GPUs.
How can we hook up Colab with some more compute power?
Stay tuned to find out.
Welcome to AI Adventures, where we explore the art, science,
and tools of machine learning.
My name is Yufeng Guo, and on this episode,
we're going to use Google Cloud Platform's deep learning
VMs to power your Colab environment.
A few episodes ago, we looked at how
to create deep learning VMs with your choice of machine learning
frameworks.
Today, we'll use that VM and connect Colab to it
so we can utilize the resources on that machine.
To start out, we'll of course need to make our VM.
And let's make it a big one.
Head on over to the Cloud Marketplace,
and we'll find the deep learning VM and select it.
OK.
Now, to select our parameters.
Let's give it a name.
Say colab-box.
And for good measure, we'll do 8--
no, 16 CPUs, and how about 60 gigs of memory?
And now for the GPUs.
Let's choose the V100s.
And we'll have two of them.
Yeah.
Now we're really cooking.
While we're waiting for that to spin up,
let's talk a bit about how we're going to get
Colab to talk to your VM.
There are two tricks that we're going to use,
which together make this connection possible.
The first is that Colab can actually
connect to any local runtime.
So if you have a local Jupyter Notebook Server running,
say on your laptop, you can use Colab
if you want as your front end to that server rather
than the usual Jupyter Notebook front end.
And you can access that in the upper right-hand menu of Colab.
The second trick that we'll take advantage
of is that you can do port forwarding on the deep learning
VM we just created so that it can be accessed
from your local machine.
You can do that with the command shown here.
And be sure to run it from your actual local terminal
on your machine and not in, say, Cloud Shell.
In this particular situation, since we wish to port forward
to our local machine actually, running the command
in Cloud Shell doesn't really achieve our goals.
We don't need a port forward to the Cloud Shell.
Typically, having this port forwarding setup
would just mean that we can access the Jupyter
Server from a local front end.
But if we open up Colab and tell it
to connect to our local runtime, that local runtime
will, in fact, be the port forwarded one
from deep learning VM.
And thus, the two become connected.
So now when you hook the two together,
we can see that, yes indeed, we have our two V100
GPUs running and accessible from our Colab front end.
So now you understand how Colab and deep learning VMs
can work together and how to get your setup just so, based
on how your needs are changing, both in terms of what
the front end looks like and what
back-end system is driving it.
For example, you can develop against a local back end
initially, and then when you want to get more power,
move up to the deep learning VM.
So how do you set up your data science environment,
and how do you allow it to change, flex,
and grow as needed?
Let me know in the comments below.
Thanks for watching this episode of Cloud AI Adventures.
And if you enjoyed it, be sure to like
and subscribe to get all the latest episodes right
when they come out.
For now, head over to the Deep Learning VMs
and try connecting it with your Colab Notebook.
[MUSIC PLAYING]