More Related Content Similar to Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chicago AWS Summit (20) More from Amazon Web Services (20) Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chicago AWS Summit1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kumar Venkateswar
Sr. Product Manager, Amazon SageMaker, Amazon Web Services
BDA301
Accelerate Machine Learning with Ease
Using Amazon SageMaker
2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Solving Some of the Hardest Problems in Computer Science
Learning Language Perception Problem
Solving
Reasoning
3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Machine Learning at Amazon: A Long Heritage
Personalized
Recommendations
Fulfillment Automation
& Inventory Management
Drones Voice-driven
Interactions
Inventing Entirely New
Customer Experiences
4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tens of thousands of customers running Machine Learning on AWS
5. ML @ AWS
OUR MISSION
Put machine learning in the
hands of every developer and
data scientist
6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
FRAMEWORKS
KERAS
PLATFORMS
APPLICATION SERVICES
A M A Z O N
R E K O G N I T I O N
A M A Z O N R E K O G N I T I O N
V I D E O
A M A Z O N
P O L L Y
A M A Z O N
T R A N S C R I B E
A M A Z O N
T R A N S L A T E
A M A Z O N
C O M P R E H E N D
A M A Z O N
L E X
Amazon SageMaker Amazon Mechanical Turk
The AWS Machine Learning Stack
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
K E R A S
F R A M E W O R K S A N D I N T E R F A C E S
F r a m e w o r k s I n t e r f a c e s
Complete Control over Frameworks & Infrastructure
For the data scientist, AI researcher, or advanced ML practitioner
8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
K E R A S
F R A M E W O R K S A N D I N T E R F A C E S
F r a m e w o r k s I n t e r f a c e s
NVIDIA
Tesla V100 GPUs
(14x faster than P2)
P3
Machine Learning
AMIs
5,120 Tensor cores
128 GB of memory
1 Petaflop of compute
NVLink 2.0
I N F R A S T R U C T U R E ( G P U )
Complete Control over Frameworks & Infrastructure
For the data scientist, AI researcher, or advanced ML practitioner
9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
K E R A S
F R A M E W O R K S A N D I N T E R F A C E S
F r a m e w o r k s I n t e r f a c e s
NVIDIA
Tesla V100 GPUs
(14x faster than P2)
P3
Machine Learning
AMIs
5,120 Tensor cores
128 GB of memory
1 Petaflop of compute
NVLink 2.0
I N F R A S T R U C T U R E ( G P U )
Complete Control over Frameworks & Infrastructure
For the data scientist, AI researcher, or advanced ML practitioner
Intel Xeon
3.0 GHz Skylake CPU
(25% better perf/price than C4)
Machine Learning
AMIs
72 vCPUs
144 GB of memory
AVX 512
Nitro Hypervisor
I N F R A S T R U C T U R E ( C P U )
C5
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Machine Learning Process – Review
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
The Machine Learning Process
Re-training
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
Discovery: The Analysts
Re-training
• Help formulate the right
questions
• Domain Knowledge
13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data Visualization &
Analysis
Business Problem –
ML problem framing Data Collection
Data Integration
Data Preparation &
Cleaning
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
Are Business
Goals met?
Model Deployment
Monitoring &
Debugging
– Predictions
YesNo
DataAugmentation
Feature
Augmentation
Integration: The Data Architecture
Retraining
• Build the data platform:
• Amazon S3
• AWS Glue
• Amazon Athena
• Amazon EMR
• Amazon Redshift
Spectrum
14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data Visualization &
Analysis
Feature Engineering
Model Training &
Parameter Tuning
Model Evaluation
• Set up and manage notebook
environments
• Set up and manage training
clusters
• Write data connectors
• Scale ml algorithms to large
datasets
• Distribute ml training
algorithm to multiple
machines
• Secure model artifacts
Why We built Amazon SageMaker: The Model Training Undifferentiated Heavy Lifting
15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
BUI LD
Where should you spend your time?
Design training experiments
16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
BUI LD T R AI N
Where should you spend your time?
Run scalable training
17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
BUI LD T R AI N D EPLOY
Where should you spend your time?
T UN E
Deploy and operate
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pre-built
notebooks for
common problems
Built-in, high
performance
algorithms
T R AI N D EPLOY
BUILD
Build, train, tune, and host your own models
T UN E
Amazon SageMaker
19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pre-built
notebooks for
common problems
Built-in, high-
performance
algorithms
One-click
training
Hyperparameter
Tuning
D EPLOY
BUILD T RAIN & T UNE
Build, train, tune, and host your own models
Amazon SageMaker
20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fully managed
hosting with Auto
Scaling
One-click
deployment
Pre-built
notebooks for
common problems
Built-in, high-
performance
algorithms
One-click
training
BUILD T RAIN & T UNE D EPLOY
Build, train, tune, and host your own models
Hyperparameter
optimization
Amazon SageMaker
21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fully managed
hosting with auto-
scaling
One-click
deployment
Pre-built
notebooks for
common problems
Built-in, high
performance
algorithms
One-click
training
BUILD T RAIN & T UNE D EPLOY
Build, train, tune, and host your own models
End-to-end encryption with KMS
End-to-end VPC support
Compliance and audit capabilities
Metadata and experiment management capabilities
Pay as you go
Amazon SageMaker
Hyperparameter
optimization
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker Training Demo
23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker
Built-in Algorithms
Deep Learning
Frameworks
MXNet & Gluon
Tensorflow
PyTorch
Chainer
Custom / Docker
Training (single or
distributed cluster)
Data
Amazon SageMaker: Algorithm and Framework Support
24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Remove undifferentiated
heavy lifting of ML
Iterate, iterate,
iterate!
Training speed Inference speed
Speed in all phases
Amazon SageMaker
25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Enabling experimentation speed
Tr a i n w i t h
l o c a l n o t e b o o k s
Train on notebook
instances
PetaFLOP
training on p3.16xl
Go distributed
with one line of code
Same containers
Amazon SageMaker Local Mode
26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hyperparameter Optimizer
Amazon SageMaker Automatic Model Tuning
Neural Networks
Number of layers
Hidden layer width
Learning rate
Embedding
dimensions
Dropout
…
Decision Trees
Tree depth
Max leaf nodes
Gamma
Eta
Lambda
Alpha
…
…
“Hyperparameters”
(algorithm parameters that significantly affect model quality)
27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hyperparameter Optimization
Amazon SageMaker Automatic Model Tuning
Training JobHyperparameter
Tuning Job
Tuning algorithm
Objective
metrics
Training Job
Training Job
Training Job
Clients
(console, notebook, IDEs, CLI)
model name
model1
model2
…
objective
metric
08
0.75
…
eta
0.07
0.09
…
max_depth
6
5
…
…
28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
from sagemaker.tuner import IntegerParameter, CategoricalParameter, ContinuousParameter, HyperparameterTuner
hyperparameter_ranges = {
'batch_size': CategoricalParameter([16, 32, 64, 128]),
'learning_rate': ContinuousParameter(0.0009, 0.01),
'epochs': IntegerParameter(10, 100)}
objective_metric_name = 'Validation-accuracy'
metric_definitions = [{'Name': 'Validation-accuracy',
'Regex': 'Validation-accuracy=([0-9.]+)’}]
tuner = HyperparameterTuner(estimator,
objective_metric_name,
hyperparameter_ranges,
metric_definitions,
max_jobs=20,
max_parallel_jobs=4)
tuner.fit(dataset_location, job_name=job_name)
Amazon SageMaker Automatic Model Tuning
29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Customer Success with Amazon SageMaker
30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker: Launch Customer
“With Amazon SageMaker, we can accelerate our Artificial
Intelligence initiatives at scale by building and deploying our
algorithms on the platform. We will create novel large-scale machine
learning and AI algorithms and deploy them on this platform to solve
complex problems that can power prosperity for our customers.
”
– Ashok Srivastava, Chief Data Officer, Intuit
31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Model Hosting
(SageMaker)
Near real-time fraud detection in AWS using SageMaker
Calculate
Features
Reader
Cleanser
Processor
Data
Lookup
Training
Feature Store Model Training
(SageMaker)
Model
Client Service
Amazon
EMR
Amazon
SageMaker
Amazon
SageMaker
32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Advantages of Amazon SageMaker
33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1
I
Notebook Instances
Zero Setup for Exploratory Data Analysis
Authoring &
Notebooks
ETL Access to AWS
Database services
Access to Amazon S3
data lake
• Recommendations / personalization
• Fraud detection
• Forecasting
• Image classification
• Churn prediction
• Marketing email / campaign targeting
• Log processing and anomaly detection
• Speech to text
• More…
“Just add data”
VPC
34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2
I
Algorithms
Training code
• Matrix Factorization
• Regression
• Principal Component Analysis
• K-Means Clustering
• Gradient Boosted Trees
• And more!
Amazon-provided Algorithms
Bring Your Own Script (SM builds the Container)
SM Estimators in
Apache Spark Bring Your Own Algorithm (You build the Container)
Amazon SageMaker: 10x Better Algorithms
35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Managed Distributed Training with Flexibility
Training code
• Matrix Factorization
• Regression
• Principal Component Analysis
• K-Means Clustering
• Gradient Boosted Trees
• And more!
Amazon-provided Algorithms
Bring Your Own Script (SM builds the Container)
Bring Your Own Algorithm (You build the Container)
3
I
ML Training Service
Fetch Training data
Save Model Artifacts
Fully
managed –
VPC–
Amazon ECR
Save Inference Image
SM Estimators in
Apache Spark
CPU GPU Hyperparameter Tuning
36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
Versions of the same
inference code saved in
inference containers.
Prod is the primary one,
50% of the traffic must be
served there!
37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
Model Artifacts
Inference Image
Versions of the same
inference code saved in
inference containers.
Prod is the primary one,
50% of the traffic must be
served there!
Create a Model
ModelName: prod
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
InstanceType: c3.4xlarge
InitialInstanceCount: 3
maxInstanceCount: 10
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary one,
50% of the traffic must be
served there!
Create weighted
ProductionVariants
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary one,
50% of the traffic must be
served there!
A/B Testing Models
Create an
EndpointConfiguration from
one or many
ProductionVariant(s)
EndpointConfiguration
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
InstanceType: c3.4xlarge
InitialInstanceCount: 3
maxInstanceCount: 10
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
I
ML Hosting Service
Amazon ECR
30 50
10 10
ProductionVariant
Model Artifacts
Inference Image
Model versions
Versions of the same
inference code saved in
inference containers.
Prod is the primary one,
50% of the traffic must be
served there!
One-Click!
EndpointConfiguration
Inference Endpoint
Amazon-Provided Algorithms
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
InstanceType: c3.4xlarge
InitialInstanceCount: 3
maxInstanceCount: 10
ModelName: prod
VariantName: primary
InitialVariantWeight: 50
41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4
I
ML Hosting Service
✓ Auto Scaling Inference APIs
✓ A/B Testing
✓ Low Latency & High
Throughput
✓ Bring Your Own Model
✓ Python SDK
Amazon SageMaker
Easy Model Deployment to Amazon SageMaker
42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker Keeps Getting Better!
Recent launches include:
• New deep learning frameworks (Chainer and PyTorch)
• More security and compliance features
• Expansion around the world – Tokyo, Seoul, Frankfurt, Sydney
• Automatic model tuning
• Local mode w/ GPU in Amazon SageMaker notebooks
• Algorithm Enhancements: DeepAR, BlazingText, Linear Learner
• Tensorflow Pipe-Mode
• Batch Transform
43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SageMaker
Notebooks
Training
Algorithm
SageMaker
Training
Amazon ECR
Code Commit
Code Pipeline
SageMaker
Hosting
Coco dataset
AWS
Lambda
API
Gateway
Amazon SageMaker Sample End-to-End Architecture: Style Transfer
Build
Train
Deploy
Static website hosted on Amazon S3
Inference requests
Amazon S3
Amazon
CloudFront
Web assets on
CloudFront
End-to-end encryption with AWS
KMS
Disable internet
access
End-to-end VPC support
Private link
44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data Lake Storage
Amazon S3
Security
Access control
Encryption
VPC
KMS
Auditing
Compliance
Roles
Fine-grained access controls
Compute
Powerful GPU & CPU Instances
AWS Lambda
Analytics
Amazon Athena
Amazon EMR
Amazon Redshift & Amazon Redshift Spectrum
Broadest & Easiest to Use ML Platform with the
Most Customers
45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Tap the Schedule icon.
2. Select the session you attended.
3. Tap Session Evaluation to submit your
feedback.
Submit Session Feedback
46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Useful SageMaker Resources
https://github.com/awslabs/amazon-sagemaker-examples
https://github.com/aws-samples/aws-ml-vision-end2end
https://github.com/juliensimon
https://docs.aws.amazon.com/sagemaker/latest/dg/whatis.html
https://github.com/aws/sagemaker-spark
Thank you!