Youcan create notebook instances with different instance types (say, ml.t2.medium or ml.p3.2xlarge) and use a set of kernels that have been setup for you. These are conda (Anaconda) environments exposed as Jupyter notebook kernels that execute the commands you write on the Python notebook.
You can create a lifecycle configuration on SageMaker that will run this initial environment creation setup every time you create a new notebook instance. (You create a new Lifecycle Configuration and paste the following code inside of the Create Notebook tab.)
That way you won't have to setup each new notebook instance you create. You'll just have to pick the lifecycle you just created. Take a look at Amazon SageMaker notebook instance Lifecycle Configuration samples.
This is a quick guide to starting v4 of the
fast.ai course Practical Deep Learning for Coders using Amazon SageMaker. It assumes you already have an AWS account setup. If you do not then follow the instructions here to create and activate your AWS account.
We will use AWS CloudFormation to provision all of the SageMaker resources including the Notebook instance, Notebook Lifecyle configuration and IAM role. By default it will provision a SageMaker notebook instance of type ml.p2.xlarge which has the Nvidia K80 GPU and 50 GB of EBS disk space.
The default instance type, ml.p2.xlarge, is $1.26 an hour. The hourly rate is dependent on the instance type selected, see all available types here. You will need to explicitely request a service limit increase to use ml.p2.xlarge or the ml.p3.2xlarge instance, here. Select limit type SageMaker and in the request select the region you want to work in, SageMaker Notebooks & the instance type you are planning to use. Select a new limit value of 1, add a description and submit on the bottom right of the page. Instances must be stopped to end billing.
We will create a SageMaker Notebook Instance providing us the Jupyter notebook to run the course exercises by using AWS CloudFormation. To launch the CloudFormation stack click the Launch Stack link for the closest region to where you live in the table below.
This will open the AWS CloudFormation web console with the template to create the AWS resources as per the screenshot below. Take a look at the input parameters and either accept the defaults or update them as necessary. Select the option box I acknowledge that AWS CloudFormation might create IAM resources. and then click the Create button to create the stack.
On the left navigation bar, choose Notebook instances. This is where we create, manage, and access our notebook instances. You should see that your notebook instance named fastai-v4 status has the status InService as per the screenshot below.
The first time you open any of the notebooks you will be asked to select the Jupyter kernel. Select the kernel named fastai in the drop down selection like the screenshot below and click the Set Kernel button.
If you do not see the option fastai, then the libraries and dependencies have not yet finished installing. Wait up to 10 min for this to complete, refresh the page and try to select the fastai kernel.
When you want to go back to the notebook exercises just select your notebook instance you can select the action Start, wait a few min and pick up where you left off. It will take less time to setup as the fastai libraries have already been installed and the notebooks will be saved.
3a8082e126