Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

AIM407-R

Amazon SageMaker and PyTorch:


Tips & tricks
Naz Levent
Data Scientist, Professional Services
Amazon Web Services

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
• Introductions

• Overview

• Hands-on demo

• Sagemaker tips & tricks

• Q&A

• Closing
Introductions
• Name
• Title and company
• Favorite thing you did on AWS
• Favorite thing you did with PyTorch
• Did you use Sagemaker before?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Session flow
• Start
Setup notebook
instance
environment • Clone repo

• Download
Get data COLA data
• Quick review

• Run custom
Training PyTorch job

Inference

Sagemaker
Tips & Tricks
PyTorch
“An open source deep-learning platform that provides a seamless path from prototype to production.”
Amazon SageMaker
Build, train, and deploy machine learning models quickly

Ground Truth Notebooks Training Inference


© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
+
PyTorch on Amazon SageMaker
AI Developers
Control

AWS Cloud

Notebook Hosting

Training & Tuning

AI Developers
Control

AWS Cloud

Notebook Hosting

SageMaker
Role

Training & Tuning


Data
encryption key

AI Developers
Control Data

AWS Cloud

Notebook Hosting

SageMaker
Role

Training & Tuning


Data
encryption key

AI Developers
Control Data Algorithms

AWS Cloud

Notebook Hosting

SageMaker
Role

Training & Tuning


Data
encryption key

AI Developers


PyTorch TensorFlow MXNet Chainer BYOA Amazon
Algorithms
Control Data Algorithms

AWS Cloud

Notebook Hosting

Jupyter SageMaker
Role

Notebook Instance Example notebooks

Training & Tuning


Data
encryption key

AI Developers


PyTorch TensorFlow MXNet Chainer BYOA Amazon
Algorithms
Control Data Algorithms

AWS Cloud

Notebook Hosting

Jupyter SageMaker
Role

Notebook Instance Example notebooks

Training & Tuning


Data
encryption key

AI Developers


PyTorch TensorFlow MXNet Chainer BYOA Amazon
Algorithms
Control Data Algorithms

AWS Cloud

Notebook Hosting

Jupyter SageMaker
Role

Notebook Instance Example notebooks

Training & Tuning


Data
encryption key

AI Developers


PyTorch TensorFlow MXNet Chainer BYOA Amazon
Algorithms
Control Data Algorithms

AWS Cloud

Notebook Hosting

Jupyter SageMaker
Role

Notebook Instance Example notebooks

Training & Tuning


Data
encryption key

AI Developers


PyTorch TensorFlow MXNet Chainer BYOA Amazon
Algorithms
Control Data Algorithms

AWS Cloud

Notebook Hosting

Jupyter SageMaker
Role

Notebook Instance Example notebooks

Training & Tuning


Data
encryption key
Algorithm

SageMaker Python SDK

PyTorch 1.0 + libs


AI Developers

Distributed Cuda92
ing
Stream

Data Log Metrics


PyTorch TensorFlow MXNet Chainer BYOA Amazon
Algorithms
Summary – 6 main tips:
1. Store your data in S3 instead of Sagemaker instance. (stream data for
very large datasets)
2. Separate your notebook, train and deploy instance types in code.
(optimize your billing period)
3. Use Sagemaker’s PyTorch library for training.
4. Use Lifecyle Configurations to never worry about an open notebook.
5. Deploy your model from Sagemaker as an endpoint.
6. Use Sagemaker’s hyperparameter optimization.
Questions?
Resources

• https://github.com/pytorch/pytorch
• https://sagemaker.readthedocs.io/en/stable/using_pytorch.html
• https://github.com/aws/sagemaker-pytorch-container
• https://aws.amazon.com/sagemaker/pricing/instance-
types/
• https://docs.aws.amazon.com/sagemaker/latest/dg/how-
it-works-hosting.html#how-it-works-hosting-related-
considerations
Learn ML with AWS Training and Certification
The same training that our own developers use, now available on demand

Role-based ML learning paths for developers, data scientists, data


platform engineers, and business decision makers

70+ free digital ML courses from AWS experts let you learn from
real-world challenges tackled at AWS

Validate expertise with the


AWS Certified Machine Learning - Specialty exam

Visit https://aws.training/machinelearning

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

You might also like