This is a quick guide to starting v3 of the fast.ai course Practical Deep Learning for Coders using AWS SageMaker.
If you are returning to work and have previously completed the steps below, please go to the returning to work section.
We will use AWS CloudFormation to provision the SageMaker notebook lifecycle configuration and IAM role for the notebook instance. We will create the SageMaker notebook instance manually.
The instance we suggest, 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 limit request to use this instance or the ml.p3.2xlarge instance, here Instances must be stopped to end billing.
Getting Set Up
Creating the SageMaker Notebook Lifecycle Config and IAM role via CloudFormation
Visit the AWS webpage and click on ‘Sign In to the Console’. Next, enter your credentials if you are signing in or e-mail, account name and password if you need to sign up.
If you do not have an account, the button to press will say ‘Sign up’ instead of ‘Sign in to the Console’. If you are signing up you will also need to set your credit card details. This will be the credit card to which all the charges of the instance usage will be applied (if you have free credits you will not be charged until they are over). Note that you will also need to provide a phone number that will be called to verify your identity.
Once you have an account and are logged in we are ready to create the SageMaker Notebook Lifecycle Configuration and IAM role that will be both linked to the SageMaker Notebook Instance. Click the Launch Stack button 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 already loaded as per the screenshot below. Tick the option box to acknowledge that IAM resources will be created and then click the Create button to create the stack.
You will see the following CloudFormation page showing the stack is being created. Take note of the Notebook Lifecycle Config resource and IAM role created by CloudFormation. You will need these values when manually creating the SageMaker Notebook instance.
Once the stack reaches the CREATE_COMPLETE state then open the AWS web console and click Services in the top bar, and type ‘sagemaker’. You can then click Amazon SageMaker.
On the left navigation bar, choose Notebook instances. This is where we create, manage, and access our notebook instances.
Click Create notebook instance.
Enter fastai in the name, and in the instance type field enter ml.p2.xlarge or ml.p3.2xlarge and for volume size enter 50 GB. For the IAM role and Lifecycle Config copy the output values from the CloudFormation stack output. It should look something similar to the screenshot below.
Once it’s entered correctly, click Create notebook instance at the bottom of the screen.
You will receive a message that the instance is being created.
For around 5 minutes it will show as Pending and you will not be able to access it.
It will take around 10 minutes to fully setup your notebook instance with the fastai library. You will know when it is ready when the Jupyter kernel name Python 3 is available and a ‘course-v3’ folder appears in your Jupyter Notebook window.
Shutting down your instance
When you’re done, close the notebook tab, and remember to click stop! If you don’t, you’ll keep getting charged until you click the stop button.
To see how to open it again, update the course or the fastai library, go to the Returning to work page.
Troubleshooting installation problems
- If you do not receive a notifcation email after more than 15 minutes then there may have been a problem installing the fast.ai libraries and dependencies on your notebook instance. To troubleshoot, open the AWS console then click on the CloudWatch link (type cloudwatch in the search bar). Once you are in the CloudWatch console, navigate to Logs -> /aws/sagemaker/NotebookInstances -> fastai/LifecycleConfigOnStart or fastai/LifecycleConfigOnCreate to view the output of the installation scripts.
For questions or issues related to course content, we recommend posting in the fast.ai forum.