SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Naveen Swamy & Thomas Delteil
* ecosystem
27th
September 2018
*
*
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Apache MXNet - History
Amazon’s deep-learning
framework of choice
since November 2016.
Accepted into
Apache Incubator
in January 2017.
Created by academia
(CMU and UW)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Multi-language Support
C++
C++
ClojureJuliaPerlR
ScalaPython
Frontend
Backend
While keeping high performance from efficient backend
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Apache MXNet Ecosystem
MXBoard
Model
Server
GluonCV
GluonNLP
ONNX
Model Zoo
Keras
TensorRT
TVM
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Model Server
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Model
Model Server
Mobile
Desktop
IoT
Internet
So what does a deployed model looks like?
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Performance
Availability
Networking
Monitoring
Model Decoupling
Cross Framework
Cross Platform
The Undifferentiated Heavy
Lifting of
Model Serving
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Trained
Network
Model
Signature
Custom
Code
Auxiliary
Assets
Model Archive
Model Export CLI
Model Archive
Back
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
MMS
Dockerfile
Pull or Build
Push
Launch
Containerization
Container Cluster
MMS Container
MMS ContainerMMS Container
MXNet NGINX
MXNet Model Server
Lightweight virtualization, isolation, runs anywhere
Back
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ONNX
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
O(n2)
Pairs
MXNet
Caffe2
PyTorch
TF
CNTKCoreML
TensorRT
NGraph
SNPEMany Frameworks
Open Neural Network eXchange - Overview
Many Platforms
ONNX: Common IR
• Open source
• Community driven
• Simple
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Build and train your model with PyTorch
Load your ONNX model with MXNet
Run inference, fine tune or save as MXNet model.
Back
Import ONNX model in MXNet– Usage Example
# Synthetic input for tracing
x = Variable(torch.randn(batch_size, 1, 224, 224), requires_grad=True)
# Export the model
torch_out = torch.onnx.export(model, x, "model.onnx")
# Import into MXNet (from MXNet 1.2)
sym, arg_params, aux_params = onnx_mxnet.import_model('model.onnx’)
# create module
mod = mx.mod.Module(symbol=sym, data_names=['input_0'], label_names=None)
mod.bind(for_training=False, data_shapes=[('input_0', input_img.shape)])
mod.set_params(arg_params=arg_params, aux_params=aux_params)
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Build and train your model in MXNet
Export trained MXNet model to ONNX format
Import in other framework like cntk, caffe2 for inference
Back
Export MXNet model to ONNX – Usage
# Export MXNet model to ONNX format(from MXNet 1.3)
onnx_file_path = onnx_mxnet.export_model(sym, params, [input_shape],
input_data_type, onnx_file_path)
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ONNX – Internals
Protocol Buffers
Graph Operator Tensor, …
Operator Definitions
ONNX Python APIProtocol Buffers:
• Binary compact format
• Statically defined
• APIs for de/serialization
• Cross platform
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Back
ONNX – Coverage
Framework Export Import
MXNet Supported Supported
Caffe2 Supported Supported
PyTorch Supported Coming…
CNTK Supported Supported
Chainer Supported (external) N/A
TensorFlow Supported (external) Supported (external)
CoreML Supported (external) Supported (external)
SciKit-Learn Supported (external) N/A
Credits: Hagay Lupesko
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Keras-MXNet
https://github.com/awslabs/keras-apache-mxnet )
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Keras – Apache MXNet
• Deep Learning for Humans
• 2nd most popular Deep Learning framework
• Keras users leverage MXNet’s great performance
from keras.models import Sequential
model = Sequential()
from keras.layers import Dense
model.add(Dense(units=64, activation='relu', input_dim=100))
model.add(Dense(units=10, activation='softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='sgd',
metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5, batch_size=32)
model.train_on_batch(x_batch, y_batch)
loss_and_metrics = model.evaluate(x_test, y_test, batch_size=128)
classes = model.predict(x_test, batch_size=128)
pip install mxnet-(mkl|cu92)
pip install keras-mxnet
---
~/.keras/keras.json
backend: mxnet
image_data_format: channels_first
---
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Keras Benchmarks
Setup: https://github.com/awslabs/keras-apache-mxnet/tree/master/benchmark
Training Inference
Instance P3.8x Large, P3.16x Large C5.xLarge, C4.8xLarge
Network ResNet50v1 ResNet50v1
Batch size 32 * Num of GPUs 32
Image size 3*256*256 3*256*256
GPUs
Keras-MXNet
[ Image/sec ]
Keras-TensorFlow
[ Image/sec ] Speed Up
1 194 184 1.05
4 764 393 1.94
8 1068 261 4.09
0
500
1000
1500
1 GPU 4 GPU 8 GPU
ResNet50-Synthetic data
Keras-MXNet Keras-TensorFlow
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Keras Benchmarks
GPUs Keras-MXNet Keras-TensorFlow Speed Up
1 135 52 2.59
4 536 162 3.30
8 722 211 3.420
500
1000
1500
1 GPU 4 GPU 8 GPU
ResNet50-ImageNet data
Keras-MXNet Keras-TensorFlow
Instance Keras-MXNet Keras-TensorFlow Speed Up
C5.X Large 5.79 3.27 1.782
C5.8X Large 27.9 18.2 1.53
0
10
20
30
1 2
ResNet50 - Batch Inference
Keras-MXNet Keras-TensorFlow
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
ScalableDebuggable Flexible
Imperative API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
e.g. Inception StageSymbolic is “define, compile, run”
Imperative is “define-by-run”
Symbolic vs Imperative
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GluonCV: a Deep Learning Toolkit for Computer Vision
https://gluon-cv.mxnet.io
50+ Pre-trained models, with training scripts, datasets, tutorials
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GluonCV: pre-trained models, help to choose
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GluonCV: example code
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GluonNLP: a Deep Learning Toolkit for Natural Language Processing
https://gluon-nlp.mxnet.io
Features (as of 0.3.2)
- Pre-trained models: over 300 word-embedding
- 5 language models
- Neural Machine Translation (Google NMT, Transformer)
- Flexible data pipeline tools and many public datasets.
- NLP examples such as sentiment analysis.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Word embedding:
car
dog 0
apple 0
eat 0
car 1
van 0
leaf 0
the 0
at 0
car
0.1
0.5
-1.1
0.4
van
0.2
0.3
-1.0
0.5
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Language modeling
Trained to predict the next word (! "# "$ … "#&' ):
- The winner of the 2018 FIFA world cup is ………. ?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
first
most
<unk>
only
same
best
greatest
main
second
last
name
largest
highest
final
worst
sixth
third
way
primary
This movie is considered the <?>
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
MXBoard: MXNet plugin to TensorBoard
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
MXBoard
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Deep Learning acceleration
CUDA & CuDNN MKL, MKLML & MKLDNN
pip install mxnet-cu92 e.g. pip install mxnet-mkl
TensorRT
pip install mxnet-tensorrt-cu92
TVM
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Apache MXNet community
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Keeping Up to Date
Medium: https://medium.com/apache-mxnet
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Keeping Up to Date: Social
YouTube: /apachemxnet
Twitter: @apachemxnet
Reddit: r/mxnet
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Community
GitHub: https://github.com/apache/incubator-mxnet
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Community
Discuss Forum: https://discuss.mxnet.io/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Community
Mailing list:
dev@mxnet.apache.org
user@mxnet.apache.org
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
MXNet Customer Momentum
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank you!

More Related Content

PDF
Using Java to deploy Deep Learning models with MXNet
PPTX
MXNet Paris Workshop - Intro To MXNet
PDF
DeepLearning001&ApacheMXNetWithSparkForInference-ACNA2018
PDF
Apache MXNet ODSC West 2018
PPTX
Deep Learning in Java with Apache MXNet
PPTX
Apache MXNet and Gluon
PPTX
AI powered emotion recognition: From Inception to Production - Global AI Conf...
PDF
AI 클라우드로 완전 정복하기 - 데이터 분석부터 딥러닝까지 (윤석찬, AWS테크에반젤리스트)
Using Java to deploy Deep Learning models with MXNet
MXNet Paris Workshop - Intro To MXNet
DeepLearning001&ApacheMXNetWithSparkForInference-ACNA2018
Apache MXNet ODSC West 2018
Deep Learning in Java with Apache MXNet
Apache MXNet and Gluon
AI powered emotion recognition: From Inception to Production - Global AI Conf...
AI 클라우드로 완전 정복하기 - 데이터 분석부터 딥러닝까지 (윤석찬, AWS테크에반젤리스트)

What's hot (15)

PPTX
Emotion recognition in images: from idea to a model in production - Nordic DS...
PPTX
Distributed Model Training using MXNet with Horovod
PPTX
Randall's re:Invent Recap
PDF
20190213 AWS Black Belt Online Seminar Amazon SageMaker Advanced Session
PDF
Machine Learning on the Cloud with Apache MXNet
PDF
AWS CodeStar 및 Cloud9을 통한 서버리스(Serverless) 앱 개발 길잡이 - 윤석찬 (AWS 테크에반젤리스트)
PDF
AutoML for Data Science Productivity and Toward Better Digital Decisions
PPTX
Deep Learning on Qubole Data Platform
PDF
프론트엔드 개발자를 위한 서버리스 - 윤석찬 (AWS 테크에반젤리스트)
PPTX
KERAS Python Tutorial
PPTX
How to Choose The Right Database on AWS - Berlin Summit - 2019
PPTX
Amazon Deep Learning
PDF
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
PDF
Google Cloud Platform Empowers TensorFlow and Machine Learning
PDF
Flickr: Computer vision at scale with Hadoop and Storm (Huy Nguyen)
Emotion recognition in images: from idea to a model in production - Nordic DS...
Distributed Model Training using MXNet with Horovod
Randall's re:Invent Recap
20190213 AWS Black Belt Online Seminar Amazon SageMaker Advanced Session
Machine Learning on the Cloud with Apache MXNet
AWS CodeStar 및 Cloud9을 통한 서버리스(Serverless) 앱 개발 길잡이 - 윤석찬 (AWS 테크에반젤리스트)
AutoML for Data Science Productivity and Toward Better Digital Decisions
Deep Learning on Qubole Data Platform
프론트엔드 개발자를 위한 서버리스 - 윤석찬 (AWS 테크에반젤리스트)
KERAS Python Tutorial
How to Choose The Right Database on AWS - Berlin Summit - 2019
Amazon Deep Learning
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
Google Cloud Platform Empowers TensorFlow and Machine Learning
Flickr: Computer vision at scale with Hadoop and Storm (Huy Nguyen)
Ad

Similar to Apache MXNet EcoSystem - ACNA2018 (20)

PPTX
ONNX - The Lingua Franca of Deep Learning
PDF
Deep Dive into Apache MXNet on AWS
PPTX
Aran Khanna, Software Engineer, Amazon Web Services at MLconf ATL 2017
PPTX
Debugging and Performance tricks for MXNet Gluon
PDF
Time series modeling workd AMLD 2018 Lausanne
PDF
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
PDF
Scalable Deep Learning on AWS with Apache MXNet
PDF
Deep Learning with Apache MXNet
PDF
【14-C-7】コンピュータビジョンを支える深層学習技術の新潮流
PPTX
Deep learning systems model serving
PPTX
Model Serving for Deep Learning
PDF
Deep Learning for Developers (December 2017)
PPTX
AI powered emotion recognition: From Inception to Production - Global AI Conf...
PDF
Deep Learning for Developers (October 2017)
PPTX
Deep Learning with TensorFlow and Apache MXNet on Amazon SageMaker (March 2019)
PDF
Building Applications with Apache MXNet
PDF
Emotion Recognition in Images
PPTX
Using MXNet to Train and Deploy your Deep Learning Model
PDF
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
PPTX
Deep Learning with MXNet
ONNX - The Lingua Franca of Deep Learning
Deep Dive into Apache MXNet on AWS
Aran Khanna, Software Engineer, Amazon Web Services at MLconf ATL 2017
Debugging and Performance tricks for MXNet Gluon
Time series modeling workd AMLD 2018 Lausanne
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS with Apache MXNet
Deep Learning with Apache MXNet
【14-C-7】コンピュータビジョンを支える深層学習技術の新潮流
Deep learning systems model serving
Model Serving for Deep Learning
Deep Learning for Developers (December 2017)
AI powered emotion recognition: From Inception to Production - Global AI Conf...
Deep Learning for Developers (October 2017)
Deep Learning with TensorFlow and Apache MXNet on Amazon SageMaker (March 2019)
Building Applications with Apache MXNet
Emotion Recognition in Images
Using MXNet to Train and Deploy your Deep Learning Model
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Deep Learning with MXNet
Ad

More from Apache MXNet (20)

PPTX
Recent Advances in Natural Language Processing
PPTX
Fine-tuning BERT for Question Answering
PPTX
Introduction to GluonNLP
PPTX
Introduction to object tracking with Deep Learning
PPTX
Introduction to GluonCV
PPTX
Introduction to Computer Vision
PPTX
Image Segmentation: Approaches and Challenges
PPTX
Introduction to Deep face detection and recognition
PPTX
Generative Adversarial Networks (GANs) using Apache MXNet
PPTX
Deep Learning With Apache MXNet On Video by Ben Taylor @ ziff.ai
PDF
ONNX and Edge Deployments
PDF
Distributed Inference with MXNet and Spark
PDF
Multivariate Time Series
PDF
AI On the Edge: Model Compression
PDF
Building Content Recommendation Systems using MXNet Gluon
PDF
Game Playing RL Agent
PDF
Neural Machine Translation with Sockeye
PPTX
Visual Search Engine with MXNet Gluon
PDF
GluonNLP: A Deep Learning Toolkit for NLP Practitioners
PDF
OCR with MXNet Gluon
Recent Advances in Natural Language Processing
Fine-tuning BERT for Question Answering
Introduction to GluonNLP
Introduction to object tracking with Deep Learning
Introduction to GluonCV
Introduction to Computer Vision
Image Segmentation: Approaches and Challenges
Introduction to Deep face detection and recognition
Generative Adversarial Networks (GANs) using Apache MXNet
Deep Learning With Apache MXNet On Video by Ben Taylor @ ziff.ai
ONNX and Edge Deployments
Distributed Inference with MXNet and Spark
Multivariate Time Series
AI On the Edge: Model Compression
Building Content Recommendation Systems using MXNet Gluon
Game Playing RL Agent
Neural Machine Translation with Sockeye
Visual Search Engine with MXNet Gluon
GluonNLP: A Deep Learning Toolkit for NLP Practitioners
OCR with MXNet Gluon

Recently uploaded (20)

PPTX
retention in jsjsksksksnbsndjddjdnFPD.pptx
PDF
Optimise Shopper Experiences with a Strong Data Estate.pdf
PPT
ISS -ESG Data flows What is ESG and HowHow
PPT
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
PDF
Transcultural that can help you someday.
PDF
Navigating the Thai Supplements Landscape.pdf
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PDF
Business Analytics and business intelligence.pdf
PPTX
SAP 2 completion done . PRESENTATION.pptx
PDF
Introduction to the R Programming Language
PDF
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
PPTX
New ISO 27001_2022 standard and the changes
PDF
annual-report-2024-2025 original latest.
PPTX
Managing Community Partner Relationships
PDF
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
PDF
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
Introduction to Data Science and Data Analysis
PDF
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
PPTX
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
retention in jsjsksksksnbsndjddjdnFPD.pptx
Optimise Shopper Experiences with a Strong Data Estate.pdf
ISS -ESG Data flows What is ESG and HowHow
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
Transcultural that can help you someday.
Navigating the Thai Supplements Landscape.pdf
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
Business Analytics and business intelligence.pdf
SAP 2 completion done . PRESENTATION.pptx
Introduction to the R Programming Language
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
New ISO 27001_2022 standard and the changes
annual-report-2024-2025 original latest.
Managing Community Partner Relationships
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
Systems Analysis and Design, 12th Edition by Scott Tilley Test Bank.pdf
Qualitative Qantitative and Mixed Methods.pptx
Introduction to Data Science and Data Analysis
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx

Apache MXNet EcoSystem - ACNA2018

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Naveen Swamy & Thomas Delteil * ecosystem 27th September 2018 * *
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Apache MXNet - History Amazon’s deep-learning framework of choice since November 2016. Accepted into Apache Incubator in January 2017. Created by academia (CMU and UW)
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Multi-language Support C++ C++ ClojureJuliaPerlR ScalaPython Frontend Backend While keeping high performance from efficient backend
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Apache MXNet Ecosystem MXBoard Model Server GluonCV GluonNLP ONNX Model Zoo Keras TensorRT TVM
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Model Server Credits: Hagay Lupesko
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Model Model Server Mobile Desktop IoT Internet So what does a deployed model looks like? Credits: Hagay Lupesko
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Performance Availability Networking Monitoring Model Decoupling Cross Framework Cross Platform The Undifferentiated Heavy Lifting of Model Serving Credits: Hagay Lupesko
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Trained Network Model Signature Custom Code Auxiliary Assets Model Archive Model Export CLI Model Archive Back Credits: Hagay Lupesko
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark MMS Dockerfile Pull or Build Push Launch Containerization Container Cluster MMS Container MMS ContainerMMS Container MXNet NGINX MXNet Model Server Lightweight virtualization, isolation, runs anywhere Back
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ONNX Credits: Hagay Lupesko
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark O(n2) Pairs MXNet Caffe2 PyTorch TF CNTKCoreML TensorRT NGraph SNPEMany Frameworks Open Neural Network eXchange - Overview Many Platforms ONNX: Common IR • Open source • Community driven • Simple Credits: Hagay Lupesko
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Build and train your model with PyTorch Load your ONNX model with MXNet Run inference, fine tune or save as MXNet model. Back Import ONNX model in MXNet– Usage Example # Synthetic input for tracing x = Variable(torch.randn(batch_size, 1, 224, 224), requires_grad=True) # Export the model torch_out = torch.onnx.export(model, x, "model.onnx") # Import into MXNet (from MXNet 1.2) sym, arg_params, aux_params = onnx_mxnet.import_model('model.onnx’) # create module mod = mx.mod.Module(symbol=sym, data_names=['input_0'], label_names=None) mod.bind(for_training=False, data_shapes=[('input_0', input_img.shape)]) mod.set_params(arg_params=arg_params, aux_params=aux_params) Credits: Hagay Lupesko
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Build and train your model in MXNet Export trained MXNet model to ONNX format Import in other framework like cntk, caffe2 for inference Back Export MXNet model to ONNX – Usage # Export MXNet model to ONNX format(from MXNet 1.3) onnx_file_path = onnx_mxnet.export_model(sym, params, [input_shape], input_data_type, onnx_file_path) Credits: Hagay Lupesko
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ONNX – Internals Protocol Buffers Graph Operator Tensor, … Operator Definitions ONNX Python APIProtocol Buffers: • Binary compact format • Statically defined • APIs for de/serialization • Cross platform Credits: Hagay Lupesko
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Back ONNX – Coverage Framework Export Import MXNet Supported Supported Caffe2 Supported Supported PyTorch Supported Coming… CNTK Supported Supported Chainer Supported (external) N/A TensorFlow Supported (external) Supported (external) CoreML Supported (external) Supported (external) SciKit-Learn Supported (external) N/A Credits: Hagay Lupesko
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Keras-MXNet https://github.com/awslabs/keras-apache-mxnet )
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Keras – Apache MXNet • Deep Learning for Humans • 2nd most popular Deep Learning framework • Keras users leverage MXNet’s great performance from keras.models import Sequential model = Sequential() from keras.layers import Dense model.add(Dense(units=64, activation='relu', input_dim=100)) model.add(Dense(units=10, activation='softmax')) model.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy']) model.fit(x_train, y_train, epochs=5, batch_size=32) model.train_on_batch(x_batch, y_batch) loss_and_metrics = model.evaluate(x_test, y_test, batch_size=128) classes = model.predict(x_test, batch_size=128) pip install mxnet-(mkl|cu92) pip install keras-mxnet --- ~/.keras/keras.json backend: mxnet image_data_format: channels_first ---
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Keras Benchmarks Setup: https://github.com/awslabs/keras-apache-mxnet/tree/master/benchmark Training Inference Instance P3.8x Large, P3.16x Large C5.xLarge, C4.8xLarge Network ResNet50v1 ResNet50v1 Batch size 32 * Num of GPUs 32 Image size 3*256*256 3*256*256 GPUs Keras-MXNet [ Image/sec ] Keras-TensorFlow [ Image/sec ] Speed Up 1 194 184 1.05 4 764 393 1.94 8 1068 261 4.09 0 500 1000 1500 1 GPU 4 GPU 8 GPU ResNet50-Synthetic data Keras-MXNet Keras-TensorFlow
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Keras Benchmarks GPUs Keras-MXNet Keras-TensorFlow Speed Up 1 135 52 2.59 4 536 162 3.30 8 722 211 3.420 500 1000 1500 1 GPU 4 GPU 8 GPU ResNet50-ImageNet data Keras-MXNet Keras-TensorFlow Instance Keras-MXNet Keras-TensorFlow Speed Up C5.X Large 5.79 3.27 1.782 C5.8X Large 27.9 18.2 1.53 0 10 20 30 1 2 ResNet50 - Batch Inference Keras-MXNet Keras-TensorFlow
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ScalableDebuggable Flexible Imperative API
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark e.g. Inception StageSymbolic is “define, compile, run” Imperative is “define-by-run” Symbolic vs Imperative
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GluonCV: a Deep Learning Toolkit for Computer Vision https://gluon-cv.mxnet.io 50+ Pre-trained models, with training scripts, datasets, tutorials
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GluonCV: pre-trained models, help to choose
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GluonCV: example code
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GluonNLP: a Deep Learning Toolkit for Natural Language Processing https://gluon-nlp.mxnet.io Features (as of 0.3.2) - Pre-trained models: over 300 word-embedding - 5 language models - Neural Machine Translation (Google NMT, Transformer) - Flexible data pipeline tools and many public datasets. - NLP examples such as sentiment analysis.
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Word embedding: car dog 0 apple 0 eat 0 car 1 van 0 leaf 0 the 0 at 0 car 0.1 0.5 -1.1 0.4 van 0.2 0.3 -1.0 0.5
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Language modeling Trained to predict the next word (! "# "$ … "#&' ): - The winner of the 2018 FIFA world cup is ………. ?
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark first most <unk> only same best greatest main second last name largest highest final worst sixth third way primary This movie is considered the <?>
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark MXBoard: MXNet plugin to TensorBoard
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark MXBoard
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Deep Learning acceleration CUDA & CuDNN MKL, MKLML & MKLDNN pip install mxnet-cu92 e.g. pip install mxnet-mkl TensorRT pip install mxnet-tensorrt-cu92 TVM
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Apache MXNet community
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Keeping Up to Date Medium: https://medium.com/apache-mxnet
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Keeping Up to Date: Social YouTube: /apachemxnet Twitter: @apachemxnet Reddit: r/mxnet
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Community GitHub: https://github.com/apache/incubator-mxnet
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Community Discuss Forum: https://discuss.mxnet.io/
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Community Mailing list: dev@mxnet.apache.org user@mxnet.apache.org
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark MXNet Customer Momentum
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you!