SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Stavros Kontopoulos, Lightbend
ML At the Edge:
Building Your Production
Pipeline With Apache
Spark and Tensorflow
#SAISML9
Agenda
• Edge computing today – a review
• Machine learning at the edge
• ML model training/serving techniques with TF,
Spark etc.
• Production Pipeline Architecture
2#SAISML9
https://bit.ly/2xIgKCH #s_kontopoulos
Internet of Everything
• Smart home
• Smart city
• Smart factory (industry 4)
• Wearables
• V2x
3#SAISML9
Cloud A
Cloud B
Remote
operations
MQTT/ CoAP
Bluetooth 5 PAN /
6lowpan
Backhaul
Zigbee
wearables
Smart City: surveillance, monitoring
WAN: 5G
cell / LTE
Internet
IEEE 802.11p
Smart is about…
• Moving from sensing to a system of cyber-
physical systems.
• Virtual and physical indicators and actuators
modify the physical and virtual environment
(autonomy).
• Machine Learning is an enabler for this.
4#SAISML9
Other cases
Improving technology:
• Smart mobile apps
• Intelligent drones
• Agents/personal assistants
Improving the Industry:
• Energy: smart meters, status prediction
• E-Health: patient monitoring
• Logistics: asset tracking
• Distributed business management: e.g. chain of stores
5#SAISML9
End-to-End Pipeline
6
Data
Sources
Edge
Node
Cloud
Latency
ns 100s of msms
bandwidth?
Aggregations, alerts
Analytics response
e.g. prediction
Storage
Analytics
bandwidth?
#SAISML9
Typical Requirements
• How fast I respond?
– A credit card transaction for example needs to finish
in several ms.
• What bandwidth do I have?
– Security cams deliver around 100GB/day/camera. A
connected car, several TBs.
7#SAISML9
Edge Computing
• Definition: “Optimizing applications by moving
parts of computation at the edge nodes where
physical world lies. Does not require a cloud
backend service.”
• Fog Computing?
– Consortium: https://www.openfogconsortium.org
8#SAISML9
Edge Computing - Processing
• Data analytics
– Preprocessing (filtering out, transformations,
aggregations, approximate counting etc)
– Alerting
• Machine Learning
– Model Serving
– Model training (less common)
9#SAISML9
Edge Computing - Benefits
• Reduced latency for real-time applications
• No single point of failure (eg. cloud
infrastructure)
• Efficient use of resources (bandwidth, storage)
• Better privacy control
• Reduction in costs and energy consumption
10#SAISML9
Edge Computing - Challenges
• Limited resources.
– Edge nodes cannot perform billions of floating points
operations to train a very complex deep learning
model. They cannot store TBs of data etc.
• Edge node interconnection. Information sharing.
11#SAISML9
Machine Learning At The Edge
Criteria for moving ML computation to the Edge:
– Data size
– Computational power
– Specialized hardware
Interesting scenarios:
– Per edge node ML model e.g. personal ML
– Distributed Local Learning
– Transfer Learning
12#SAISML9
Machine Learning At The Edge
• Different types of models required per use case.
– Manufacturing: Bayesian networks for fault
diagnosis, Uncertainty Quantification for
performance metrics. RNNs for signal analysis, fault
prediction.
– HealthCare: Decision trees, rule engines for health
prediction etc.
13#SAISML9
Machine Learning At The Edge
• Training:
– Random Forests (usually uses bagging, low
resources, mainly supervised learning)
– RNNs, CNNs difficult to train, mainly for inference
• Serving:
– Resource restrictions impose model compression
– Scoring may be problematic if requires intensive
computation
• 14#SAISML9
Machine Learning At The Edge
Drift Detection / Model Statistics examples:
– Use biased reservoir sampling for model re-training due to space
constraints
– Sample data changes and feed change means to a drift detector like
ADWIN.
Knowledge Discovery from Data Streams (Joao Gama, https://dl.acm.org/citation.cfm?id=1855075)
Tracking Drift Types in Changing Data Streams (https://rd.springer.com/chapter/10.1007/978-3-642-
53914-5_7)
Concept Drift: Monitoring Model Quality in Streaming ML Applications
(https://info.lightbend.com/webinar-concept-drift-monitoring-model-quality-in-streaming-ml-apps-
recording.html)
15#SAISML9
Model Size - Compression
• How can we deploy our models to edge nodes?
• Important for NNs. Several techniques like:
– Parameter pruning and sharing
– Quantization
– Knowledge transfer (student teacher paradigm)
Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and
Huffman Coding (https://arxiv.org/abs/1510.00149)
A Survey of Model Compression and Acceleration for Deep Neural Networks
(https://arxiv.org/abs/1710.09282)
16#SAISML9
Model Formats
• Generic
– PMML/ PFA (also for backend services)
• Optimized for the edge
– CoreML, TFLite, Google ML kit (Learn2Compress).
17#SAISML9
Training/Serving Techniques at
the Edge and more…
• Tensorflow flavors: TFlite, TF.js
• Smile for the jvm
• Performance Evaluation
• Spark for distributed training etc
18#SAISML9
Keras/Tensorflow
Build the model (Iris dataset):
19#SAISML9
Keras to TF
20#SAISML9
Keras to TFLite
21
Tip: On android make sure the model is not stored compressed in your assets.
#SAISML9
TFLite on Android
22#SAISML9
TFLite
• Uses Quantization and other techniques for
model compression.
• Does not support training on the mobile device:
– Training on device:
https://github.com/tensorflow/tensorflow/issues/17328
– It could be possible to train a model offline, and re-train it
on the device (C++ API).
23#SAISML9
TFLite
• LSTM (RNNs)?
No out of the box: https://github.com/tensorflow/tensorflow/issues/15805
24#SAISML9
TFLite – Local test
25#SAISML9
Tensorflow.JS
Easy to use for both training and serving
(A WebGL accelerated framework).
26#SAISML9
Tensorflow.JS – Tips
• Run a local server for quick testing
– eg. python –m SimpleHTTPServer
• Chrome developer tools -> remote devices is
your friend for debugging on the mobile browser
and check js errors.
• Check your browser support for js.
27#SAISML9
Smile On Android
Machine Learning Lib (https://haifengl.github.io/smile) with Scala, Java support. Easy to
use. Uses Xstream for serialization, models can be used by Spark for scoring.
28#SAISML9
Performance Evaluation
• Relative performance matters more than absolute numbers here,
but it depends on the SLA for a real scenario.
• Average prediction time for TFlite for the minimal example (NN)
~15ms.
• TF.js prediction time around 300ms for the same NN model.
– On laptop: ~100ms
• Average prediction time for RF with Smile: ~1ms.
– Model construction 1s.
– On laptop: 0.1ms prediction time and model build 100ms.
• Tests on Huawei P20. Results vary with the device!
29#SAISML9
Spark for Model Training/Serving
• MLlib for model training:
– Parallel training of models
– Distributed training of one model
– Spark ML pipelines export formats (new in 2.4):
https://issues.apache.org/jira/browse/SPARK-11239
– Future: Project Hydrogen?
• Serving of models:
– Directly with Spark Deep Learning
– Custom sink + structured streaming?
30#SAISML9
Spark Tensorflow Connector
• Part of the data cleaning/transformation can be
done in Spark before fed to TF.
• Uses dataframes to write TF records at the final
step.
• tf.TFRecordReader() + a graph can be used to
build a model for further processing.
31#SAISML9
Production Pipeline Architecture
32#SAISML9
Cloud
Kubernetes
Cluster
Local
Kubernetes
Cluster
(optional)
Edge
Nodes /
Sensors
Istio for multi-cluster
Service/Network
Management
Analytics:
- Kafka (Strimzi)
- Kubeflow
- Spark / Spark
Operator
microservices
analytics
microservices
analytics
Storage/
PVs
CI/CD
CI/CD
Multi-cluster setup
Why Kubeflow?
• Manages TF distributed training, serving and
hyperparameter tuning in a declerative way: TFjobs.
• Easy access for data scientists with Jyputer notebook
integration.
• Integration with Istio (https://istio.io/) for metrics and A/B
testing.
• MXNet, PyTorch, MPI support (Horovod).
• Maturity?
33#SAISML9
Kubeflow Tips
• Configuration is passed via TF_CONFIG var.
– image entrypoint needs to pass info for parameter
servers, worker hosts to your TF code:
(https://github.com/kubeflow/kubeflow/blob/master/tf-
controller-examples/tf-cnn/launcher.py).
• Use PVs for storing your models or your data.
• Plan for your resources like Gpus etc.
34#SAISML9
QUESTIONS?
35#SAISML9

Weitere ähnliche Inhalte

Was ist angesagt?

How To Reduce Application Support & Maintenance Cost
How To Reduce Application Support & Maintenance Cost How To Reduce Application Support & Maintenance Cost
How To Reduce Application Support & Maintenance Cost
HCL Technologies
 

Was ist angesagt? (17)

CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
 
Using FMI (Functional Mock-up Interface) for MBSE at all steps of System Design
Using FMI (Functional Mock-up Interface) for MBSE at all steps of System DesignUsing FMI (Functional Mock-up Interface) for MBSE at all steps of System Design
Using FMI (Functional Mock-up Interface) for MBSE at all steps of System Design
 
Webinar Presentation: Diagnostic Flash Application with OTX
Webinar Presentation: Diagnostic Flash Application with OTXWebinar Presentation: Diagnostic Flash Application with OTX
Webinar Presentation: Diagnostic Flash Application with OTX
 
Mule esb presentation
Mule esb presentationMule esb presentation
Mule esb presentation
 
Falcon heavy Reusable Launch Vehicle- SpaceX
Falcon heavy Reusable Launch Vehicle- SpaceXFalcon heavy Reusable Launch Vehicle- SpaceX
Falcon heavy Reusable Launch Vehicle- SpaceX
 
Automating 1D/3D CFD analysis workflows – Speed up design exploration of a Y-...
Automating 1D/3D CFD analysis workflows – Speed up design exploration of a Y-...Automating 1D/3D CFD analysis workflows – Speed up design exploration of a Y-...
Automating 1D/3D CFD analysis workflows – Speed up design exploration of a Y-...
 
OIF Workshop at NGON & DCI World 2022
OIF Workshop at NGON & DCI World 2022OIF Workshop at NGON & DCI World 2022
OIF Workshop at NGON & DCI World 2022
 
Big data sap hana goto market strategy
Big data   sap hana goto market strategyBig data   sap hana goto market strategy
Big data sap hana goto market strategy
 
Cloud-based Data Stream Processing
Cloud-based Data Stream ProcessingCloud-based Data Stream Processing
Cloud-based Data Stream Processing
 
How To Reduce Application Support & Maintenance Cost
How To Reduce Application Support & Maintenance Cost How To Reduce Application Support & Maintenance Cost
How To Reduce Application Support & Maintenance Cost
 
Ericsson Lean Carrier
Ericsson Lean CarrierEricsson Lean Carrier
Ericsson Lean Carrier
 
SAP for Beginners
SAP for BeginnersSAP for Beginners
SAP for Beginners
 
Human Resource Optimization At Workplace PowerPoint Presentation Slides
Human Resource Optimization At Workplace PowerPoint Presentation SlidesHuman Resource Optimization At Workplace PowerPoint Presentation Slides
Human Resource Optimization At Workplace PowerPoint Presentation Slides
 
Network Slicing overview_v6
Network Slicing overview_v6Network Slicing overview_v6
Network Slicing overview_v6
 
SAP Business One for Equipment Rental Business
SAP Business One for Equipment Rental BusinessSAP Business One for Equipment Rental Business
SAP Business One for Equipment Rental Business
 
IP RAN 100NGN
IP RAN 100NGNIP RAN 100NGN
IP RAN 100NGN
 
Agile + ISO 26262: Using Agile in Automotive Development
Agile + ISO 26262: Using Agile in Automotive DevelopmentAgile + ISO 26262: Using Agile in Automotive Development
Agile + ISO 26262: Using Agile in Automotive Development
 

Ähnlich wie ML at the Edge: Building Your Production Pipeline with Apache Spark and TensorFlow with Stavros Kontopoulos

Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Databricks
 

Ähnlich wie ML at the Edge: Building Your Production Pipeline with Apache Spark and TensorFlow with Stavros Kontopoulos (20)

Analytics, Big Data and Nonvolatile Memory Architectures – Why you Should Car...
Analytics, Big Data and Nonvolatile Memory Architectures – Why you Should Car...Analytics, Big Data and Nonvolatile Memory Architectures – Why you Should Car...
Analytics, Big Data and Nonvolatile Memory Architectures – Why you Should Car...
 
FUNDAMENTALS OF COMPUTER DESIGN
FUNDAMENTALS OF COMPUTER DESIGNFUNDAMENTALS OF COMPUTER DESIGN
FUNDAMENTALS OF COMPUTER DESIGN
 
Machine learning at scale challenges and solutions
Machine learning at scale challenges and solutionsMachine learning at scale challenges and solutions
Machine learning at scale challenges and solutions
 
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
New Business Applications Powered by In-Memory Technology @MIT Forum for Supp...
 
IBM Data Centric Systems & OpenPOWER
IBM Data Centric Systems & OpenPOWERIBM Data Centric Systems & OpenPOWER
IBM Data Centric Systems & OpenPOWER
 
Elastify Cloud-Native Spark Application with Persistent Memory
Elastify Cloud-Native Spark Application with Persistent MemoryElastify Cloud-Native Spark Application with Persistent Memory
Elastify Cloud-Native Spark Application with Persistent Memory
 
Near Data Computing Architectures: Opportunities and Challenges for Apache Spark
Near Data Computing Architectures: Opportunities and Challenges for Apache SparkNear Data Computing Architectures: Opportunities and Challenges for Apache Spark
Near Data Computing Architectures: Opportunities and Challenges for Apache Spark
 
Near Data Computing Architectures for Apache Spark: Challenges and Opportunit...
Near Data Computing Architectures for Apache Spark: Challenges and Opportunit...Near Data Computing Architectures for Apache Spark: Challenges and Opportunit...
Near Data Computing Architectures for Apache Spark: Challenges and Opportunit...
 
Performance Characterization and Optimization of In-Memory Data Analytics on ...
Performance Characterization and Optimization of In-Memory Data Analytics on ...Performance Characterization and Optimization of In-Memory Data Analytics on ...
Performance Characterization and Optimization of In-Memory Data Analytics on ...
 
OpenPOWER Webinar
OpenPOWER Webinar OpenPOWER Webinar
OpenPOWER Webinar
 
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
 
IBM Cloud Côte d'Azur Meetup - 20190328 - Optimisation
IBM Cloud Côte d'Azur Meetup - 20190328 - OptimisationIBM Cloud Côte d'Azur Meetup - 20190328 - Optimisation
IBM Cloud Côte d'Azur Meetup - 20190328 - Optimisation
 
Cloud nativecomputingtechnologysupportinghpc cognitiveworkflows
Cloud nativecomputingtechnologysupportinghpc cognitiveworkflowsCloud nativecomputingtechnologysupportinghpc cognitiveworkflows
Cloud nativecomputingtechnologysupportinghpc cognitiveworkflows
 
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
Using Spark Mllib Models in a Production Training and Serving Platform: Exper...
 
R2RML-F: Towards Sharing and Executing Domain Logic in R2RML Mappings
R2RML-F: Towards Sharing and Executing Domain Logic in R2RML MappingsR2RML-F: Towards Sharing and Executing Domain Logic in R2RML Mappings
R2RML-F: Towards Sharing and Executing Domain Logic in R2RML Mappings
 
Lessons Learned on Benchmarking Big Data Platforms
Lessons Learned on Benchmarking  Big Data PlatformsLessons Learned on Benchmarking  Big Data Platforms
Lessons Learned on Benchmarking Big Data Platforms
 
Mauricio breteernitiz hpc-exascale-iscte
Mauricio breteernitiz hpc-exascale-iscteMauricio breteernitiz hpc-exascale-iscte
Mauricio breteernitiz hpc-exascale-iscte
 
Opnet tutorial
Opnet tutorialOpnet tutorial
Opnet tutorial
 
Deep Learning with Spark and GPUs
Deep Learning with Spark and GPUsDeep Learning with Spark and GPUs
Deep Learning with Spark and GPUs
 
Exascale Capabl
Exascale CapablExascale Capabl
Exascale Capabl
 

Mehr von Databricks

Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
Databricks
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
Databricks
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Databricks
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
Databricks
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
Databricks
 

Mehr von Databricks (20)

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptx
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data Science
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML Monitoring
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature Aggregations
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta Lake
 

Kürzlich hochgeladen

Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 

ML at the Edge: Building Your Production Pipeline with Apache Spark and TensorFlow with Stavros Kontopoulos

  • 1. Stavros Kontopoulos, Lightbend ML At the Edge: Building Your Production Pipeline With Apache Spark and Tensorflow #SAISML9
  • 2. Agenda • Edge computing today – a review • Machine learning at the edge • ML model training/serving techniques with TF, Spark etc. • Production Pipeline Architecture 2#SAISML9 https://bit.ly/2xIgKCH #s_kontopoulos
  • 3. Internet of Everything • Smart home • Smart city • Smart factory (industry 4) • Wearables • V2x 3#SAISML9 Cloud A Cloud B Remote operations MQTT/ CoAP Bluetooth 5 PAN / 6lowpan Backhaul Zigbee wearables Smart City: surveillance, monitoring WAN: 5G cell / LTE Internet IEEE 802.11p
  • 4. Smart is about… • Moving from sensing to a system of cyber- physical systems. • Virtual and physical indicators and actuators modify the physical and virtual environment (autonomy). • Machine Learning is an enabler for this. 4#SAISML9
  • 5. Other cases Improving technology: • Smart mobile apps • Intelligent drones • Agents/personal assistants Improving the Industry: • Energy: smart meters, status prediction • E-Health: patient monitoring • Logistics: asset tracking • Distributed business management: e.g. chain of stores 5#SAISML9
  • 6. End-to-End Pipeline 6 Data Sources Edge Node Cloud Latency ns 100s of msms bandwidth? Aggregations, alerts Analytics response e.g. prediction Storage Analytics bandwidth? #SAISML9
  • 7. Typical Requirements • How fast I respond? – A credit card transaction for example needs to finish in several ms. • What bandwidth do I have? – Security cams deliver around 100GB/day/camera. A connected car, several TBs. 7#SAISML9
  • 8. Edge Computing • Definition: “Optimizing applications by moving parts of computation at the edge nodes where physical world lies. Does not require a cloud backend service.” • Fog Computing? – Consortium: https://www.openfogconsortium.org 8#SAISML9
  • 9. Edge Computing - Processing • Data analytics – Preprocessing (filtering out, transformations, aggregations, approximate counting etc) – Alerting • Machine Learning – Model Serving – Model training (less common) 9#SAISML9
  • 10. Edge Computing - Benefits • Reduced latency for real-time applications • No single point of failure (eg. cloud infrastructure) • Efficient use of resources (bandwidth, storage) • Better privacy control • Reduction in costs and energy consumption 10#SAISML9
  • 11. Edge Computing - Challenges • Limited resources. – Edge nodes cannot perform billions of floating points operations to train a very complex deep learning model. They cannot store TBs of data etc. • Edge node interconnection. Information sharing. 11#SAISML9
  • 12. Machine Learning At The Edge Criteria for moving ML computation to the Edge: – Data size – Computational power – Specialized hardware Interesting scenarios: – Per edge node ML model e.g. personal ML – Distributed Local Learning – Transfer Learning 12#SAISML9
  • 13. Machine Learning At The Edge • Different types of models required per use case. – Manufacturing: Bayesian networks for fault diagnosis, Uncertainty Quantification for performance metrics. RNNs for signal analysis, fault prediction. – HealthCare: Decision trees, rule engines for health prediction etc. 13#SAISML9
  • 14. Machine Learning At The Edge • Training: – Random Forests (usually uses bagging, low resources, mainly supervised learning) – RNNs, CNNs difficult to train, mainly for inference • Serving: – Resource restrictions impose model compression – Scoring may be problematic if requires intensive computation • 14#SAISML9
  • 15. Machine Learning At The Edge Drift Detection / Model Statistics examples: – Use biased reservoir sampling for model re-training due to space constraints – Sample data changes and feed change means to a drift detector like ADWIN. Knowledge Discovery from Data Streams (Joao Gama, https://dl.acm.org/citation.cfm?id=1855075) Tracking Drift Types in Changing Data Streams (https://rd.springer.com/chapter/10.1007/978-3-642- 53914-5_7) Concept Drift: Monitoring Model Quality in Streaming ML Applications (https://info.lightbend.com/webinar-concept-drift-monitoring-model-quality-in-streaming-ml-apps- recording.html) 15#SAISML9
  • 16. Model Size - Compression • How can we deploy our models to edge nodes? • Important for NNs. Several techniques like: – Parameter pruning and sharing – Quantization – Knowledge transfer (student teacher paradigm) Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding (https://arxiv.org/abs/1510.00149) A Survey of Model Compression and Acceleration for Deep Neural Networks (https://arxiv.org/abs/1710.09282) 16#SAISML9
  • 17. Model Formats • Generic – PMML/ PFA (also for backend services) • Optimized for the edge – CoreML, TFLite, Google ML kit (Learn2Compress). 17#SAISML9
  • 18. Training/Serving Techniques at the Edge and more… • Tensorflow flavors: TFlite, TF.js • Smile for the jvm • Performance Evaluation • Spark for distributed training etc 18#SAISML9
  • 19. Keras/Tensorflow Build the model (Iris dataset): 19#SAISML9
  • 21. Keras to TFLite 21 Tip: On android make sure the model is not stored compressed in your assets. #SAISML9
  • 23. TFLite • Uses Quantization and other techniques for model compression. • Does not support training on the mobile device: – Training on device: https://github.com/tensorflow/tensorflow/issues/17328 – It could be possible to train a model offline, and re-train it on the device (C++ API). 23#SAISML9
  • 24. TFLite • LSTM (RNNs)? No out of the box: https://github.com/tensorflow/tensorflow/issues/15805 24#SAISML9
  • 25. TFLite – Local test 25#SAISML9
  • 26. Tensorflow.JS Easy to use for both training and serving (A WebGL accelerated framework). 26#SAISML9
  • 27. Tensorflow.JS – Tips • Run a local server for quick testing – eg. python –m SimpleHTTPServer • Chrome developer tools -> remote devices is your friend for debugging on the mobile browser and check js errors. • Check your browser support for js. 27#SAISML9
  • 28. Smile On Android Machine Learning Lib (https://haifengl.github.io/smile) with Scala, Java support. Easy to use. Uses Xstream for serialization, models can be used by Spark for scoring. 28#SAISML9
  • 29. Performance Evaluation • Relative performance matters more than absolute numbers here, but it depends on the SLA for a real scenario. • Average prediction time for TFlite for the minimal example (NN) ~15ms. • TF.js prediction time around 300ms for the same NN model. – On laptop: ~100ms • Average prediction time for RF with Smile: ~1ms. – Model construction 1s. – On laptop: 0.1ms prediction time and model build 100ms. • Tests on Huawei P20. Results vary with the device! 29#SAISML9
  • 30. Spark for Model Training/Serving • MLlib for model training: – Parallel training of models – Distributed training of one model – Spark ML pipelines export formats (new in 2.4): https://issues.apache.org/jira/browse/SPARK-11239 – Future: Project Hydrogen? • Serving of models: – Directly with Spark Deep Learning – Custom sink + structured streaming? 30#SAISML9
  • 31. Spark Tensorflow Connector • Part of the data cleaning/transformation can be done in Spark before fed to TF. • Uses dataframes to write TF records at the final step. • tf.TFRecordReader() + a graph can be used to build a model for further processing. 31#SAISML9
  • 32. Production Pipeline Architecture 32#SAISML9 Cloud Kubernetes Cluster Local Kubernetes Cluster (optional) Edge Nodes / Sensors Istio for multi-cluster Service/Network Management Analytics: - Kafka (Strimzi) - Kubeflow - Spark / Spark Operator microservices analytics microservices analytics Storage/ PVs CI/CD CI/CD Multi-cluster setup
  • 33. Why Kubeflow? • Manages TF distributed training, serving and hyperparameter tuning in a declerative way: TFjobs. • Easy access for data scientists with Jyputer notebook integration. • Integration with Istio (https://istio.io/) for metrics and A/B testing. • MXNet, PyTorch, MPI support (Horovod). • Maturity? 33#SAISML9
  • 34. Kubeflow Tips • Configuration is passed via TF_CONFIG var. – image entrypoint needs to pass info for parameter servers, worker hosts to your TF code: (https://github.com/kubeflow/kubeflow/blob/master/tf- controller-examples/tf-cnn/launcher.py). • Use PVs for storing your models or your data. • Plan for your resources like Gpus etc. 34#SAISML9