SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Building Your Own ML Application with
AWS Lambda & Amazon SageMaker
S R V 4 0 4
Diego Natali
Solutions Architect
Amazon Web Services EMEA
Giuseppe Angelo Porcelli
Sr. Solutions Architect
Amazon Web Services EMEA
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Repeats
Wednesday, 28
SRV404
Building Your Own ML Application with AWS Lambda & Amazon SageMaker
12:15 – PM | Bellagio, Level 1, Grand Ballroom 9
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
THE MACHINE LEARNING PROCESS
Business Problem -
ML problem
framing
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
THE MACHINE LEARNING PROCESS
Business Problem -
ML problem
framing
Data Collection
Data Integration
Data Preparation &
Cleaning
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
THE MACHINE LEARNING PROCESS
Data Visualization
& Analysis
Business Problem -
ML problem
framing
Data Collection
Data Integration
Data Preparation &
Cleaning
Feature
Engineering
Model Training &
Parameter Tuning
Model Evaluation
Experiment, Train, Tune and Evaluate
• Setup and manage Notebook
Environments
• Setup and manage Training Clusters
• Write Data Connectors
• Scale ML algorithms to large datasets
• Distribute ML training algorithm to
multiple machines
• Secure Model artifacts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
THE MACHINE LEARNING PROCESS
Data Visualization
& Analysis
Business Problem -
ML problem
framing
Data Collection
Data Integration
Data Preparation &
Cleaning
Feature
Engineering
Are
Business
goals met?
Monitoring &
Debugging
- Predictions
Yes
Re-training
Model Training &
Parameter Tuning
Model Evaluation Model Deployment
Deploy, Monitor and Debug
• Setup and manage Model Inference
Clusters
• Manage and Auto-Scale Model
Inference APIs
• Monitor and Debug Model Predictions
• Models versioning and performance
tracking
• Automate New Model version
promotion to production (A/B testing)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
THE MACHINE LEARNING PROCESS
Data Visualization
& Analysis
Business Problem -
ML problem
framing
Data Collection
Data Integration
Data Preparation &
Cleaning
Feature
Engineering
Are
Business
goals met?
Monitoring &
Debugging
- Predictions
YesNo
DataAugmentation
Feature
Augmentation
Re-training
Model Training &
Parameter Tuning
Model Evaluation Model Deployment
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WHERE SHOULD WE SPEND TIME?
BUI L D T R AI N D E P L O Y
T U NE
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AMAZON SAGEMAKER
End-to-end encryption with KMS
End-to-end VPC support
Compliance and audit capabilities
Metadata and experiment management capabilities
Pay as you go
Fully managed
hosting with auto-
scaling
One-click
deployment
Pre-built
notebooks for
common problems
Built-in, high
performance
algorithms
One-click
training
BUI L D T R AI N & T UNE D E P L O Y
Hyperparameter
optimization
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EXECUTING INFERENCES
Amazon SageMaker Deployment AWS Lambda
Real-time Sync Use managed real-time inference cluster On-demand request-based model
Real-time Async
Use Amazon Kinesis and AWS Lambda to
invoke the real-time inference endpoint
Use Amazon Kinesis and AWS Lambda to
host the model and execute inferences in
Lambda
Batch Use batch transform Need to implement batch processing
Edge (GreenGrass)
Use built-in AWS Greengrass model
hosting
Deploy a Lambda function on AWS
Greengrass to execute inferences
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
USING AWS LAMBDA
PROS
Develop Modern Applications serverless
Charged per request and execution duration
Effortless, limitless scalability, high availability, fault tolerance,
etc.
Lower the cost of inferences
No infrastructure to maintain
1 million free executions
Event-based model
Example: 100M requests for about $54/month
CONS
GPU not yet available
512 MB /tmp limit
250 MB limit for uncompressed size of code/dependencies
Need to create your deployment package and pipeline to
automate the process
Cold start (~5s TF, ~2s MXNet)
Infrastructure to mantain if not using Amazon SageMaker for
training
Need to include and manage all dependencies
Need to create your own API for serving
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AMAZON SAGEMAKER vs AWS LAMBDA
Amazon SageMaker Deployment AWS Lambda
Workload
Well suited for constant and predictable
workloads, with regular and frequent traffic
Well suited for variable or unpredictable
workloads, with intermittent and spiky traffic
Scaling
Configure auto-scaling on the real-time
endpoint
Automatic scaling
Hardware GPU and CPU instances CPU only
Model architecture Any complexity [CNNs, RNNs, etc.] Simple models
A/B Testing Yes Yes
Deployment Fast, one-click deployment
Need to build package and create inference API
from scratch
Monitoring and Debugging Amazon CloudWatch / CloudWatch Logs Amazon CloudWatch / CloudWatch Logs
IT’S A MATTER OF CHOICE
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
THE DATASET
SMS Spam Collection Data Set
• A public set of 5574 SMS labeled messages that have been collected for mobile phone spam
research
• 747 SPAM, 4827 non SPAM
https://archive.ics.uci.edu/ml/datasets/sms+spam+collection
ham Go until jurong point, crazy.. Available only in bugis n great world la e buffet... Cine there
got amore wat...
ham Ok lar... Joking wif u oni...
spam Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive
entry question(std txt rate)T&C's apply 08452810075over18’s
ham U dun say so early hor... U c already then say...
ham Nah I don't think he goes to usf, he lives around here though
spam FreeMsg Hey there darling it's been 3 week's now and no word back! I'd like some fun you up for
it still? Tb ok! XxX std chgs to send, £1.50 to rcv
ham Even my brother is not like to speak with me. They treat me like aids patent.
ham As per your request 'Melle Melle (Oru Minnaminunginte Nurungu Vettam)' has been set as your
callertune for all Callers. Press *9 to copy your friends Callertune
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WORKFLOW
BUI L D T R AI N & T UNE D E P L O Y
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
TRAINING THE MODEL
SMS Spam
Training Data
SMS Spam
model artifacts
Amazon SageMaker
Training
Amazon ECR
Training Script
SageMaker MXNet
container
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DEPLOYING TO LAMBDA
Get model artifacts from S3
Run an Amazon Linux EC2
Instance or Cloud9
environment
Download pre-built MXNet
Lambda packages from
GitHub in a folder
Write Lambda handler,
package and save Lambda
deployment package to S3
Copy model artifacts in the
folder
https://docs.aws.amazon.com/sagemaker/latest/dg/API_ModelArtifacts.html
https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
https://github.com/diegonat/smwshop/
https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-
how-to-create-deployment-package.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AUTOMATING DEPLOYMENT
AWS
CodePipeline
bucket
with
objects
event
(event-
based)
AWS
CloudTrail
Lambda
function
bucket
with
objects
event
(event-
based)
AWS
CloudTrail
Amazon
SageMaker
AWS
CodeBuild
template
stack
change set
bucket
with
objects
Amazon API
Gateway*
Lambda
function
AWS
CodeDeploy
Hook
Lambda
function
Checker
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Contenu connexe

Tendances

Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Amazon Web Services
 
AWS Cloud Adoption Framework and Workshops
AWS Cloud Adoption Framework and WorkshopsAWS Cloud Adoption Framework and Workshops
AWS Cloud Adoption Framework and WorkshopsTom Laszewski
 
Achieving Business Value with AWS
Achieving Business Value with AWSAchieving Business Value with AWS
Achieving Business Value with AWSAmazon Web Services
 
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...Amazon Web Services
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019Amazon Web Services
 
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdfAWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdfAmazon Web Services
 
VPC Design and New Capabilities for Amazon VPC
VPC Design and New Capabilities for Amazon VPCVPC Design and New Capabilities for Amazon VPC
VPC Design and New Capabilities for Amazon VPCAmazon Web Services
 
Overview of AWS by Andy Jassy - SVP, AWS
Overview of AWS by Andy Jassy - SVP, AWSOverview of AWS by Andy Jassy - SVP, AWS
Overview of AWS by Andy Jassy - SVP, AWSAmazon Web Services
 

Tendances (20)

AWS Big Data Platform
AWS Big Data PlatformAWS Big Data Platform
AWS Big Data Platform
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
 
AWS Security by Design
AWS Security by Design AWS Security by Design
AWS Security by Design
 
Introducing Amazon SageMaker
Introducing Amazon SageMakerIntroducing Amazon SageMaker
Introducing Amazon SageMaker
 
AWS Cloud Adoption Framework and Workshops
AWS Cloud Adoption Framework and WorkshopsAWS Cloud Adoption Framework and Workshops
AWS Cloud Adoption Framework and Workshops
 
AWS Security & Compliance
AWS Security & ComplianceAWS Security & Compliance
AWS Security & Compliance
 
Achieving Business Value with AWS
Achieving Business Value with AWSAchieving Business Value with AWS
Achieving Business Value with AWS
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
AWS glue technical enablement training
AWS glue technical enablement trainingAWS glue technical enablement training
AWS glue technical enablement training
 
Cost Optimisation on AWS
Cost Optimisation on AWSCost Optimisation on AWS
Cost Optimisation on AWS
 
AWS Secrets Manager
AWS Secrets ManagerAWS Secrets Manager
AWS Secrets Manager
 
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019
 
AWS WAF
AWS WAFAWS WAF
AWS WAF
 
AWS Business Essentials
AWS Business EssentialsAWS Business Essentials
AWS Business Essentials
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdfAWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
AWSome Day Online Conference 2019 - Module 5 AWS Pricing and Support.pdf
 
VPC Design and New Capabilities for Amazon VPC
VPC Design and New Capabilities for Amazon VPCVPC Design and New Capabilities for Amazon VPC
VPC Design and New Capabilities for Amazon VPC
 
Overview of AWS by Andy Jassy - SVP, AWS
Overview of AWS by Andy Jassy - SVP, AWSOverview of AWS by Andy Jassy - SVP, AWS
Overview of AWS by Andy Jassy - SVP, AWS
 

Similaire à Building Your Own ML Application with AWS Lambda and Amazon SageMaker (SRV404-R1) - AWS re:Invent 2018

Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...Amazon Web Services
 
Work with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS SummitWork with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS SummitAmazon Web Services
 
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS SummitWork with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS SummitAmazon Web Services
 
Quickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scaleQuickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scaleAWS Germany
 
Accelerate Machine Learning with Ease using Amazon SageMaker
Accelerate Machine Learning with Ease using Amazon SageMakerAccelerate Machine Learning with Ease using Amazon SageMaker
Accelerate Machine Learning with Ease using Amazon SageMakerAmazon Web Services
 
Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...
Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...
Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...Amazon Web Services
 
Getting Started with AIML Using Amazon Sagemaker_AWSPSSummit_Singapore
Getting Started with AIML Using Amazon Sagemaker_AWSPSSummit_SingaporeGetting Started with AIML Using Amazon Sagemaker_AWSPSSummit_Singapore
Getting Started with AIML Using Amazon Sagemaker_AWSPSSummit_SingaporeAmazon Web Services
 
How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...
How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...
How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...Amazon Web Services
 
DataXDay - Machine learning models at scale with Amazon SageMaker
DataXDay - Machine learning models at scale with Amazon SageMaker DataXDay - Machine learning models at scale with Amazon SageMaker
DataXDay - Machine learning models at scale with Amazon SageMaker DataXDay Conference by Xebia
 
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech TalksIntegrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech TalksAmazon Web Services
 
Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências - MCL...
Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências -  MCL...Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências -  MCL...
Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências - MCL...Amazon Web Services
 
AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...
AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...
AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...Amazon Web Services Korea
 
Machine learning for developers & data scientists with Amazon SageMaker - AIM...
Machine learning for developers & data scientists with Amazon SageMaker - AIM...Machine learning for developers & data scientists with Amazon SageMaker - AIM...
Machine learning for developers & data scientists with Amazon SageMaker - AIM...Amazon Web Services
 
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...Amazon Web Services
 
Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018
Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018
Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018Yotam Yarden
 
Deep Dive Amazon SageMaker
Deep Dive Amazon SageMakerDeep Dive Amazon SageMaker
Deep Dive Amazon SageMakerCobus Bernard
 
Introducing Amazon SageMaker - AWS Online Tech Talks
Introducing Amazon SageMaker - AWS Online Tech TalksIntroducing Amazon SageMaker - AWS Online Tech Talks
Introducing Amazon SageMaker - AWS Online Tech TalksAmazon Web Services
 
Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018
Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018
Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018Amazon Web Services
 
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...Amazon Web Services
 

Similaire à Building Your Own ML Application with AWS Lambda and Amazon SageMaker (SRV404-R1) - AWS re:Invent 2018 (20)

Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
Build Machine Learning Applications with AWS Lambda & Amazon SageMaker (SRV42...
 
Work with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS SummitWork with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Atlanta AWS Summit
 
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS SummitWork with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
Work with Machine Learning in Amazon SageMaker - BDA203 - Toronto AWS Summit
 
Quickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scaleQuickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scale
 
Accelerate Machine Learning with Ease using Amazon SageMaker
Accelerate Machine Learning with Ease using Amazon SageMakerAccelerate Machine Learning with Ease using Amazon SageMaker
Accelerate Machine Learning with Ease using Amazon SageMaker
 
Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...
Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...
Accelerate Machine Learning with Ease Using Amazon SageMaker - BDA301 - Chica...
 
Getting Started with AIML Using Amazon Sagemaker_AWSPSSummit_Singapore
Getting Started with AIML Using Amazon Sagemaker_AWSPSSummit_SingaporeGetting Started with AIML Using Amazon Sagemaker_AWSPSSummit_Singapore
Getting Started with AIML Using Amazon Sagemaker_AWSPSSummit_Singapore
 
How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...
How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...
How Peak.AI Uses Amazon SageMaker for Product Personalization (GPSTEC316) - A...
 
DataXDay - Machine learning models at scale with Amazon SageMaker
DataXDay - Machine learning models at scale with Amazon SageMaker DataXDay - Machine learning models at scale with Amazon SageMaker
DataXDay - Machine learning models at scale with Amazon SageMaker
 
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech TalksIntegrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
Integrating Amazon SageMaker into your Enterprise - AWS Online Tech Talks
 
Introduction to Sagemaker
Introduction to SagemakerIntroduction to Sagemaker
Introduction to Sagemaker
 
Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências - MCL...
Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências -  MCL...Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências -  MCL...
Machine Learning e Amazon SageMaker: Algoritmos, Modelos e Inferências - MCL...
 
AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...
AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...
AWS의 새로운 언어, 음성, 텍스트 처리 인공 지능 서비스, Amazon SageMaker::Sunil Mallya::AWS Summit...
 
Machine learning for developers & data scientists with Amazon SageMaker - AIM...
Machine learning for developers & data scientists with Amazon SageMaker - AIM...Machine learning for developers & data scientists with Amazon SageMaker - AIM...
Machine learning for developers & data scientists with Amazon SageMaker - AIM...
 
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
 
Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018
Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018
Build Your Recommendation Engine on AWS Today - AWS Summit Berlin 2018
 
Deep Dive Amazon SageMaker
Deep Dive Amazon SageMakerDeep Dive Amazon SageMaker
Deep Dive Amazon SageMaker
 
Introducing Amazon SageMaker - AWS Online Tech Talks
Introducing Amazon SageMaker - AWS Online Tech TalksIntroducing Amazon SageMaker - AWS Online Tech Talks
Introducing Amazon SageMaker - AWS Online Tech Talks
 
Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018
Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018
Serverless AI with Scikit-Learn (GPSWS405) - AWS re:Invent 2018
 
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
Perform Machine Learning at the IoT Edge using AWS Greengrass and Amazon Sage...
 

Plus de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Plus de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Building Your Own ML Application with AWS Lambda and Amazon SageMaker (SRV404-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building Your Own ML Application with AWS Lambda & Amazon SageMaker S R V 4 0 4 Diego Natali Solutions Architect Amazon Web Services EMEA Giuseppe Angelo Porcelli Sr. Solutions Architect Amazon Web Services EMEA
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Repeats Wednesday, 28 SRV404 Building Your Own ML Application with AWS Lambda & Amazon SageMaker 12:15 – PM | Bellagio, Level 1, Grand Ballroom 9
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. THE MACHINE LEARNING PROCESS Business Problem - ML problem framing
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. THE MACHINE LEARNING PROCESS Business Problem - ML problem framing Data Collection Data Integration Data Preparation & Cleaning
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. THE MACHINE LEARNING PROCESS Data Visualization & Analysis Business Problem - ML problem framing Data Collection Data Integration Data Preparation & Cleaning Feature Engineering Model Training & Parameter Tuning Model Evaluation Experiment, Train, Tune and Evaluate • Setup and manage Notebook Environments • Setup and manage Training Clusters • Write Data Connectors • Scale ML algorithms to large datasets • Distribute ML training algorithm to multiple machines • Secure Model artifacts
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. THE MACHINE LEARNING PROCESS Data Visualization & Analysis Business Problem - ML problem framing Data Collection Data Integration Data Preparation & Cleaning Feature Engineering Are Business goals met? Monitoring & Debugging - Predictions Yes Re-training Model Training & Parameter Tuning Model Evaluation Model Deployment Deploy, Monitor and Debug • Setup and manage Model Inference Clusters • Manage and Auto-Scale Model Inference APIs • Monitor and Debug Model Predictions • Models versioning and performance tracking • Automate New Model version promotion to production (A/B testing)
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. THE MACHINE LEARNING PROCESS Data Visualization & Analysis Business Problem - ML problem framing Data Collection Data Integration Data Preparation & Cleaning Feature Engineering Are Business goals met? Monitoring & Debugging - Predictions YesNo DataAugmentation Feature Augmentation Re-training Model Training & Parameter Tuning Model Evaluation Model Deployment
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WHERE SHOULD WE SPEND TIME? BUI L D T R AI N D E P L O Y T U NE
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AMAZON SAGEMAKER End-to-end encryption with KMS End-to-end VPC support Compliance and audit capabilities Metadata and experiment management capabilities Pay as you go Fully managed hosting with auto- scaling One-click deployment Pre-built notebooks for common problems Built-in, high performance algorithms One-click training BUI L D T R AI N & T UNE D E P L O Y Hyperparameter optimization
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EXECUTING INFERENCES Amazon SageMaker Deployment AWS Lambda Real-time Sync Use managed real-time inference cluster On-demand request-based model Real-time Async Use Amazon Kinesis and AWS Lambda to invoke the real-time inference endpoint Use Amazon Kinesis and AWS Lambda to host the model and execute inferences in Lambda Batch Use batch transform Need to implement batch processing Edge (GreenGrass) Use built-in AWS Greengrass model hosting Deploy a Lambda function on AWS Greengrass to execute inferences
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. USING AWS LAMBDA PROS Develop Modern Applications serverless Charged per request and execution duration Effortless, limitless scalability, high availability, fault tolerance, etc. Lower the cost of inferences No infrastructure to maintain 1 million free executions Event-based model Example: 100M requests for about $54/month CONS GPU not yet available 512 MB /tmp limit 250 MB limit for uncompressed size of code/dependencies Need to create your deployment package and pipeline to automate the process Cold start (~5s TF, ~2s MXNet) Infrastructure to mantain if not using Amazon SageMaker for training Need to include and manage all dependencies Need to create your own API for serving
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AMAZON SAGEMAKER vs AWS LAMBDA Amazon SageMaker Deployment AWS Lambda Workload Well suited for constant and predictable workloads, with regular and frequent traffic Well suited for variable or unpredictable workloads, with intermittent and spiky traffic Scaling Configure auto-scaling on the real-time endpoint Automatic scaling Hardware GPU and CPU instances CPU only Model architecture Any complexity [CNNs, RNNs, etc.] Simple models A/B Testing Yes Yes Deployment Fast, one-click deployment Need to build package and create inference API from scratch Monitoring and Debugging Amazon CloudWatch / CloudWatch Logs Amazon CloudWatch / CloudWatch Logs
  • 14. IT’S A MATTER OF CHOICE
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. THE DATASET SMS Spam Collection Data Set • A public set of 5574 SMS labeled messages that have been collected for mobile phone spam research • 747 SPAM, 4827 non SPAM https://archive.ics.uci.edu/ml/datasets/sms+spam+collection ham Go until jurong point, crazy.. Available only in bugis n great world la e buffet... Cine there got amore wat... ham Ok lar... Joking wif u oni... spam Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&C's apply 08452810075over18’s ham U dun say so early hor... U c already then say... ham Nah I don't think he goes to usf, he lives around here though spam FreeMsg Hey there darling it's been 3 week's now and no word back! I'd like some fun you up for it still? Tb ok! XxX std chgs to send, £1.50 to rcv ham Even my brother is not like to speak with me. They treat me like aids patent. ham As per your request 'Melle Melle (Oru Minnaminunginte Nurungu Vettam)' has been set as your callertune for all Callers. Press *9 to copy your friends Callertune
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WORKFLOW BUI L D T R AI N & T UNE D E P L O Y
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. TRAINING THE MODEL SMS Spam Training Data SMS Spam model artifacts Amazon SageMaker Training Amazon ECR Training Script SageMaker MXNet container
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. DEPLOYING TO LAMBDA Get model artifacts from S3 Run an Amazon Linux EC2 Instance or Cloud9 environment Download pre-built MXNet Lambda packages from GitHub in a folder Write Lambda handler, package and save Lambda deployment package to S3 Copy model artifacts in the folder https://docs.aws.amazon.com/sagemaker/latest/dg/API_ModelArtifacts.html https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html https://github.com/diegonat/smwshop/ https://docs.aws.amazon.com/lambda/latest/dg/lambda-python- how-to-create-deployment-package.html
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AUTOMATING DEPLOYMENT AWS CodePipeline bucket with objects event (event- based) AWS CloudTrail Lambda function bucket with objects event (event- based) AWS CloudTrail Amazon SageMaker AWS CodeBuild template stack change set bucket with objects Amazon API Gateway* Lambda function AWS CodeDeploy Hook Lambda function Checker
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.