SlideShare una empresa de Scribd logo
1 de 30
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Machine Learning Inference at the
Edge
Julien Simon
Principal Technical Evangelist, AI and Machine Learning
@julsimon
Agenda
• Deep Learning at the Edge?
• Apache MXNet
• Predicting in the Cloud or at the Edge?
• New services
• AWS Greengrass ML
• AWS DeepLens
• Resources
Deep Learning at the Edge?
Use Cases
Voice/sound
recognition
Collision
avoidance
Image
recognition
Anomaly
detection
More
!
Smart
Agriculture
Predictive
maintenance
Self-driving cars Video
surveillance
Robotics
Most machine data never reaches the cloud
Medical equipment Industrial machinery Extreme environments
Why this problem isn’t going away
Law of physics Law of economics Law of the land
Deep Learning challenges at the Edge
• Resource-constrained devices
• CPU, memory, storage, power consumption.
• Network connectivity
• Availability, cost, bandwidth, latency.
• On-device prediction may be the only option.
• Deployment
• Updating code and models on a fleet of devices
is not easy.
Deep Learning wishlist at the Edge
• Rely on cloud-based services for seamless training and deployment.
• Have the option to use cloud-based prediction.
• Be able to run device-based prediction with good performance.
• Support different technical environments (CPUs, languages).
Apache MXNet
Apache MXNet: Open Source library for Deep Learning
Programmable Portable High Performance
Near linear scaling
across hundreds of
GPUs
Highly efficient
models for
mobile
and IoT
Simple syntax,
multiple
languages
Most Open Best On AWS
Optimized for
Deep Learning on AWS
Accepted into the
Apache Incubator
Apache MXNet for IoT
1. Flexible experimentation in the Cloud.
2. Scalable training in the Cloud.
3. Good prediction performance at the Edge.
4. Prediction in the Cloud or at the Edge.
1 - Flexible experimentation in the Cloud
• API for Python, R, Perl, Matlab, Scala, C++.
• Gluon
• Imperative programming aka ‘define-by-run’.
• Inspect, debug and modify models during training.
• Extensive model zoo
• Pre-trained computer vision models
• DenseNet, SqueezeNet for resource-constrained devices.
Gluon CV: classification, detection, segmentation
https://github.com/dmlc/gluon-cv
[electric_guitar],
with probability 0.671
2 - Scalable training in the Cloud
Amazon SageMaker AWS Deep Learning AMI
Amazon EC2 c5 p3
3 - Good prediction performance at the Edge
• MXNet is written in C++.
• Gluon networks can be ‘hybridized’ for additional speed.
• Two libraries boost performance on CPU-only devices
• Fast implementation of math primitives
• Hardware-specific instructions, e.g. Intel AVX or ARM NEON
• Intel Math Kernel Library https://software.intel.com/en-us/mkl
• NNPACK https://github.com/Maratyszcza/NNPACK
• Mixed precision training
• Use float16 instead of float32 for weights and activations
• Almost 2x reduction in model size, no loss of accuracy, faster inference
• https://devblogs.nvidia.com/parallelforall/mixed-precision-training-deep-neural-networks/
4 - Predicting in the Cloud or at the Edge
• Cloud-based: invoke a Lambda function with AWS IoT.
• Cloud-based: invoke a SageMaker endpoint with HTTP.
• Device-based: bring your own code and model.
• Device-based: deploy your code and model with AWS Greengrass.
Invoking a Lambda function with AWS IoT
• Train a model in SageMaker (or bring your own).
• Host it in S3 (or embed it in a Lambda function).
• Write a Lambda function performing prediction.
• Invoke it through AWS IoT.
Best when
Devices can support neither HTTP nor local
inference (e.g. Arduino).
Costs must be kept as low as possible.
Requirements
Network is available and reliable
(MQTT is less demanding than HTTP).
Devices are provisioned in AWS IoT (certificate, keys).
https://aws.amazon.com/blogs/compute/seamlessly-scale-predictions-with-aws-lambda-and-mxnet/
Invoking a SageMaker endpoint with HTTP
• Train a model in SageMaker (or bring your own).
• Deploy it to a prediction endpoint.
• Invoke the HTTP endpoint from your devices.
Best when
Devices are not powerful enough for local inference.
Models can’t be easily deployed to devices.
Additional cloud-based data is required for prediction.
Prediction activity must be centralized.
Requirements
Network is available and reliable.
Devices support HTTP.
Bring your own code and model
• Train a model in SageMaker (or bring your own).
• Bring your own application code.
• Provision devices at manufacturing time
(or use your own update mechanism).
Best when
You don’t want to or can’t rely on cloud services
(no network connectivity?)
Requirements
Devices are powerful enough for local inference.
Models don’t need to be updated, if ever.
DIY!
Deploy your code and model with AWS Greengrass
• Train a model in SageMaker (or bring your own).
• Write a Lambda function performing prediction.
• Add both as resources in your Greengrass group.
• Let Greengrass handle deployment and updates.
Best when
You want the same programming model in the Cloud
and at the Edge.
Code and models need to be updated, even if
network connectivity is infrequent or unreliable.
One device in the group should be able to perform
prediction on behalf on other devices.
Requirements
Devices are powerful enough to run Greengrass
(XXX HW requirements)
Devices are provisioned in AWS IoT (certificate, keys).
ML Inference using AWS Greengrass
Deploy model
and Lambda
Send insights
Predict and take
actions locally on
device
AWS Cloud
AWS Greengrass ML
AWS DeepLens
AWS DeepLens
HD video camera
Custom-designed
Deep Learning
engine
Micro-SD
Mini-HDMI
USB
USB
Reset
Audio out
Power
HD video camera with
on-board compute
optimized for Deep
Learning
Tutorials, examples,
demos, and pre-built
models
From unboxing to
prediction in <10
minutes
Integrates with Amazon
SageMaker and AWS
Lambda
10
MIN
The world’s first Deep Learning-enabled video camera for developers
Get Started with Deep Learning
B u i l d c u s t o m D e e p L e a r n i n g m o d e l s i n t h e c l o u d u s i n g A m a z o n
S a g e M a k e r, o r u s e t h e c o l l e c t i o n o f p r e t r a i n e d m o d e l s i n c l u d e d w i t h
AW S D e e p L e n s
It takes less than 10 minutes with AWS DeepLens
AWS DeepLens
Object detection with AWS DeepLens
Resources
Resources
https://aws.amazon.com/machine-learning/amis/
https://mxnet.incubator.apache.org
http://gluon.mxnet.io
https://aws.amazon.com/sagemaker (free tier available)
https://github.com/awslabs/amazon-sagemaker-examples
https://aws.amazon.com/greengrass (free tier available)
https://aws.amazon.com/greengrass/ml/
https://aws.amazon.com/deeplens
https://medium.com/@julsimon
https://youtube.com/juliensimonfr
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Thank you!
Julien Simon, Principal AI/ML Evangelist, Amazon Web Services
@julsimon

Más contenido relacionado

La actualidad más candente

Accelerate your Machine Learning workflows with Amazon SageMaker
Accelerate your Machine Learning workflows with Amazon SageMakerAccelerate your Machine Learning workflows with Amazon SageMaker
Accelerate your Machine Learning workflows with Amazon SageMaker
Julien SIMON
 

La actualidad más candente (20)

FPGAs in the cloud? (October 2017)
FPGAs in the cloud? (October 2017)FPGAs in the cloud? (October 2017)
FPGAs in the cloud? (October 2017)
 
Scalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNetScalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNet
 
ECS for Amazon Deep Learning and Amazon Machine Learning
ECS for Amazon Deep Learning and Amazon Machine LearningECS for Amazon Deep Learning and Amazon Machine Learning
ECS for Amazon Deep Learning and Amazon Machine Learning
 
Amazon SageMaker을 통한 손쉬운 Jupyter Notebook 활용하기 - 윤석찬 (AWS 테크에반젤리스트)
Amazon SageMaker을 통한 손쉬운 Jupyter Notebook 활용하기  - 윤석찬 (AWS 테크에반젤리스트)Amazon SageMaker을 통한 손쉬운 Jupyter Notebook 활용하기  - 윤석찬 (AWS 테크에반젤리스트)
Amazon SageMaker을 통한 손쉬운 Jupyter Notebook 활용하기 - 윤석찬 (AWS 테크에반젤리스트)
 
Deep Learning with Apache MXNet
Deep Learning with Apache MXNetDeep Learning with Apache MXNet
Deep Learning with Apache MXNet
 
AWS Summit Singapore - Artificial Intelligence to Delight Your Customers
AWS Summit Singapore - Artificial Intelligence to Delight Your CustomersAWS Summit Singapore - Artificial Intelligence to Delight Your Customers
AWS Summit Singapore - Artificial Intelligence to Delight Your Customers
 
Picking the right AWS backend for your Java application
Picking the right AWS backend for your Java applicationPicking the right AWS backend for your Java application
Picking the right AWS backend for your Java application
 
Running BSD on AWS
Running BSD on AWSRunning BSD on AWS
Running BSD on AWS
 
Build, train, and deploy ML models at scale.pdf
Build, train, and deploy ML models at scale.pdfBuild, train, and deploy ML models at scale.pdf
Build, train, and deploy ML models at scale.pdf
 
Orchestrating Machine Learning Training for Netflix Recommendations - MCL317 ...
Orchestrating Machine Learning Training for Netflix Recommendations - MCL317 ...Orchestrating Machine Learning Training for Netflix Recommendations - MCL317 ...
Orchestrating Machine Learning Training for Netflix Recommendations - MCL317 ...
 
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS using Apache MXNet (May 2017)Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
 
Picking the right AWS backend for your application (September 2017)
Picking the right AWS backend for your application (September 2017)Picking the right AWS backend for your application (September 2017)
Picking the right AWS backend for your application (September 2017)
 
Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)
 
Machine Learning in Action
Machine Learning in ActionMachine Learning in Action
Machine Learning in Action
 
AWS Machine Learning Week SF: Build, Train & Deploy ML Models Using SageMaker
AWS Machine Learning Week SF: Build, Train & Deploy ML Models Using SageMakerAWS Machine Learning Week SF: Build, Train & Deploy ML Models Using SageMaker
AWS Machine Learning Week SF: Build, Train & Deploy ML Models Using SageMaker
 
Image Recognition on AWS with Apache Spark and BigDL
Image Recognition on AWS with Apache Spark and BigDLImage Recognition on AWS with Apache Spark and BigDL
Image Recognition on AWS with Apache Spark and BigDL
 
Accelerate your Machine Learning workflows with Amazon SageMaker
Accelerate your Machine Learning workflows with Amazon SageMakerAccelerate your Machine Learning workflows with Amazon SageMaker
Accelerate your Machine Learning workflows with Amazon SageMaker
 
Optimize your ML workloads_converted.pdf
Optimize your ML workloads_converted.pdfOptimize your ML workloads_converted.pdf
Optimize your ML workloads_converted.pdf
 
Deep Learning for Developers (expanded version, 12/2017)
Deep Learning for Developers (expanded version, 12/2017)Deep Learning for Developers (expanded version, 12/2017)
Deep Learning for Developers (expanded version, 12/2017)
 
Optimizing training on Apache MXNet (January 2018)
Optimizing training on Apache MXNet (January 2018)Optimizing training on Apache MXNet (January 2018)
Optimizing training on Apache MXNet (January 2018)
 

Similar a Machine Learning inference at the Edge

DataPalooza - A Music Festival themed ML + IoT Workshop
DataPalooza - A Music Festival themed ML + IoT WorkshopDataPalooza - A Music Festival themed ML + IoT Workshop
DataPalooza - A Music Festival themed ML + IoT Workshop
Amazon Web Services
 
Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境
Amazon Web Services
 

Similar a Machine Learning inference at the Edge (20)

Machine Learning Inference at the Edge
Machine Learning Inference at the EdgeMachine Learning Inference at the Edge
Machine Learning Inference at the Edge
 
DataPalooza: ML & IoT Workshop
DataPalooza: ML & IoT WorkshopDataPalooza: ML & IoT Workshop
DataPalooza: ML & IoT Workshop
 
Datapalooza: A Music Festival Themed ML & IoT Workshop
Datapalooza: A Music Festival Themed ML & IoT WorkshopDatapalooza: A Music Festival Themed ML & IoT Workshop
Datapalooza: A Music Festival Themed ML & IoT Workshop
 
DataPalooza - A Music Festival themed ML + IoT Workshop
DataPalooza - A Music Festival themed ML + IoT WorkshopDataPalooza - A Music Festival themed ML + IoT Workshop
DataPalooza - A Music Festival themed ML + IoT Workshop
 
Enabling Deep Learning in IoT Applications with Apache MXNet
Enabling Deep Learning in IoT Applications with Apache MXNetEnabling Deep Learning in IoT Applications with Apache MXNet
Enabling Deep Learning in IoT Applications with Apache MXNet
 
AI for an intelligent cloud and intelligent edge: Discover, deploy, and manag...
AI for an intelligent cloud and intelligent edge: Discover, deploy, and manag...AI for an intelligent cloud and intelligent edge: Discover, deploy, and manag...
AI for an intelligent cloud and intelligent edge: Discover, deploy, and manag...
 
Risk Management and Particle Accelerators: Innovating with New Compute Platfo...
Risk Management and Particle Accelerators: Innovating with New Compute Platfo...Risk Management and Particle Accelerators: Innovating with New Compute Platfo...
Risk Management and Particle Accelerators: Innovating with New Compute Platfo...
 
IOT326_Developing Predictive Applications Using
IOT326_Developing Predictive Applications UsingIOT326_Developing Predictive Applications Using
IOT326_Developing Predictive Applications Using
 
AI for Intelligent Cloud and Intelligent Edge: Discover, Deploy, and Manage w...
AI for Intelligent Cloud and Intelligent Edge:Discover, Deploy, and Manage w...AI for Intelligent Cloud and Intelligent Edge:Discover, Deploy, and Manage w...
AI for Intelligent Cloud and Intelligent Edge: Discover, Deploy, and Manage w...
 
Machine Learning in azione con Amazon SageMaker
Machine Learning in azione con Amazon SageMakerMachine Learning in azione con Amazon SageMaker
Machine Learning in azione con Amazon SageMaker
 
Machine Learning and AI
Machine Learning and AIMachine Learning and AI
Machine Learning and AI
 
Neev cloud services with AWS
Neev cloud services with AWSNeev cloud services with AWS
Neev cloud services with AWS
 
AWS Meetup Fort Lauderdale Re:invent Recap
AWS Meetup Fort Lauderdale Re:invent RecapAWS Meetup Fort Lauderdale Re:invent Recap
AWS Meetup Fort Lauderdale Re:invent Recap
 
201908 Overview of Automated ML
201908 Overview of Automated ML201908 Overview of Automated ML
201908 Overview of Automated ML
 
Intelligence of Things: IoT, AWS DeepLens and Amazon SageMaker
Intelligence of Things: IoT, AWS DeepLens and Amazon SageMakerIntelligence of Things: IoT, AWS DeepLens and Amazon SageMaker
Intelligence of Things: IoT, AWS DeepLens and Amazon SageMaker
 
re:Invent Recap-AWSMeetup
re:Invent Recap-AWSMeetupre:Invent Recap-AWSMeetup
re:Invent Recap-AWSMeetup
 
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
"Scaling ML from 0 to millions of users", Julien Simon, AWS Dev Day Kyiv 2019
 
Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境
 
Machine Learning at the Edge
Machine Learning at the EdgeMachine Learning at the Edge
Machine Learning at the Edge
 
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
 

Más de Julien SIMON

Más de Julien SIMON (20)

An introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging FaceAn introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging Face
 
Reinventing Deep Learning
 with Hugging Face Transformers
Reinventing Deep Learning
 with Hugging Face TransformersReinventing Deep Learning
 with Hugging Face Transformers
Reinventing Deep Learning
 with Hugging Face Transformers
 
Building NLP applications with Transformers
Building NLP applications with TransformersBuilding NLP applications with Transformers
Building NLP applications with Transformers
 
Building Machine Learning Models Automatically (June 2020)
Building Machine Learning Models Automatically (June 2020)Building Machine Learning Models Automatically (June 2020)
Building Machine Learning Models Automatically (June 2020)
 
Starting your AI/ML project right (May 2020)
Starting your AI/ML project right (May 2020)Starting your AI/ML project right (May 2020)
Starting your AI/ML project right (May 2020)
 
Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)
 
An Introduction to Generative Adversarial Networks (April 2020)
An Introduction to Generative Adversarial Networks (April 2020)An Introduction to Generative Adversarial Networks (April 2020)
An Introduction to Generative Adversarial Networks (April 2020)
 
AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...
AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...
AIM410R1 Deep learning applications with TensorFlow, featuring Fannie Mae (De...
 
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
AIM361 Optimizing machine learning models with Amazon SageMaker (December 2019)
 
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
 
A pragmatic introduction to natural language processing models (October 2019)
A pragmatic introduction to natural language processing models (October 2019)A pragmatic introduction to natural language processing models (October 2019)
A pragmatic introduction to natural language processing models (October 2019)
 
Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)
 
Build, train and deploy ML models with SageMaker (October 2019)
Build, train and deploy ML models with SageMaker (October 2019)Build, train and deploy ML models with SageMaker (October 2019)
Build, train and deploy ML models with SageMaker (October 2019)
 
The Future of AI (September 2019)
The Future of AI (September 2019)The Future of AI (September 2019)
The Future of AI (September 2019)
 
Building Machine Learning Inference Pipelines at Scale (July 2019)
Building Machine Learning Inference Pipelines at Scale (July 2019)Building Machine Learning Inference Pipelines at Scale (July 2019)
Building Machine Learning Inference Pipelines at Scale (July 2019)
 
Train and Deploy Machine Learning Workloads with AWS Container Services (July...
Train and Deploy Machine Learning Workloads with AWS Container Services (July...Train and Deploy Machine Learning Workloads with AWS Container Services (July...
Train and Deploy Machine Learning Workloads with AWS Container Services (July...
 
Deep Learning on Amazon Sagemaker (July 2019)
Deep Learning on Amazon Sagemaker (July 2019)Deep Learning on Amazon Sagemaker (July 2019)
Deep Learning on Amazon Sagemaker (July 2019)
 
Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)
 
Build, train and deploy ML models with Amazon SageMaker (May 2019)
Build, train and deploy ML models with Amazon SageMaker (May 2019)Build, train and deploy ML models with Amazon SageMaker (May 2019)
Build, train and deploy ML models with Amazon SageMaker (May 2019)
 
Build, train and deploy Machine Learning models on Amazon SageMaker (May 2019)
Build, train and deploy Machine Learning models on Amazon SageMaker (May 2019)Build, train and deploy Machine Learning models on Amazon SageMaker (May 2019)
Build, train and deploy Machine Learning models on Amazon SageMaker (May 2019)
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Machine Learning inference at the Edge

  • 1. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Machine Learning Inference at the Edge Julien Simon Principal Technical Evangelist, AI and Machine Learning @julsimon
  • 2. Agenda • Deep Learning at the Edge? • Apache MXNet • Predicting in the Cloud or at the Edge? • New services • AWS Greengrass ML • AWS DeepLens • Resources
  • 3. Deep Learning at the Edge?
  • 5. Most machine data never reaches the cloud Medical equipment Industrial machinery Extreme environments
  • 6. Why this problem isn’t going away Law of physics Law of economics Law of the land
  • 7. Deep Learning challenges at the Edge • Resource-constrained devices • CPU, memory, storage, power consumption. • Network connectivity • Availability, cost, bandwidth, latency. • On-device prediction may be the only option. • Deployment • Updating code and models on a fleet of devices is not easy.
  • 8. Deep Learning wishlist at the Edge • Rely on cloud-based services for seamless training and deployment. • Have the option to use cloud-based prediction. • Be able to run device-based prediction with good performance. • Support different technical environments (CPUs, languages).
  • 10. Apache MXNet: Open Source library for Deep Learning Programmable Portable High Performance Near linear scaling across hundreds of GPUs Highly efficient models for mobile and IoT Simple syntax, multiple languages Most Open Best On AWS Optimized for Deep Learning on AWS Accepted into the Apache Incubator
  • 11. Apache MXNet for IoT 1. Flexible experimentation in the Cloud. 2. Scalable training in the Cloud. 3. Good prediction performance at the Edge. 4. Prediction in the Cloud or at the Edge.
  • 12. 1 - Flexible experimentation in the Cloud • API for Python, R, Perl, Matlab, Scala, C++. • Gluon • Imperative programming aka ‘define-by-run’. • Inspect, debug and modify models during training. • Extensive model zoo • Pre-trained computer vision models • DenseNet, SqueezeNet for resource-constrained devices.
  • 13. Gluon CV: classification, detection, segmentation https://github.com/dmlc/gluon-cv [electric_guitar], with probability 0.671
  • 14. 2 - Scalable training in the Cloud Amazon SageMaker AWS Deep Learning AMI Amazon EC2 c5 p3
  • 15. 3 - Good prediction performance at the Edge • MXNet is written in C++. • Gluon networks can be ‘hybridized’ for additional speed. • Two libraries boost performance on CPU-only devices • Fast implementation of math primitives • Hardware-specific instructions, e.g. Intel AVX or ARM NEON • Intel Math Kernel Library https://software.intel.com/en-us/mkl • NNPACK https://github.com/Maratyszcza/NNPACK • Mixed precision training • Use float16 instead of float32 for weights and activations • Almost 2x reduction in model size, no loss of accuracy, faster inference • https://devblogs.nvidia.com/parallelforall/mixed-precision-training-deep-neural-networks/
  • 16. 4 - Predicting in the Cloud or at the Edge • Cloud-based: invoke a Lambda function with AWS IoT. • Cloud-based: invoke a SageMaker endpoint with HTTP. • Device-based: bring your own code and model. • Device-based: deploy your code and model with AWS Greengrass.
  • 17. Invoking a Lambda function with AWS IoT • Train a model in SageMaker (or bring your own). • Host it in S3 (or embed it in a Lambda function). • Write a Lambda function performing prediction. • Invoke it through AWS IoT. Best when Devices can support neither HTTP nor local inference (e.g. Arduino). Costs must be kept as low as possible. Requirements Network is available and reliable (MQTT is less demanding than HTTP). Devices are provisioned in AWS IoT (certificate, keys). https://aws.amazon.com/blogs/compute/seamlessly-scale-predictions-with-aws-lambda-and-mxnet/
  • 18. Invoking a SageMaker endpoint with HTTP • Train a model in SageMaker (or bring your own). • Deploy it to a prediction endpoint. • Invoke the HTTP endpoint from your devices. Best when Devices are not powerful enough for local inference. Models can’t be easily deployed to devices. Additional cloud-based data is required for prediction. Prediction activity must be centralized. Requirements Network is available and reliable. Devices support HTTP.
  • 19. Bring your own code and model • Train a model in SageMaker (or bring your own). • Bring your own application code. • Provision devices at manufacturing time (or use your own update mechanism). Best when You don’t want to or can’t rely on cloud services (no network connectivity?) Requirements Devices are powerful enough for local inference. Models don’t need to be updated, if ever. DIY!
  • 20. Deploy your code and model with AWS Greengrass • Train a model in SageMaker (or bring your own). • Write a Lambda function performing prediction. • Add both as resources in your Greengrass group. • Let Greengrass handle deployment and updates. Best when You want the same programming model in the Cloud and at the Edge. Code and models need to be updated, even if network connectivity is infrequent or unreliable. One device in the group should be able to perform prediction on behalf on other devices. Requirements Devices are powerful enough to run Greengrass (XXX HW requirements) Devices are provisioned in AWS IoT (certificate, keys).
  • 21. ML Inference using AWS Greengrass Deploy model and Lambda Send insights Predict and take actions locally on device AWS Cloud
  • 24. AWS DeepLens HD video camera Custom-designed Deep Learning engine Micro-SD Mini-HDMI USB USB Reset Audio out Power HD video camera with on-board compute optimized for Deep Learning Tutorials, examples, demos, and pre-built models From unboxing to prediction in <10 minutes Integrates with Amazon SageMaker and AWS Lambda 10 MIN The world’s first Deep Learning-enabled video camera for developers
  • 25. Get Started with Deep Learning B u i l d c u s t o m D e e p L e a r n i n g m o d e l s i n t h e c l o u d u s i n g A m a z o n S a g e M a k e r, o r u s e t h e c o l l e c t i o n o f p r e t r a i n e d m o d e l s i n c l u d e d w i t h AW S D e e p L e n s It takes less than 10 minutes with AWS DeepLens
  • 27. Object detection with AWS DeepLens
  • 29. Resources https://aws.amazon.com/machine-learning/amis/ https://mxnet.incubator.apache.org http://gluon.mxnet.io https://aws.amazon.com/sagemaker (free tier available) https://github.com/awslabs/amazon-sagemaker-examples https://aws.amazon.com/greengrass (free tier available) https://aws.amazon.com/greengrass/ml/ https://aws.amazon.com/deeplens https://medium.com/@julsimon https://youtube.com/juliensimonfr
  • 30. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. Thank you! Julien Simon, Principal AI/ML Evangelist, Amazon Web Services @julsimon