SlideShare a Scribd company logo
5/15/2017
Continuous Delivery Principles
for Machine Learning
Rajesh Muppalla
rajesh@indix.com
@codingnirvana
About Me
• Co-Founder, Indix
• From Chennai
◊ 200 miles to the east (and north) of Bangalore
◊ S Ramanujan (19th Century Mathematician), Sundar Pichai
◊ Three Seasons - Hot, Hotter, Hottest
• Previously
◊ ScaleByTheBay 2016 - Data Pipelines Panelist
◊ Microservices, Lambda Architecture
• Ex-Thoughtworks
◊ Tech Lead - Go-CD - an open source CI/CD Tool
5/15/2017
About Indix
Six Business Critical Indexes
People
Documents Businesses
Places Products
Connected
Devices
Enabling businesses to build
location-aware software.
~3.6 million websites use Google maps
Enabling businesses to build
product-aware software.
Indix catalogs over 2.1 billion product offers
Indix – the “Google Maps” of Products
Data Pipeline @ Indix
Crawling Pipeline
Data PipelineML
AggregateMatchStandardizeExtract AttributesClassifyDedupe
Parse
Crawl
Data
CrawlSeed
Brand & Retailer
Websites
Feeds Pipeline
Transform Clean Connect
Feed
Data
Brand & Retailer
Feeds
Indix Product
Catalog
Customizable
Feeds
Search &
Analytics
Index
Indexing PipelineReal Time
Index Analyze Derive Join
API
(Bulk &
Synchronous)
Product Data
Transformation
Service
E-Tailers & Marketplaces
Original Catalog
Title Brand Color Size
Product 1 Running Shoes Adidas Blk 9
Product 2 Yoga Pants Black 32
Product 3 Jacket TNF White
Enriched Catalog
Title Brand Color Size Material
Product 1 Running Shoes Adidas Black 9 US Leather
Product 2 Yoga Pants Lululemon Black 32"" Polyester
Product 3 Jacket The North Face White Leather
Ad Display & Exchange Platforms
• Advertisers - Standardize, Enrich and Augment Product Information for
better relevance
• Retailers - Enrich, Match and Normalize their catalog for better targeting of
native Ads
• Publishers - Classify and tag publisher site content
Data Scale @ Indix
2.1
Billion
Product
URLs 8 TB
HTML Data
Crawled
Daily
1B
Unique
Products
7000
Categories
120 B
Price
Points
3000
Sites
3/31/16
Auto Parsers to detect and extract
Product content from Web pages, using
Machine Vision algorithms
Predictive Scheduler for deciding
re-crawl frequency using various signals
like Seasonality, Product Type, Store
Multi-label classifier Categorizing products into
a hierarchical taxonomy using text information
Inferring Product vs Listing vs Other
Pages using either just URL patterns or
using Page Content
Adaptive Crawlers that modifies the
crawl rate based dynamic
characteristics like Site traffic, Number
of products, Robots.txt settings
Deep learning - Categorizing
products using Product images
Predicting which products are an
exact match or similar products
NER based Attribute extraction algorithm
that mines text like Title, Descriptions,
Specifications to build structured Key:Value
Attributes
Fusion/Enrichment - An algorithm
that uses the data to learn and build
golden product record using
disparate sources
Product Rank - algorithm that uses
multiple signals like product
popularity, price, data quality, store
popularity, brand popularity to build
dynamic relevance/rank score
Recommendation Engines that suggest
Tags where Product information can be
found on a web page
Deep learning - Extracting visual
product attributes using Product
images
NLG algorithms to generate product
descriptions
Product GPS - Universal Product
Identifier using machine learning
algorithms and allowing Search &
Discovery
ML @ Indix
ML @ Indix - Classification
ML @ Indix - Attribute Extraction
5/15/2017
Machine Learning Workflow
Define Business
Objective
Explore &
Transform
Pull and Acquire
Data
Develop Model
Evaluate Model
Meets
Business
Needs?
Build Production
System
DeployMeasure Metrics
Yes!
Not Yet!
Human in
the Loop
Machine Learning Workflow
Machine Learning Sandwich?*
* - https://techcrunch.com/2017/08/08/the-evolution-of-machine-learning/
Explore &
Transform
Pull and Acquire
Data
Deploy
Build Production
System
Develop Model
Model Evaluation &
Validation
The MEAT is not in the middle
Experts agree with us
D. Sculley, et al. Hidden technical debt in machine learning systems. In Neural Information Processing Systems (NIPS). 2015
Only a small fraction of real-world ML systems is a composed of ML code, as shown by the
small black box in the middle. The required surrounding infrastructure is fast and complex.
Different Skillsets
Explore &
Transform
Pull and Acquire
Data
Deploy
Build Production
System
Develop Model
Model Evaluation &
Validation
Data Pipelines
App
Model
Separate Talk
Explore &
Transform
Pull and Acquire
Data
My Talk
Explore &
Transform
Pull and Acquire
Data
Deploy
Build Production
System
Develop Model
Model Evaluation &
Validation
Focus of
this talk
Pain Points
● A key employee in the team had to abruptly go on leave
○ Unable to reproduce the performance of an existing production model
■ Training Data Missing/Not known
■ Scripts not there for Pre-processing
■ Hyperparameters not known
● It takes 3 Months to productionize a model
■ Lot of glue code
■ Custom code developed every time
■ Frequent updates to model takes long time
● Heterogeneous Systems
■ Eg. - Sharing stuff between Python and JVM
Reality
● Confidence in Test Set != Confidence in Production
■ Confidence of model performance on a sample set not good enough
Dejavu?
Continuous Delivery is a software engineering
approach that aims at building, testing and
releasing software faster and more frequently.
A straightforward and repeatable process is
important from continuous delivery
What is Continuous Delivery?
5/15/2017
Principles from CD in ML
Principle #1
Automation via CI + CD
pipelines Automation of ML Training,
Evaluation and Offline
Prediction Pipelines
Continuous Delivery
for
Software
Continuous Delivery
for
Machine Learning
Training Pipelines
● Training pipelines are modelled like a build pipeline
● Customized Go-CD, an open source CI & CD tool
● Created plugins to help us with our ML workflows
Pre-process Data
(Spark Job)
Build Model
(Python Script)
Evaluate Model
(Python)
Training Pipeline (3 Flavors)
Build Model
(Spark Job)
OR
Build Model
(Zeppelin Notebook)
OR
Training
Data
Go-CD - Demo
Principle #2
Source Code and
Artifact Repository
for
Reproducibility
Source Code, Data and
Model Repository
for
Reproducibility
Continuous Delivery
for
Software
Continuous Delivery
for
Machine Learning
Model Repository
● Similar to an artifact repository like Maven, Ivy
○ Directory Structure, Versioning, Publishing of models
● Has clients to publish models for most commonly used frameworks
○ scikit-learn, Spark MLLib, Keras
● For a model,
○ Data
■ Stored in S3
■ In Different formats
● Parquet (Spark MLLib), Scikit-Learn - Pickle, Keras - HDF5
○ Metadata
■ Training/Validation/Test Datasets
■ Hyper-parameters used
■ Evaluation Metrics
Model Repository
Pre-process Data
(Spark Job)
Build Model
(Python)
Evaluate Model
(Python)
Publish Model
Training Pipeline
Training
Data
Training
Data
Model Promotion
● Tagging the “latest good” version that needs to be deployed
● Not all models need/can be promoted
○ Experimental models
○ Models that fail the test set or performance/latency metrics
● Easy rollback - tag the “last good” version as the latest
Pre-process Data
(Spark Job)
Build Model
(Python)
Evaluate Model
(Python)
Publish Model Promote Model
Manual Stage
Training Pipeline
Principle #3
Containers
for
µServices
Model Containers
for
Model Prediction µServices
Continuous Delivery
for
Software
Continuous Delivery
for
Machine Learning
Model Container
● Hosts a single model to be used for predictions
● Exposes API for prediction and are “dockerized”
● Containers can be replicated to handle scale
● Two µServices
○ Scala
■ Handles pre-processing
○ Python
■ Loads model and exposes the predict on the model
■ Can also predict in batches for better throughput
■ Handles ensembles of models
○ Scala µservice delegates the predict and predict_batch functions to the
Python µservice
Model Container
Docker Host
Scala µService
predict(input)
predict_batch(inputs)
_preprocess(input)
Python µService
Model
Model
Model
predict(input)
predict_batch(inputs)
Create Docker
Image
(Docker)
Push to Docker
Registry
(Docker)
Publish Model Promote Model
Training
Pipeline
Model Deployment
● Two Modes - Offline (Batch) and/or Online
● Offline Mode
○ Package model containers into an AMI (Amazon Machine Image)
○ Start the container as part of your Spark/Hadoop clusters on the
Executors/Task Trackers
○ Within a job call the local Scala Service for prediction for each record
● Online Mode
○ Deploy the model containers into a Mesos + Marathon or a Kubernetes
cluster
○ (Auto) Scaling is managed by the cluster
Principle #4
A/B Testing
Using
Canary Releases
A/B Testing
Using
Request Shadowing
Continuous Delivery
for
Software
Continuous Delivery
for
Machine Learning
Model A/B Testing
● We don’t use Multi Armed Bandit Testing (MAB)
○ Reason - Payout is not easily measurable unlike CTR (for example)
● Instead we use Request Shadowing pattern
○ Input to both old and new both, but serve output only from old
○ Find deltas and do spot checking
● For Offline, we only do deltas + spot checking
● We have built an in-house data turking tool for spot checking
Spot Checking Example 1
Spot Checking Example 2
Future Work
● Lot more to be done
○ Support deep learning based models as a first class solution
○ Model Repository visualization
○ Add more plugins in Go-CD to better support ML workflows natively
● Open Source
○ Model Serving Repository + Clients (WIP)
Indix & Open Source
● oss.indix.com
Thank You
Questions

More Related Content

PDF
Lambda architecture @ Indix
Rajesh Muppalla
 
PPTX
Speed layer : Real time views in LAMBDA architecture
Tin Ho
 
PDF
Big data real time architectures
Daniel Marcous
 
PDF
Building real time data-driven products
Lars Albertsson
 
PDF
RUNNING A PETASCALE DATA SYSTEM: GOOD, BAD, AND UGLY CHOICES by Alexey Kharlamov
Big Data Spain
 
PDF
Introduction to Data Engineer and Data Pipeline at Credit OK
Kriangkrai Chaonithi
 
PDF
Big data serving: Processing and inference at scale in real time
Itai Yaffe
 
PPTX
Functional architectural patterns
Lars Albertsson
 
Lambda architecture @ Indix
Rajesh Muppalla
 
Speed layer : Real time views in LAMBDA architecture
Tin Ho
 
Big data real time architectures
Daniel Marcous
 
Building real time data-driven products
Lars Albertsson
 
RUNNING A PETASCALE DATA SYSTEM: GOOD, BAD, AND UGLY CHOICES by Alexey Kharlamov
Big Data Spain
 
Introduction to Data Engineer and Data Pipeline at Credit OK
Kriangkrai Chaonithi
 
Big data serving: Processing and inference at scale in real time
Itai Yaffe
 
Functional architectural patterns
Lars Albertsson
 

What's hot (20)

PDF
Modern ETL Pipelines with Change Data Capture
Databricks
 
PDF
Extracting Insights from Data at Twitter
Prasad Wagle
 
PDF
Data pipelines from zero to solid
Lars Albertsson
 
PDF
A primer on building real time data-driven products
Lars Albertsson
 
PDF
Superworkflow of Graph Neural Networks with K8S and Fugue
Databricks
 
PDF
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 
PDF
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Khai Tran
 
PPTX
Realtime streaming architecture in INFINARIO
Jozo Kovac
 
PDF
Data Policies for the Kafka-API with WebAssembly | Alexander Gallego, Vectorized
HostedbyConfluent
 
PDF
When Apache Spark Meets TiDB with Xiaoyu Ma
Databricks
 
PDF
Data Infrastructure for a World of Music
Lars Albertsson
 
PPTX
Challenges in Building a Data Pipeline
Manish Kumar
 
PPTX
Traveloka's journey to no ops streaming analytics
Rendy Bambang Junior
 
PDF
Lambda architecture for real time big data
Trieu Nguyen
 
PPTX
Quark Virtualization Engine for Analytics
DataWorks Summit/Hadoop Summit
 
ODP
Spline 0.3 User Guide
Vaclav Kosar
 
PDF
Cloud Lambda Architecture Patterns
Asis Mohanty
 
PDF
Spark summit 2017- Transforming B2B sales with Spark powered sales intelligence
Wei Di
 
PDF
How to Rebuild an End-to-End ML Pipeline with Databricks and Upwork with Than...
Databricks
 
PDF
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
HostedbyConfluent
 
Modern ETL Pipelines with Change Data Capture
Databricks
 
Extracting Insights from Data at Twitter
Prasad Wagle
 
Data pipelines from zero to solid
Lars Albertsson
 
A primer on building real time data-driven products
Lars Albertsson
 
Superworkflow of Graph Neural Networks with K8S and Fugue
Databricks
 
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 
Conquering the Lambda architecture in LinkedIn metrics platform with Apache C...
Khai Tran
 
Realtime streaming architecture in INFINARIO
Jozo Kovac
 
Data Policies for the Kafka-API with WebAssembly | Alexander Gallego, Vectorized
HostedbyConfluent
 
When Apache Spark Meets TiDB with Xiaoyu Ma
Databricks
 
Data Infrastructure for a World of Music
Lars Albertsson
 
Challenges in Building a Data Pipeline
Manish Kumar
 
Traveloka's journey to no ops streaming analytics
Rendy Bambang Junior
 
Lambda architecture for real time big data
Trieu Nguyen
 
Quark Virtualization Engine for Analytics
DataWorks Summit/Hadoop Summit
 
Spline 0.3 User Guide
Vaclav Kosar
 
Cloud Lambda Architecture Patterns
Asis Mohanty
 
Spark summit 2017- Transforming B2B sales with Spark powered sales intelligence
Wei Di
 
How to Rebuild an End-to-End ML Pipeline with Databricks and Upwork with Than...
Databricks
 
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
HostedbyConfluent
 
Ad

Viewers also liked (8)

PDF
Indix at Fifth Elephant 2015
Anu Hastings
 
PDF
Optimizing SlideShare for Twitter
Kevin Baldacci
 
PDF
Elegant Solutions For Everyday Python Problems - PyCon Canada 2017
Nina Zakharenko
 
PDF
Parquet Strata/Hadoop World, New York 2013
Julien Le Dem
 
PDF
Mining Functional Patterns
Debasish Ghosh
 
PDF
Democratization of Data @Indix
Manoj Mahalingam
 
PDF
Efficient Data Storage for Analytics with Apache Parquet 2.0
Cloudera, Inc.
 
PPTX
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Carol Smith
 
Indix at Fifth Elephant 2015
Anu Hastings
 
Optimizing SlideShare for Twitter
Kevin Baldacci
 
Elegant Solutions For Everyday Python Problems - PyCon Canada 2017
Nina Zakharenko
 
Parquet Strata/Hadoop World, New York 2013
Julien Le Dem
 
Mining Functional Patterns
Debasish Ghosh
 
Democratization of Data @Indix
Manoj Mahalingam
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Cloudera, Inc.
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
Carol Smith
 
Ad

Similar to Continuous delivery for machine learning (20)

PDF
Productionalizing Models through CI/CD Design with MLflow
Databricks
 
PDF
Ml ops intro session
Avinash Patil
 
PPTX
DevOps for Machine Learning overview en-us
eltonrodriguez11
 
PDF
Productionising Machine Learning Models
Tash Bickley
 
PPTX
Deploying ML models to production (frequently and safely) - PYCON 2018
David Tan
 
PDF
A survey on Machine Learning In Production (July 2018)
Arnab Biswas
 
PPTX
DevOps and Machine Learning (Geekwire Cloud Tech Summit)
Jasjeet Thind
 
PPTX
Deploying ML models in the enterprise
doppenhe
 
PDF
CD in Machine Learning Systems
Thoughtworks
 
PPTX
Why is dev ops for machine learning so different - dataxdays
Ryan Dawson
 
PDF
MACHINE LEARNING AUTOMATIONS PIPELINE WITH CI/CD
IRJET Journal
 
PPTX
Why do the majority of Data Science projects never make it to production?
Itai Yaffe
 
PDF
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Sotrender
 
PPTX
From Data Science to MLOps
Carl W. Handlin
 
PPTX
Integrating Machine Learning Capabilities into your team
Cameron Vetter
 
PDF
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
dtz001
 
PDF
Deployment Design Patterns - Deploying Machine Learning and Deep Learning Mod...
All Things Open
 
PDF
Continuous Delivery for Machine Learning
Thoughtworks
 
PPTX
Machine Learning Models: From Research to Production 6.13.18
Cloudera, Inc.
 
PDF
Infrastructure Agnostic Machine Learning Workload Deployment
Databricks
 
Productionalizing Models through CI/CD Design with MLflow
Databricks
 
Ml ops intro session
Avinash Patil
 
DevOps for Machine Learning overview en-us
eltonrodriguez11
 
Productionising Machine Learning Models
Tash Bickley
 
Deploying ML models to production (frequently and safely) - PYCON 2018
David Tan
 
A survey on Machine Learning In Production (July 2018)
Arnab Biswas
 
DevOps and Machine Learning (Geekwire Cloud Tech Summit)
Jasjeet Thind
 
Deploying ML models in the enterprise
doppenhe
 
CD in Machine Learning Systems
Thoughtworks
 
Why is dev ops for machine learning so different - dataxdays
Ryan Dawson
 
MACHINE LEARNING AUTOMATIONS PIPELINE WITH CI/CD
IRJET Journal
 
Why do the majority of Data Science projects never make it to production?
Itai Yaffe
 
Trenowanie i wdrażanie modeli uczenia maszynowego z wykorzystaniem Google Clo...
Sotrender
 
From Data Science to MLOps
Carl W. Handlin
 
Integrating Machine Learning Capabilities into your team
Cameron Vetter
 
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
dtz001
 
Deployment Design Patterns - Deploying Machine Learning and Deep Learning Mod...
All Things Open
 
Continuous Delivery for Machine Learning
Thoughtworks
 
Machine Learning Models: From Research to Production 6.13.18
Cloudera, Inc.
 
Infrastructure Agnostic Machine Learning Workload Deployment
Databricks
 

Recently uploaded (20)

PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Presentation about variables and constant.pptx
safalsingh810
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 

Continuous delivery for machine learning

  • 1. 5/15/2017 Continuous Delivery Principles for Machine Learning Rajesh Muppalla [email protected] @codingnirvana
  • 2. About Me • Co-Founder, Indix • From Chennai ◊ 200 miles to the east (and north) of Bangalore ◊ S Ramanujan (19th Century Mathematician), Sundar Pichai ◊ Three Seasons - Hot, Hotter, Hottest • Previously ◊ ScaleByTheBay 2016 - Data Pipelines Panelist ◊ Microservices, Lambda Architecture • Ex-Thoughtworks ◊ Tech Lead - Go-CD - an open source CI/CD Tool
  • 4. Six Business Critical Indexes People Documents Businesses Places Products Connected Devices
  • 5. Enabling businesses to build location-aware software. ~3.6 million websites use Google maps Enabling businesses to build product-aware software. Indix catalogs over 2.1 billion product offers Indix – the “Google Maps” of Products
  • 6. Data Pipeline @ Indix Crawling Pipeline Data PipelineML AggregateMatchStandardizeExtract AttributesClassifyDedupe Parse Crawl Data CrawlSeed Brand & Retailer Websites Feeds Pipeline Transform Clean Connect Feed Data Brand & Retailer Feeds Indix Product Catalog Customizable Feeds Search & Analytics Index Indexing PipelineReal Time Index Analyze Derive Join API (Bulk & Synchronous) Product Data Transformation Service
  • 7. E-Tailers & Marketplaces Original Catalog Title Brand Color Size Product 1 Running Shoes Adidas Blk 9 Product 2 Yoga Pants Black 32 Product 3 Jacket TNF White Enriched Catalog Title Brand Color Size Material Product 1 Running Shoes Adidas Black 9 US Leather Product 2 Yoga Pants Lululemon Black 32"" Polyester Product 3 Jacket The North Face White Leather
  • 8. Ad Display & Exchange Platforms • Advertisers - Standardize, Enrich and Augment Product Information for better relevance • Retailers - Enrich, Match and Normalize their catalog for better targeting of native Ads • Publishers - Classify and tag publisher site content
  • 9. Data Scale @ Indix 2.1 Billion Product URLs 8 TB HTML Data Crawled Daily 1B Unique Products 7000 Categories 120 B Price Points 3000 Sites
  • 10. 3/31/16 Auto Parsers to detect and extract Product content from Web pages, using Machine Vision algorithms Predictive Scheduler for deciding re-crawl frequency using various signals like Seasonality, Product Type, Store Multi-label classifier Categorizing products into a hierarchical taxonomy using text information Inferring Product vs Listing vs Other Pages using either just URL patterns or using Page Content Adaptive Crawlers that modifies the crawl rate based dynamic characteristics like Site traffic, Number of products, Robots.txt settings Deep learning - Categorizing products using Product images Predicting which products are an exact match or similar products NER based Attribute extraction algorithm that mines text like Title, Descriptions, Specifications to build structured Key:Value Attributes Fusion/Enrichment - An algorithm that uses the data to learn and build golden product record using disparate sources Product Rank - algorithm that uses multiple signals like product popularity, price, data quality, store popularity, brand popularity to build dynamic relevance/rank score Recommendation Engines that suggest Tags where Product information can be found on a web page Deep learning - Extracting visual product attributes using Product images NLG algorithms to generate product descriptions Product GPS - Universal Product Identifier using machine learning algorithms and allowing Search & Discovery ML @ Indix
  • 11. ML @ Indix - Classification
  • 12. ML @ Indix - Attribute Extraction
  • 14. Define Business Objective Explore & Transform Pull and Acquire Data Develop Model Evaluate Model Meets Business Needs? Build Production System DeployMeasure Metrics Yes! Not Yet! Human in the Loop Machine Learning Workflow
  • 15. Machine Learning Sandwich?* * - https://techcrunch.com/2017/08/08/the-evolution-of-machine-learning/ Explore & Transform Pull and Acquire Data Deploy Build Production System Develop Model Model Evaluation & Validation The MEAT is not in the middle
  • 16. Experts agree with us D. Sculley, et al. Hidden technical debt in machine learning systems. In Neural Information Processing Systems (NIPS). 2015 Only a small fraction of real-world ML systems is a composed of ML code, as shown by the small black box in the middle. The required surrounding infrastructure is fast and complex.
  • 17. Different Skillsets Explore & Transform Pull and Acquire Data Deploy Build Production System Develop Model Model Evaluation & Validation Data Pipelines App Model
  • 19. My Talk Explore & Transform Pull and Acquire Data Deploy Build Production System Develop Model Model Evaluation & Validation Focus of this talk
  • 20. Pain Points ● A key employee in the team had to abruptly go on leave ○ Unable to reproduce the performance of an existing production model ■ Training Data Missing/Not known ■ Scripts not there for Pre-processing ■ Hyperparameters not known ● It takes 3 Months to productionize a model ■ Lot of glue code ■ Custom code developed every time ■ Frequent updates to model takes long time ● Heterogeneous Systems ■ Eg. - Sharing stuff between Python and JVM
  • 21. Reality ● Confidence in Test Set != Confidence in Production ■ Confidence of model performance on a sample set not good enough
  • 23. Continuous Delivery is a software engineering approach that aims at building, testing and releasing software faster and more frequently. A straightforward and repeatable process is important from continuous delivery What is Continuous Delivery?
  • 25. Principle #1 Automation via CI + CD pipelines Automation of ML Training, Evaluation and Offline Prediction Pipelines Continuous Delivery for Software Continuous Delivery for Machine Learning
  • 26. Training Pipelines ● Training pipelines are modelled like a build pipeline ● Customized Go-CD, an open source CI & CD tool ● Created plugins to help us with our ML workflows Pre-process Data (Spark Job) Build Model (Python Script) Evaluate Model (Python) Training Pipeline (3 Flavors) Build Model (Spark Job) OR Build Model (Zeppelin Notebook) OR Training Data
  • 28. Principle #2 Source Code and Artifact Repository for Reproducibility Source Code, Data and Model Repository for Reproducibility Continuous Delivery for Software Continuous Delivery for Machine Learning
  • 29. Model Repository ● Similar to an artifact repository like Maven, Ivy ○ Directory Structure, Versioning, Publishing of models ● Has clients to publish models for most commonly used frameworks ○ scikit-learn, Spark MLLib, Keras ● For a model, ○ Data ■ Stored in S3 ■ In Different formats ● Parquet (Spark MLLib), Scikit-Learn - Pickle, Keras - HDF5 ○ Metadata ■ Training/Validation/Test Datasets ■ Hyper-parameters used ■ Evaluation Metrics
  • 30. Model Repository Pre-process Data (Spark Job) Build Model (Python) Evaluate Model (Python) Publish Model Training Pipeline Training Data
  • 31. Training Data Model Promotion ● Tagging the “latest good” version that needs to be deployed ● Not all models need/can be promoted ○ Experimental models ○ Models that fail the test set or performance/latency metrics ● Easy rollback - tag the “last good” version as the latest Pre-process Data (Spark Job) Build Model (Python) Evaluate Model (Python) Publish Model Promote Model Manual Stage Training Pipeline
  • 32. Principle #3 Containers for µServices Model Containers for Model Prediction µServices Continuous Delivery for Software Continuous Delivery for Machine Learning
  • 33. Model Container ● Hosts a single model to be used for predictions ● Exposes API for prediction and are “dockerized” ● Containers can be replicated to handle scale ● Two µServices ○ Scala ■ Handles pre-processing ○ Python ■ Loads model and exposes the predict on the model ■ Can also predict in batches for better throughput ■ Handles ensembles of models ○ Scala µservice delegates the predict and predict_batch functions to the Python µservice
  • 34. Model Container Docker Host Scala µService predict(input) predict_batch(inputs) _preprocess(input) Python µService Model Model Model predict(input) predict_batch(inputs) Create Docker Image (Docker) Push to Docker Registry (Docker) Publish Model Promote Model Training Pipeline
  • 35. Model Deployment ● Two Modes - Offline (Batch) and/or Online ● Offline Mode ○ Package model containers into an AMI (Amazon Machine Image) ○ Start the container as part of your Spark/Hadoop clusters on the Executors/Task Trackers ○ Within a job call the local Scala Service for prediction for each record ● Online Mode ○ Deploy the model containers into a Mesos + Marathon or a Kubernetes cluster ○ (Auto) Scaling is managed by the cluster
  • 36. Principle #4 A/B Testing Using Canary Releases A/B Testing Using Request Shadowing Continuous Delivery for Software Continuous Delivery for Machine Learning
  • 37. Model A/B Testing ● We don’t use Multi Armed Bandit Testing (MAB) ○ Reason - Payout is not easily measurable unlike CTR (for example) ● Instead we use Request Shadowing pattern ○ Input to both old and new both, but serve output only from old ○ Find deltas and do spot checking ● For Offline, we only do deltas + spot checking ● We have built an in-house data turking tool for spot checking
  • 40. Future Work ● Lot more to be done ○ Support deep learning based models as a first class solution ○ Model Repository visualization ○ Add more plugins in Go-CD to better support ML workflows natively ● Open Source ○ Model Serving Repository + Clients (WIP)
  • 41. Indix & Open Source ● oss.indix.com