SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Training and deploying ML models with
Google Cloud Platform
Maciej Pieńkosz
Data Science Summit 2020 1
ML in Sotrender
• Sotrender - a platform for analyzing comunication on your
Social Media
• Our models:
– Sentiment
– Hatespeech
– Topic modelling
– Keyphrase extractor
– NER (brands and products)
– Image Tagger
– Logo Detector
– ….
2
ML models lifecycle
3
https://www.jeremyjordan.me/ml-projects-guide/
Modeling with AI Notebooks
1. AI Platform Notebooks is used for initial data exploration and modeling
2. Allows to quickly start working on new problem without worrying about infrostructure
3. For the start, we favor faster, simpler model architectures that can be easily built,
validated, iterated and eventually deployed (usually on CPU)
4. Experiment tracking: MlFlow
4
https://databricks.com/blog/2018/06/05/introducing-mlflow-an-open-source-machine-learning-platform.html
https://cloud.google.com/ai-platform-notebooks?hl=id
Structuring training code
• Notebooks disadvantages:
– You pay for the whole time the notebook is running
– Code quality is usually lower
– Hard to parametrize, unit test, and review
• After initial experimentation phase, we try to give more structure to
the model training code:
– Refactor codebase to Python packages and modules and move
to git repository (Gitlab)
– Add tests (more on it later)
– Wrap code into a Docker container
– Use dedicated AI Platform Training service to train in the cloud
5
https://www.jeremyjordan.me/ml-projects-guide/
AI Platform Training with custom containers
6
• Advantages:
– Develop locally, train in the cloud
– We are billed only for the actual training
time
– Broad hardware configuration options
(e.g. GPU type)
– Job statuses and logs for historical runs
are available in the dashboard
– Support for hyperparameter tuning
almost out-of-the box
Training job dockerfile
Cloud training script
Google Storage for Models and Datasets
• We use Google Storage as primary Store for models
and datasets
• One bucket per model
• We follow strict, unified bucket, directory and file
structure, same for every model
– Raw data
– Combined datasets, with predefined splits
– Model files
• Documentation in Knowledge Base (Confluence)
• One can use dedicated systems like DVC, Quilt
7
Model deployment
• Your options:
– Online
– Batch (offline)
• Our approach is to deploy models as services
– Easy to integrate
– Easy to use by other teams
• We serve them as REST service with Flask (or, most
recently, FastApi)
• We wrap them in Docker containers so they can be
easily deployed to cloud and serve with Cloud Run
8
https://mlinproduction.com/batch-inference-vs-online-inference/
Online inference
Batch inference
Cloud Deployment: Cloud Run
• We use Cloud Run to deploy our model services
• Cloud Build for delegating build process to GCP
• GCP has dedicated service for serving models, AI
Platform Prediction, but we use Cloud Run
– It is more flexible for us, we can set up any
environment and add any dependencies
– AI Predictions has limits regarding model
size
– We can add additional endpoints (e.g.
/explain to services)
9
Service dockerfile
Cloud deployment script
Cloud Run c.d.
• Useful features out-of-the box
– Autoscaling
– Multiple Revisions (versions), easy Rollback
– Traffic management
– Multiple Namespaces (dev, prod)
– Resource Monitoring
10
Delivery pipeline automation (CI/CD)
11
• Configured for the models that we use on bigger, production scale
• Implemented in Gitlab CI/CD
push Download files
Build image
Run tests
Run static analysis
Push image to registry
Code Review
Canary
rollout
deploy
Monitoring
• System level metrics:
– Resource consumption (RAM, CPU), healthchecks, status codes, latency, etc.
• Data level metrics
– Prediction distributions, input data distributions
– System performance against real time labels (collected automatically or manually)
12
https://mlinproduction.com/
Streamlit
• https://www.streamlit.io/
• Easy tool to create simple web Data Products directly in Python
• You can use it to create Demos, share your work, showcase your models behaviour, debug
• Very intuitive, no Web skills required
13
https://towardsdatascience.com/coding-ml-tools-like-you-code-ml-models-ddba3357eace
Demos with Streamlit
14
Thanks for attending!
15

Mais conteúdo relacionado

Mais procurados

DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...Luis Beltran
 
Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...
Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...
Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...Paulo Condeça 🌐
 
Online Cloud Based Compilers System
Online Cloud Based Compilers SystemOnline Cloud Based Compilers System
Online Cloud Based Compilers Systemuday chauhan
 
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...Sotrender
 
Microservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get StartedMicroservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get StartedShailendra Chauhan
 
Continuous delivery by sergey seletsky
Continuous delivery by sergey seletskyContinuous delivery by sergey seletsky
Continuous delivery by sergey seletskySergey Seletsky
 
Architecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsArchitecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsGunnar Peipman
 
Service Management Automation (SMA) from zero to hero
Service Management Automation (SMA) from zero to heroService Management Automation (SMA) from zero to hero
Service Management Automation (SMA) from zero to heroMichael Rüefli
 
Software architecture in practice
Software architecture in practiceSoftware architecture in practice
Software architecture in practiceErwannWernli
 
Mva best practices in planning hybrid cloud infrastructures
Mva   best practices in planning hybrid cloud infrastructuresMva   best practices in planning hybrid cloud infrastructures
Mva best practices in planning hybrid cloud infrastructuresswapnilrkambli
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)Eugenio Minardi
 
Mobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloudMobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloudSrinivasan Nanduri
 
dotNET frameworks
dotNET frameworksdotNET frameworks
dotNET frameworksnawal saad
 

Mais procurados (14)

DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
 
Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...
Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...
Building elastic and fault tolerant Data Platform solutions with Azure, SQL S...
 
Online Cloud Based Compilers System
Online Cloud Based Compilers SystemOnline Cloud Based Compilers System
Online Cloud Based Compilers System
 
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
 
Microservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get StartedMicroservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get Started
 
Continuous delivery by sergey seletsky
Continuous delivery by sergey seletskyContinuous delivery by sergey seletsky
Continuous delivery by sergey seletsky
 
Architecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsArchitecting ASP.NET MVC Applications
Architecting ASP.NET MVC Applications
 
Service Management Automation (SMA) from zero to hero
Service Management Automation (SMA) from zero to heroService Management Automation (SMA) from zero to hero
Service Management Automation (SMA) from zero to hero
 
Software architecture in practice
Software architecture in practiceSoftware architecture in practice
Software architecture in practice
 
Mva best practices in planning hybrid cloud infrastructures
Mva   best practices in planning hybrid cloud infrastructuresMva   best practices in planning hybrid cloud infrastructures
Mva best practices in planning hybrid cloud infrastructures
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)
 
Mobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloudMobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloud
 
React.js + azure signal r
React.js  + azure signal r React.js  + azure signal r
React.js + azure signal r
 
dotNET frameworks
dotNET frameworksdotNET frameworks
dotNET frameworks
 

Semelhante a Training and deploying ML models with Google Cloud Platform

Building a MLOps Platform Around MLflow to Enable Model Productionalization i...
Building a MLOps Platform Around MLflow to Enable Model Productionalization i...Building a MLOps Platform Around MLflow to Enable Model Productionalization i...
Building a MLOps Platform Around MLflow to Enable Model Productionalization i...Databricks
 
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...OpenWhisk
 
MLflow with Databricks
MLflow with DatabricksMLflow with Databricks
MLflow with DatabricksLiangjun Jiang
 
Mlflow with databricks
Mlflow with databricksMlflow with databricks
Mlflow with databricksLiangjun Jiang
 
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...DataWorks Summit
 
Scaling AI/ML with Containers and Kubernetes
Scaling AI/ML with Containers and Kubernetes Scaling AI/ML with Containers and Kubernetes
Scaling AI/ML with Containers and Kubernetes Tushar Katarki
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGDSCNiT
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated MLMark Tabladillo
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureMark Tabladillo
 
World Artificial Intelligence Conference Shanghai 2018
World Artificial Intelligence Conference Shanghai 2018World Artificial Intelligence Conference Shanghai 2018
World Artificial Intelligence Conference Shanghai 2018Adam Gibson
 
IncQuery Group's presentation for the INCOSE Polish Chapter 20220310
IncQuery Group's presentation for the INCOSE Polish Chapter 20220310IncQuery Group's presentation for the INCOSE Polish Chapter 20220310
IncQuery Group's presentation for the INCOSE Polish Chapter 20220310IncQuery Labs
 
Infrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentInfrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentDatabricks
 
Magdalena Stenius: MLOPS Will Change Machine Learning
Magdalena Stenius: MLOPS Will Change Machine LearningMagdalena Stenius: MLOPS Will Change Machine Learning
Magdalena Stenius: MLOPS Will Change Machine LearningLviv Startup Club
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Marc Dutoo
 
WDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptxWDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptxArthur240715
 
The REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloudThe REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloudMarcos Almeida
 

Semelhante a Training and deploying ML models with Google Cloud Platform (20)

Building a MLOps Platform Around MLflow to Enable Model Productionalization i...
Building a MLOps Platform Around MLflow to Enable Model Productionalization i...Building a MLOps Platform Around MLflow to Enable Model Productionalization i...
Building a MLOps Platform Around MLflow to Enable Model Productionalization i...
 
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
 
IBM Bluemix Openwhisk
IBM Bluemix OpenwhiskIBM Bluemix Openwhisk
IBM Bluemix Openwhisk
 
MLflow with Databricks
MLflow with DatabricksMLflow with Databricks
MLflow with Databricks
 
Mlflow with databricks
Mlflow with databricksMlflow with databricks
Mlflow with databricks
 
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
 
MLOps in action
MLOps in actionMLOps in action
MLOps in action
 
Scaling AI/ML with Containers and Kubernetes
Scaling AI/ML with Containers and Kubernetes Scaling AI/ML with Containers and Kubernetes
Scaling AI/ML with Containers and Kubernetes
 
Google cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptxGoogle cloud Study Jam 2023.pptx
Google cloud Study Jam 2023.pptx
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft Azure
 
World Artificial Intelligence Conference Shanghai 2018
World Artificial Intelligence Conference Shanghai 2018World Artificial Intelligence Conference Shanghai 2018
World Artificial Intelligence Conference Shanghai 2018
 
IncQuery Group's presentation for the INCOSE Polish Chapter 20220310
IncQuery Group's presentation for the INCOSE Polish Chapter 20220310IncQuery Group's presentation for the INCOSE Polish Chapter 20220310
IncQuery Group's presentation for the INCOSE Polish Chapter 20220310
 
Infrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentInfrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload Deployment
 
Magdalena Stenius: MLOPS Will Change Machine Learning
Magdalena Stenius: MLOPS Will Change Machine LearningMagdalena Stenius: MLOPS Will Change Machine Learning
Magdalena Stenius: MLOPS Will Change Machine Learning
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
 
WDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptxWDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptx
 
The REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloudThe REMICS model-driven process for migrating legacy applications to the cloud
The REMICS model-driven process for migrating legacy applications to the cloud
 

Mais de Sotrender

How to deal with nested lists in R?
How to deal with nested lists in R? How to deal with nested lists in R?
How to deal with nested lists in R? Sotrender
 
Transfer learning in NLP
Transfer learning in NLPTransfer learning in NLP
Transfer learning in NLPSotrender
 
Handling problem of hand-labeled training data with data programming and weak...
Handling problem of hand-labeled training data with data programming and weak...Handling problem of hand-labeled training data with data programming and weak...
Handling problem of hand-labeled training data with data programming and weak...Sotrender
 
State of the art as to content creation using AI
State of the art as to content creation using AIState of the art as to content creation using AI
State of the art as to content creation using AISotrender
 
Paid communication analysis on Facebook. Reach and cost estimations report.
Paid communication analysis on Facebook. Reach and cost estimations report.Paid communication analysis on Facebook. Reach and cost estimations report.
Paid communication analysis on Facebook. Reach and cost estimations report.Sotrender
 
People interest analysis on Facebook.
People interest analysis on Facebook.People interest analysis on Facebook.
People interest analysis on Facebook.Sotrender
 
Brands image across the internet including social media
Brands image across the internet including social mediaBrands image across the internet including social media
Brands image across the internet including social mediaSotrender
 
Audience Scan report based on social media data
Audience Scan report based on social media dataAudience Scan report based on social media data
Audience Scan report based on social media dataSotrender
 
Fanpage Trends UK October 2016
Fanpage Trends UK October 2016Fanpage Trends UK October 2016
Fanpage Trends UK October 2016Sotrender
 
Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?
Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?
Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?Sotrender
 
Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...
Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...
Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...Sotrender
 
10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy
10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy 10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy
10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy Sotrender
 
Naked truth about porn on social media
Naked truth about porn on social mediaNaked truth about porn on social media
Naked truth about porn on social mediaSotrender
 
Posting frequency on Facebook
Posting frequency on FacebookPosting frequency on Facebook
Posting frequency on FacebookSotrender
 
Conservatives in the social media
Conservatives in the social mediaConservatives in the social media
Conservatives in the social mediaSotrender
 
Who would win the Oscars in Social Media?
Who would win the Oscars in Social Media?Who would win the Oscars in Social Media?
Who would win the Oscars in Social Media?Sotrender
 
How brands can benefit from Super Bowl by using social media
How brands can benefit from Super Bowl by using social mediaHow brands can benefit from Super Bowl by using social media
How brands can benefit from Super Bowl by using social mediaSotrender
 
Social media analytics - Sotrender training in Jakarta, Indonesia
Social media analytics - Sotrender training in Jakarta, Indonesia Social media analytics - Sotrender training in Jakarta, Indonesia
Social media analytics - Sotrender training in Jakarta, Indonesia Sotrender
 
What should we say to engage thousands?
What should we say to engage thousands?What should we say to engage thousands?
What should we say to engage thousands?Sotrender
 

Mais de Sotrender (19)

How to deal with nested lists in R?
How to deal with nested lists in R? How to deal with nested lists in R?
How to deal with nested lists in R?
 
Transfer learning in NLP
Transfer learning in NLPTransfer learning in NLP
Transfer learning in NLP
 
Handling problem of hand-labeled training data with data programming and weak...
Handling problem of hand-labeled training data with data programming and weak...Handling problem of hand-labeled training data with data programming and weak...
Handling problem of hand-labeled training data with data programming and weak...
 
State of the art as to content creation using AI
State of the art as to content creation using AIState of the art as to content creation using AI
State of the art as to content creation using AI
 
Paid communication analysis on Facebook. Reach and cost estimations report.
Paid communication analysis on Facebook. Reach and cost estimations report.Paid communication analysis on Facebook. Reach and cost estimations report.
Paid communication analysis on Facebook. Reach and cost estimations report.
 
People interest analysis on Facebook.
People interest analysis on Facebook.People interest analysis on Facebook.
People interest analysis on Facebook.
 
Brands image across the internet including social media
Brands image across the internet including social mediaBrands image across the internet including social media
Brands image across the internet including social media
 
Audience Scan report based on social media data
Audience Scan report based on social media dataAudience Scan report based on social media data
Audience Scan report based on social media data
 
Fanpage Trends UK October 2016
Fanpage Trends UK October 2016Fanpage Trends UK October 2016
Fanpage Trends UK October 2016
 
Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?
Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?
Insighty z social media - jak je wyciągnąć i dlaczego nie zawsze ma to sens?
 
Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...
Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...
Tego się nie da odzobaczyć - czego dowiedzieliśmy się o gustach Polaków przez...
 
10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy
10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy 10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy
10 narzędzi dla marketerów, które wykorzystasz w codziennej pracy
 
Naked truth about porn on social media
Naked truth about porn on social mediaNaked truth about porn on social media
Naked truth about porn on social media
 
Posting frequency on Facebook
Posting frequency on FacebookPosting frequency on Facebook
Posting frequency on Facebook
 
Conservatives in the social media
Conservatives in the social mediaConservatives in the social media
Conservatives in the social media
 
Who would win the Oscars in Social Media?
Who would win the Oscars in Social Media?Who would win the Oscars in Social Media?
Who would win the Oscars in Social Media?
 
How brands can benefit from Super Bowl by using social media
How brands can benefit from Super Bowl by using social mediaHow brands can benefit from Super Bowl by using social media
How brands can benefit from Super Bowl by using social media
 
Social media analytics - Sotrender training in Jakarta, Indonesia
Social media analytics - Sotrender training in Jakarta, Indonesia Social media analytics - Sotrender training in Jakarta, Indonesia
Social media analytics - Sotrender training in Jakarta, Indonesia
 
What should we say to engage thousands?
What should we say to engage thousands?What should we say to engage thousands?
What should we say to engage thousands?
 

Último

BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 

Último (20)

E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 

Training and deploying ML models with Google Cloud Platform

  • 1. Training and deploying ML models with Google Cloud Platform Maciej Pieńkosz Data Science Summit 2020 1
  • 2. ML in Sotrender • Sotrender - a platform for analyzing comunication on your Social Media • Our models: – Sentiment – Hatespeech – Topic modelling – Keyphrase extractor – NER (brands and products) – Image Tagger – Logo Detector – …. 2
  • 4. Modeling with AI Notebooks 1. AI Platform Notebooks is used for initial data exploration and modeling 2. Allows to quickly start working on new problem without worrying about infrostructure 3. For the start, we favor faster, simpler model architectures that can be easily built, validated, iterated and eventually deployed (usually on CPU) 4. Experiment tracking: MlFlow 4 https://databricks.com/blog/2018/06/05/introducing-mlflow-an-open-source-machine-learning-platform.html https://cloud.google.com/ai-platform-notebooks?hl=id
  • 5. Structuring training code • Notebooks disadvantages: – You pay for the whole time the notebook is running – Code quality is usually lower – Hard to parametrize, unit test, and review • After initial experimentation phase, we try to give more structure to the model training code: – Refactor codebase to Python packages and modules and move to git repository (Gitlab) – Add tests (more on it later) – Wrap code into a Docker container – Use dedicated AI Platform Training service to train in the cloud 5 https://www.jeremyjordan.me/ml-projects-guide/
  • 6. AI Platform Training with custom containers 6 • Advantages: – Develop locally, train in the cloud – We are billed only for the actual training time – Broad hardware configuration options (e.g. GPU type) – Job statuses and logs for historical runs are available in the dashboard – Support for hyperparameter tuning almost out-of-the box Training job dockerfile Cloud training script
  • 7. Google Storage for Models and Datasets • We use Google Storage as primary Store for models and datasets • One bucket per model • We follow strict, unified bucket, directory and file structure, same for every model – Raw data – Combined datasets, with predefined splits – Model files • Documentation in Knowledge Base (Confluence) • One can use dedicated systems like DVC, Quilt 7
  • 8. Model deployment • Your options: – Online – Batch (offline) • Our approach is to deploy models as services – Easy to integrate – Easy to use by other teams • We serve them as REST service with Flask (or, most recently, FastApi) • We wrap them in Docker containers so they can be easily deployed to cloud and serve with Cloud Run 8 https://mlinproduction.com/batch-inference-vs-online-inference/ Online inference Batch inference
  • 9. Cloud Deployment: Cloud Run • We use Cloud Run to deploy our model services • Cloud Build for delegating build process to GCP • GCP has dedicated service for serving models, AI Platform Prediction, but we use Cloud Run – It is more flexible for us, we can set up any environment and add any dependencies – AI Predictions has limits regarding model size – We can add additional endpoints (e.g. /explain to services) 9 Service dockerfile Cloud deployment script
  • 10. Cloud Run c.d. • Useful features out-of-the box – Autoscaling – Multiple Revisions (versions), easy Rollback – Traffic management – Multiple Namespaces (dev, prod) – Resource Monitoring 10
  • 11. Delivery pipeline automation (CI/CD) 11 • Configured for the models that we use on bigger, production scale • Implemented in Gitlab CI/CD push Download files Build image Run tests Run static analysis Push image to registry Code Review Canary rollout deploy
  • 12. Monitoring • System level metrics: – Resource consumption (RAM, CPU), healthchecks, status codes, latency, etc. • Data level metrics – Prediction distributions, input data distributions – System performance against real time labels (collected automatically or manually) 12 https://mlinproduction.com/
  • 13. Streamlit • https://www.streamlit.io/ • Easy tool to create simple web Data Products directly in Python • You can use it to create Demos, share your work, showcase your models behaviour, debug • Very intuitive, no Web skills required 13 https://towardsdatascience.com/coding-ml-tools-like-you-code-ml-models-ddba3357eace