SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Confidential & Proprietary
Deployment Design Patterns
Deploying Machine Learning Models into Production
Dan Zaratsian, Cloud Solutions Engineer @ Google
https://github.com/zaratsian
October 2018
Confidential & Proprietary
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also using Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Confidential & Proprietary
Why is this Important?
● Too much time is lost before deploying.
● Deployments are not scalable.
● Deployments are not easily maintained & updated.
● Deployed models are not monitored.
● Too many models live (and die) on laptops.
● Deployment process is not understood.
Confidential & Proprietary
Dan Zaratsian
Cloud Solutions Engineer @ Google
University of Akron
B.S. Electrical Engineering
North Carolina State University
M.S. Advanced Analytics
Confidential & Proprietary
Data Scientist Production
Environment
End Users
(Customers)
Value
ML Model ML Model
Ideal Scenario (Simplified)...
Confidential & Proprietary
Data Scientist Production
Environment
End Users
(Customers)
No Value
ML Model
A Typical Scenario (What is commonly done)...
Lots of really great code in a Notebook,
but may not easily deployed.
Confidential & Proprietary
Why is this a challenge?
A good model may look something like this...
Model Score
Code
Date Quarter Down YardsToGo PlayType
2018-09-16 1 4 6 Run
2018-09-23 4 1 10 Pass
2018-10-07 4 3 13 Pass
2018-10-14 3 1 10 Run
Predicted Yards Gained
6.15 yards
-0.90 yards
3.95 yards
1.50 yards
Com h iv M
Pip e
(mo b e t / s o c e)
Confidential & Proprietary
Pre c in & Fe t e E g e n
Why is this a challenge?
It’s common to use dummy variables, standardize values, transform, etc...
Model Score
Code
Date Quarter Down YardsToGo PlayType
2018-09-16 1 4 6 Run
2018-09-23 4 1 10 Pass
2018-10-07 4 3 13 Pass
2018-10-14 3 1 10 Run
Predicted Yards Gained
6.15 yards
-0.90 yards
3.95 yards
1.50 yards
Month Quarter Down
YardsToG
o
PlayType_
Run
PlayType_
Run
9 1 4 6 1 0
9 4 1 10 0 1
10 4 3 13 0 1
10 3 1 10 1 0
In o p (or )
M ip e
Confidential & Proprietary
Why is this a challenge?
Or in many cases, the input is a sparse matrix, heavily feature engineered...
Date Quarter Down YardsToGo PlayType
2018-09-16 1 4 6 Run
2018-09-23 4 1 10 Pass
2018-10-07 4 3 13 Pass
2018-10-14 3 1 10 Run
Predicted Yards Gained
6.15 yards
-0.90 yards
3.95 yards
1.50 yards
Pre c in & Fe t e E g e n
Model Score
Code
In o p (or )
M ip e
Confidential & Proprietary
A few thoughts...
● Model deployment can mean different things across organizations.
● It’s complex and there’s a need for cross domain knowledge.
● Requirements vary by use case, industry, organization.
● There’s typically no one right way to deploy models.
Confidential & Proprietary
Data Scientist Production
Environment
End Users
(Customers)
Value
ML Model ML Model
Deployment Considerations
● What tool was used?
● What programming language?
● What are the dependencies?
● Is the model pipelined generalized?
● Can it easily be deployed across OS,
clouds, on-prem, etc?
● Is there a process for
promoting new models
into production?
● How often are models
updated or retrained?
● Where is this server(s) hosted?
● How do we scale?
● How do we secure our apps?
● How do we govern the pipeline?
How do end
users consume
our model?
Confidential & Proprietary
● How will your models be developed (code, drop-and-drag, hybrid)?
● How will your models be deployed?
○ As a batch process
○ Available via API
○ Real-time / Online Stream
○ Recoded (with model coefficients, logic, etc.)
● What scheduler is being used?
● Is your scheduler able to load and deploy your model pipeline?
● How often will the model be retrained?
● Do you have a process in place to monitor model performance?
● Using docker & kubernetes, serverless, ...?
Deployment Considerations (Continued)
Confidential & Proprietary
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also using Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Train ML Model
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also available using Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Confidential & Proprietary
ML Model Training Process (Simplified)
Data Prep &
Feature Eng.
Model
(model.joblib)
Model
Training
Model
Evaluation
ML Client Environment
Data
Scientist
Database
End Users
(Customers)
Training
Data
Batch Deployment
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also available using Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Confidential & Proprietary
Reference Architecture: Batch Scoring
Data Prep &
Feature Eng.
Model
(model.joblib)
Data
Scientist
Model
Training
Model
Evaluation
ML Client Environment
End Users
(Customers)
Training
DataDatabase
Confidential & Proprietary
Reference Architecture: Batch Scoring
Data Prep &
Feature Eng.
Model
(model.joblib)
Data
Scientist
Model
Training
Model
Evaluation
ML Client Environment
End Users
(Customers)
Model
(model.joblib)
Training
DataDatabase
Scored Records
Database Records
Deployed on Server, executed with Scheduler
Deploy as Web App
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also in Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Confidential & Proprietary
Reference Architecture: Deploy as Web App
Data Prep &
Feature Eng.
Model
(model.joblib)
Data
Scientist
Model
Training
Model
Evaluation
ML Client Environment
End Users
(Customers)
Training
DataDatabase
Confidential & Proprietary
Accept and
Process Request
POST
Reference Architecture: Deploy as Web App
Data Prep &
Feature Eng.
Model
(model.joblib)
Data
Scientist
Model
Training
Model
Evaluation
ML Client Environment
End Users
(Customers)
Model
(model.joblib)
Training
DataDatabase
Response
Database Records
Web Framework
(Simplified Architecture)
Confidential & Proprietary
Deploy as Web Service (Serverless)
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also in Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Confidential & Proprietary
Reference Architecture: Deploy as Web Service (API)
Data Prep &
Feature Eng.
Model
(model.joblib)
Data
Scientist
Model
Training
Model
Evaluation
ML Client Environment
End Users
(Customers)
Training
DataDatabase
Confidential & Proprietary
Accept and
Process Request
API Call
Reference Architecture: Deploy as Web Service (API)
Data Prep &
Feature Eng.
Model
(model.joblib)
Data
Scientist
Model
Training
Model
Evaluation
ML Client Environment
End Users
(Customers)
Model
(model.joblib)
Training
DataDatabase
Response
Web Service (API)
(Simplified Architecture)
Confidential & Proprietary
Automated Model Build & Deploy
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also in Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News)
Confidential & ProprietaryConfidential & Proprietary
UPDATEDEPLOYEVALUATETUNE ML MODEL
PARAMETERS
ML MODEL DESIGN
DATA
PREPROCESSING
Cloud AutoML
A technology that can automatically creates a Machine Learning Model
UPDATEDEPLOYEVALUATETUNE ML MODEL
PARAMETERS
ML MODEL
DESIGN
DATA
PREPROCESSING
Confidential & Proprietary
Why Cloud AutoML?
Your own
custom models
Simple
Limited ML
expertise needed
High quality
Confidential & Proprietary
© 2018 Google LLC. All rights reserved.
AutoML
Training
Dataset
Train Deploy Serve
Generate predictions
with a REST API
AutoML to the rescue
Confidential & Proprietary
Deployment Design Patterns
1. Train ML Model (using sklearn)
2. Deploy as Batch
3. Deploy as Web App (also using Spark)
4. Deploy as Web Service (Serverless)
5. Automated Model Build & Deploy (NLP, News Sources)
Tha s!
Dan Zaratsian
http://github.com/zaratsian

Weitere ähnliche Inhalte

Was ist angesagt?

Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Databricks
 

Was ist angesagt? (20)

GraphQL Search
GraphQL SearchGraphQL Search
GraphQL Search
 
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4jGraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
 
Developing ML-enabled Data Pipelines on Databricks using IDE & CI/CD at Runta...
Developing ML-enabled Data Pipelines on Databricks using IDE & CI/CD at Runta...Developing ML-enabled Data Pipelines on Databricks using IDE & CI/CD at Runta...
Developing ML-enabled Data Pipelines on Databricks using IDE & CI/CD at Runta...
 
[AI] ML Operationalization with Microsoft Azure
[AI] ML Operationalization with Microsoft Azure[AI] ML Operationalization with Microsoft Azure
[AI] ML Operationalization with Microsoft Azure
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits together
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
Building Notebook-based AI Pipelines with Elyra and Kubeflow
Building Notebook-based AI Pipelines with Elyra and KubeflowBuilding Notebook-based AI Pipelines with Elyra and Kubeflow
Building Notebook-based AI Pipelines with Elyra and Kubeflow
 
GraphQL & Relay
GraphQL & RelayGraphQL & Relay
GraphQL & Relay
 
Blind spots in big data erez koren @ forter
Blind spots in big data erez koren @ forterBlind spots in big data erez koren @ forter
Blind spots in big data erez koren @ forter
 
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jNeo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
 
Hamburg Data Science Meetup - MLOps with a Feature Store
Hamburg Data Science Meetup - MLOps with a Feature StoreHamburg Data Science Meetup - MLOps with a Feature Store
Hamburg Data Science Meetup - MLOps with a Feature Store
 
GraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-DevelopmentGraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-Development
 
MLflow with R
MLflow with RMLflow with R
MLflow with R
 
An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQL
 
Richard Coffey (x18140785) - Research in Computing CA2
Richard Coffey (x18140785) - Research in Computing CA2Richard Coffey (x18140785) - Research in Computing CA2
Richard Coffey (x18140785) - Research in Computing CA2
 
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
Moving a Fraud-Fighting Random Forest from scikit-learn to Spark with MLlib, ...
 
Adding GraphQL to your existing architecture
Adding GraphQL to your existing architectureAdding GraphQL to your existing architecture
Adding GraphQL to your existing architecture
 
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
 
Modular GraphQL with Schema Stitching
Modular GraphQL with Schema StitchingModular GraphQL with Schema Stitching
Modular GraphQL with Schema Stitching
 
React and GraphQL at Stripe
React and GraphQL at StripeReact and GraphQL at Stripe
React and GraphQL at Stripe
 

Ähnlich wie Deployment Design Patterns - Deploying Machine Learning and Deep Learning Models into Production

Monitoring AI with AI
Monitoring AI with AIMonitoring AI with AI
Monitoring AI with AI
Stepan Pushkarev
 
Machine Learning Models in Production
Machine Learning Models in ProductionMachine Learning Models in Production
Machine Learning Models in Production
DataWorks Summit
 

Ähnlich wie Deployment Design Patterns - Deploying Machine Learning and Deep Learning Models into Production (20)

Continuous delivery for machine learning
Continuous delivery for machine learningContinuous delivery for machine learning
Continuous delivery for machine learning
 
GDG Cloud Southlake #16: Priyanka Vergadia: Scalable Data Analytics in Google...
GDG Cloud Southlake #16: Priyanka Vergadia: Scalable Data Analytics in Google...GDG Cloud Southlake #16: Priyanka Vergadia: Scalable Data Analytics in Google...
GDG Cloud Southlake #16: Priyanka Vergadia: Scalable Data Analytics in Google...
 
Scaling Ride-Hailing with Machine Learning on MLflow
Scaling Ride-Hailing with Machine Learning on MLflowScaling Ride-Hailing with Machine Learning on MLflow
Scaling Ride-Hailing with Machine Learning on MLflow
 
Machine learning at scale - Webinar By zekeLabs
Machine learning at scale - Webinar By zekeLabsMachine learning at scale - Webinar By zekeLabs
Machine learning at scale - Webinar By zekeLabs
 
DevOps for DataScience
DevOps for DataScienceDevOps for DataScience
DevOps for DataScience
 
MLOps Using MLflow
MLOps Using MLflowMLOps Using MLflow
MLOps Using MLflow
 
Monitoring AI with AI
Monitoring AI with AIMonitoring AI with AI
Monitoring AI with AI
 
Data Summer Conf 2018, “Monitoring AI with AI (RUS)” — Stepan Pushkarev, CTO ...
Data Summer Conf 2018, “Monitoring AI with AI (RUS)” — Stepan Pushkarev, CTO ...Data Summer Conf 2018, “Monitoring AI with AI (RUS)” — Stepan Pushkarev, CTO ...
Data Summer Conf 2018, “Monitoring AI with AI (RUS)” — Stepan Pushkarev, CTO ...
 
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
Building machine learning service in your business — Eric Chen (Uber) @PAPIs ...
 
Apache ® Spark™ MLlib 2.x: How to Productionize your Machine Learning Models
Apache ® Spark™ MLlib 2.x: How to Productionize your Machine Learning ModelsApache ® Spark™ MLlib 2.x: How to Productionize your Machine Learning Models
Apache ® Spark™ MLlib 2.x: How to Productionize your Machine Learning Models
 
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
[Giovanni Galloro] How to use machine learning on Google Cloud Platform[Giovanni Galloro] How to use machine learning on Google Cloud Platform
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
 
Production ML Systems and Computer Vision with Google Cloud
Production ML Systems and Computer Vision with Google CloudProduction ML Systems and Computer Vision with Google Cloud
Production ML Systems and Computer Vision with Google Cloud
 
EPAM ML/AI Accelerator - ODAHU
EPAM ML/AI Accelerator - ODAHUEPAM ML/AI Accelerator - ODAHU
EPAM ML/AI Accelerator - ODAHU
 
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
 
GDG Cloud Southlake #3 Charles Adetiloye: Enterprise MLOps in Practice
GDG Cloud Southlake #3 Charles Adetiloye: Enterprise MLOps in PracticeGDG Cloud Southlake #3 Charles Adetiloye: Enterprise MLOps in Practice
GDG Cloud Southlake #3 Charles Adetiloye: Enterprise MLOps in Practice
 
Machine Learning Models in Production
Machine Learning Models in ProductionMachine Learning Models in Production
Machine Learning Models in Production
 
Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)Easy path to machine learning (2023-2024)
Easy path to machine learning (2023-2024)
 
Serverless Machine Learning
Serverless Machine LearningServerless Machine Learning
Serverless Machine Learning
 
World Artificial Intelligence Conference Shanghai 2018
World Artificial Intelligence Conference Shanghai 2018World Artificial Intelligence Conference Shanghai 2018
World Artificial Intelligence Conference Shanghai 2018
 
Certification Study Group - NLP & Recommendation Systems on GCP Session 5
Certification Study Group - NLP & Recommendation Systems on GCP Session 5Certification Study Group - NLP & Recommendation Systems on GCP Session 5
Certification Study Group - NLP & Recommendation Systems on GCP Session 5
 

Mehr von All Things Open

Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
All Things Open
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
All Things Open
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
All Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
All Things Open
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
All Things Open
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
All Things Open
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
All Things Open
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
All Things Open
 

Mehr von All Things Open (20)

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of Observability
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil Nash
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScript
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in Haystacks
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit Intercept
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Deployment Design Patterns - Deploying Machine Learning and Deep Learning Models into Production

  • 1.
  • 2. Confidential & Proprietary Deployment Design Patterns Deploying Machine Learning Models into Production Dan Zaratsian, Cloud Solutions Engineer @ Google https://github.com/zaratsian October 2018
  • 3. Confidential & Proprietary Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also using Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)
  • 4. Confidential & Proprietary Why is this Important? ● Too much time is lost before deploying. ● Deployments are not scalable. ● Deployments are not easily maintained & updated. ● Deployed models are not monitored. ● Too many models live (and die) on laptops. ● Deployment process is not understood.
  • 5. Confidential & Proprietary Dan Zaratsian Cloud Solutions Engineer @ Google University of Akron B.S. Electrical Engineering North Carolina State University M.S. Advanced Analytics
  • 6. Confidential & Proprietary Data Scientist Production Environment End Users (Customers) Value ML Model ML Model Ideal Scenario (Simplified)...
  • 7. Confidential & Proprietary Data Scientist Production Environment End Users (Customers) No Value ML Model A Typical Scenario (What is commonly done)... Lots of really great code in a Notebook, but may not easily deployed.
  • 8. Confidential & Proprietary Why is this a challenge? A good model may look something like this... Model Score Code Date Quarter Down YardsToGo PlayType 2018-09-16 1 4 6 Run 2018-09-23 4 1 10 Pass 2018-10-07 4 3 13 Pass 2018-10-14 3 1 10 Run Predicted Yards Gained 6.15 yards -0.90 yards 3.95 yards 1.50 yards Com h iv M Pip e (mo b e t / s o c e)
  • 9. Confidential & Proprietary Pre c in & Fe t e E g e n Why is this a challenge? It’s common to use dummy variables, standardize values, transform, etc... Model Score Code Date Quarter Down YardsToGo PlayType 2018-09-16 1 4 6 Run 2018-09-23 4 1 10 Pass 2018-10-07 4 3 13 Pass 2018-10-14 3 1 10 Run Predicted Yards Gained 6.15 yards -0.90 yards 3.95 yards 1.50 yards Month Quarter Down YardsToG o PlayType_ Run PlayType_ Run 9 1 4 6 1 0 9 4 1 10 0 1 10 4 3 13 0 1 10 3 1 10 1 0 In o p (or ) M ip e
  • 10. Confidential & Proprietary Why is this a challenge? Or in many cases, the input is a sparse matrix, heavily feature engineered... Date Quarter Down YardsToGo PlayType 2018-09-16 1 4 6 Run 2018-09-23 4 1 10 Pass 2018-10-07 4 3 13 Pass 2018-10-14 3 1 10 Run Predicted Yards Gained 6.15 yards -0.90 yards 3.95 yards 1.50 yards Pre c in & Fe t e E g e n Model Score Code In o p (or ) M ip e
  • 11. Confidential & Proprietary A few thoughts... ● Model deployment can mean different things across organizations. ● It’s complex and there’s a need for cross domain knowledge. ● Requirements vary by use case, industry, organization. ● There’s typically no one right way to deploy models.
  • 12. Confidential & Proprietary Data Scientist Production Environment End Users (Customers) Value ML Model ML Model Deployment Considerations ● What tool was used? ● What programming language? ● What are the dependencies? ● Is the model pipelined generalized? ● Can it easily be deployed across OS, clouds, on-prem, etc? ● Is there a process for promoting new models into production? ● How often are models updated or retrained? ● Where is this server(s) hosted? ● How do we scale? ● How do we secure our apps? ● How do we govern the pipeline? How do end users consume our model?
  • 13. Confidential & Proprietary ● How will your models be developed (code, drop-and-drag, hybrid)? ● How will your models be deployed? ○ As a batch process ○ Available via API ○ Real-time / Online Stream ○ Recoded (with model coefficients, logic, etc.) ● What scheduler is being used? ● Is your scheduler able to load and deploy your model pipeline? ● How often will the model be retrained? ● Do you have a process in place to monitor model performance? ● Using docker & kubernetes, serverless, ...? Deployment Considerations (Continued)
  • 14. Confidential & Proprietary Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also using Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)
  • 15. Train ML Model Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also available using Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)
  • 16. Confidential & Proprietary ML Model Training Process (Simplified) Data Prep & Feature Eng. Model (model.joblib) Model Training Model Evaluation ML Client Environment Data Scientist Database End Users (Customers) Training Data
  • 17. Batch Deployment Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also available using Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)
  • 18. Confidential & Proprietary Reference Architecture: Batch Scoring Data Prep & Feature Eng. Model (model.joblib) Data Scientist Model Training Model Evaluation ML Client Environment End Users (Customers) Training DataDatabase
  • 19. Confidential & Proprietary Reference Architecture: Batch Scoring Data Prep & Feature Eng. Model (model.joblib) Data Scientist Model Training Model Evaluation ML Client Environment End Users (Customers) Model (model.joblib) Training DataDatabase Scored Records Database Records Deployed on Server, executed with Scheduler
  • 20. Deploy as Web App Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also in Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)
  • 21. Confidential & Proprietary Reference Architecture: Deploy as Web App Data Prep & Feature Eng. Model (model.joblib) Data Scientist Model Training Model Evaluation ML Client Environment End Users (Customers) Training DataDatabase
  • 22. Confidential & Proprietary Accept and Process Request POST Reference Architecture: Deploy as Web App Data Prep & Feature Eng. Model (model.joblib) Data Scientist Model Training Model Evaluation ML Client Environment End Users (Customers) Model (model.joblib) Training DataDatabase Response Database Records Web Framework (Simplified Architecture)
  • 24. Deploy as Web Service (Serverless) Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also in Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)
  • 25. Confidential & Proprietary Reference Architecture: Deploy as Web Service (API) Data Prep & Feature Eng. Model (model.joblib) Data Scientist Model Training Model Evaluation ML Client Environment End Users (Customers) Training DataDatabase
  • 26. Confidential & Proprietary Accept and Process Request API Call Reference Architecture: Deploy as Web Service (API) Data Prep & Feature Eng. Model (model.joblib) Data Scientist Model Training Model Evaluation ML Client Environment End Users (Customers) Model (model.joblib) Training DataDatabase Response Web Service (API) (Simplified Architecture)
  • 28. Automated Model Build & Deploy Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also in Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News)
  • 29. Confidential & ProprietaryConfidential & Proprietary UPDATEDEPLOYEVALUATETUNE ML MODEL PARAMETERS ML MODEL DESIGN DATA PREPROCESSING Cloud AutoML A technology that can automatically creates a Machine Learning Model UPDATEDEPLOYEVALUATETUNE ML MODEL PARAMETERS ML MODEL DESIGN DATA PREPROCESSING
  • 30. Confidential & Proprietary Why Cloud AutoML? Your own custom models Simple Limited ML expertise needed High quality Confidential & Proprietary
  • 31. © 2018 Google LLC. All rights reserved. AutoML Training Dataset Train Deploy Serve Generate predictions with a REST API AutoML to the rescue
  • 32. Confidential & Proprietary Deployment Design Patterns 1. Train ML Model (using sklearn) 2. Deploy as Batch 3. Deploy as Web App (also using Spark) 4. Deploy as Web Service (Serverless) 5. Automated Model Build & Deploy (NLP, News Sources)