Feb 24, 2019
Jupyter is considered to be the best framework for data scientists to process and develop machine learning models. One of the leading free deep learning courses, Fast AI extensively uses Jupyter Notebooks for teaching material. However, the cost of running a notebook with connected GPU is expensive on the cloud. This tutorial gives a brief overview how to run Jupyter Lab on Snark platform using spot instance to drive the cost 3x down.
Spot instances are three times cheaper, however they can be interrupted anytime. Snark manages the interruption by storing the data in a persistent storage and restarting the machine.
Everything in this tutorial can be completed using the Web UI with one-click jupyter.
Assuming you already registered at the Lab authenticate yourself in the terminal.
> pip install snark > snark login
Make sure your package is updated.
version: 1 experiments: jupyter: framework: jupyter hardware: gpu: k80 spot: True command: - lab
and run snark up
> snark up -f jupyter.yaml
There are few interesting things happening here
k80($0.3/h) GPU. You could alternatively request
v100($1/h) or add more gpus with
It will take couple minutes to warm up the instance. In order to open the Jupyter Lab we need get the public IP and the access token.
> snark ps exp_id
exp_id is the id of the experiment shown after running command up. Alternatively you could run
snark ps to get the
exp_id and the corresponding ip.
Then, please take task_id from the above command to get the logs of running experiment.
> snark logs task_id
You can copy the link of the jupyter lab and replace
(... or 127.0.0.1) with the real ip of the docker and open in the browser. The link will look like
Once you are done with the experiment shut down the instance to save money.
> snark down exp_id
You can restart anytime and the stored data will appear in the same place.
We also prepared Fast AI course for you to get started instantly. Simply use the following recipe.
version: 1 experiments: fastai: framework: fastai hardware: gpu: k80 spot: true command: - run
You will notice that
fastai folder is created in your storage where your work can be saved eternally.
By default, Fast AI package downloads the training data to
/home/ubuntu folder. In order to save training data, you could alter the location to store inside
Instead of paying $0.9 for running K80 GPUs, using Snark platform you could save 3x on cloud costs. In case of interrupts your data will be kept safe inside a persistent storage. Enjoy running Jupyter Lab and learning deep learning using Fast AI course.