deep learning on aws with tensorflow and apache mxnet · summit © 2019, amazon web services, inc....

38
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. SUMMIT Deep Learning on AWS with TensorFlow and Apache MXNet Julien Simon Global Evangelist, AI & Machine Learning @julsimon Renaud ALLIOUX CTO, Earthcube

Upload: others

Post on 07-Sep-2019

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Deep Learning on AWS with TensorFlow and Apache MXNet

Julien SimonGlobal Evangelist, AI & Machine Learning@julsimon

Renaud ALLIOUXCTO, Earthcube

Page 2: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Trademark

M L F R A M E W O R K S &

I N F R A S T R U C T U R E

The Amazon ML Stack: Broadest & Deepest Set of Capabilities

A I S E R V I C E SR E K O G N I T I O N

I M A G EP O L L Y T R A N S C R I B E T R A N S L A T E C O M P R E H E N D

C O M P R E H E N DM E D I C A L

L E XR E K O G N I T I O NV I D E O

Vis ion Speech Chatbots

A M A Z O N S A G E M A K E R

B U I L D T R A I N

F O R E C A S TT E X T R A C T P E R S O N A L I Z E

D E P L O YPre-bui l t algorithms & notebooks

Data label ing (G R O U N D T R U T H )

One-cl ick model training & tuning

Optimization ( N E O )

One-cl ick deployment & host ingM L S E R V I C E S

F r a m e w o r k s I n t e r f a c e s I n f r a s t r u c t u r e

E C 2 P 3 & P 3 d n

E C 2 C 5 F P G A s G R E E N G R A S S E L A S T I CI N F E R E N C E

Models without training data (REINFORCEMENT LEARNING)Algorithms & models ( A W S M A R K E T P L A C E )

Language Forecast ing Recommendat ions

NEW NEWNEW

NEW

NEWNEWNEW

NEW

NEW

Page 3: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Trademark

M L F R A M E W O R K S &

I N F R A S T R U C T U R E

The Amazon ML Stack: Broadest & Deepest Set of Capabilities

A I S E R V I C E SR E K O G N I T I O N

I M A G EP O L L Y T R A N S C R I B E T R A N S L A T E C O M P R E H E N D

C O M P R E H E N DM E D I C A L

L E XR E K O G N I T I O NV I D E O

Vis ion Speech Chatbots

A M A Z O N S A G E M A K E R

B U I L D T R A I N

F O R E C A S TT E X T R A C T P E R S O N A L I Z E

D E P L O YPre-bui l t algorithms & notebooks

Data label ing (G R O U N D T R U T H )

One-cl ick model training & tuning

Optimization ( N E O )

One-cl ick deployment & host ingM L S E R V I C E S

F r a m e w o r k s I n t e r f a c e s I n f r a s t r u c t u r e

E C 2 P 3 & P 3 d n

E C 2 C 5 F P G A s G R E E N G R A S S E L A S T I CI N F E R E N C E

Models without training data (REINFORCEMENT LEARNING)Algorithms & models ( A W S M A R K E T P L A C E )

Language Forecast ing Recommendat ions

NEW NEWNEW

NEW

NEWNEWNEW

NEW

NEW

Page 4: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

AWS is framework agnostic

Choose from popular frameworks

Run them fully managed Or run them yourself

Page 5: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Amazon SageMaker: Build, Train, and Deploy ML Models at Scale

123

Page 6: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.

AWS Deep Learning AMIsPreconfigured environments Deep Learning applications

Conda AMIFor developers who want pre-installed pip packages of DL frameworks in separate virtual environments.

Base AMIFor developers who want a clean slate to set up private DL engine repositories or custom builds of DL engines.

AMI with source codeFor developers who want preinstalled DL frameworks and their source code in a shared Python environment.

Page 7: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 8: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

TensorFlow• Open source software library for Machine Learning

• Main API in Python, experimental support for other languages

• Built-in support for many network architectures: FC, CNN, LSTM, etc.

• Support for symbolic execution, as well as imperative execution since v1.7(aka “eager execution”)

• Complemented by the Keras high-level API

Page 9: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

AWS: The platform of choice to run TensorFlow

85% of all TensorFlow workloads in the cloud runs on AWS

Page 10: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Training a ResNet-50 benchmark with the synthetic ImageNet datasetusing our optimized build of TensorFlow 1.11 on a c5.18xlarge instance

type is 11x faster than training on the stock binaries.https://aws.amazon.com/about-aws/whats-new/2018/10/chainer4-4_theano_1-0-2_launch_deep_learning_ami/October 2018

Optimizing TensorFlow for Amazon EC2 C5 instances

Page 11: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Optimizing TensorFlow for Amazon EC2 P3 instances

65%

30m

90%

14m

Page 12: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Apache MXNet• Open source software library for Deep Learning

• Natively implemented in C++

• Built-in support for many network architectures: FC, CNN, LSTM, etc.

• Symbolic API: Python, Scala, Clojure, R, Julia, Perl, Java (inference only)

• Imperative API: Gluon (Python), with toolkits for computer vision (Gluon CV) and natural language processing (Gluon NLP)

Page 13: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Apache MXNet: deep learning for enterprise developers

2x faster

Page 14: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Analyzing satellite images at scale with Tensorflow on AWS

Renaud ALLIOUXCTO, Earthcube

Page 15: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

“Over 95% of collected intelligence data is never looked at”

A senior French MoD officialBFM Business, October 5th, 2018

Page 16: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Page 17: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Deep Learning

TensorflowKeras

AWS

Page 18: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Extensive R&D on Deep Learning models• Main use: segmentation and object detection

• Custom architectures implemented with Keras

• Ensembling, wide networks (ResNext), capsule and Bayesian Neural networks

• Residual and spatial pyramid pooling layers

• Custom weighted loss functions (eg: weighted cross entropy)

Page 19: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Data set

Training and inference

4 billion pixels

Deployment

Page 20: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Cloud native deployment using Celery

architecture.yaml

weights.h5config.yaml predict

Amazon EC2

Amazon S3

Page 21: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Lessons learneddata

infrastructure

scalable

AI for Earthcube

Page 22: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

The GEOINT community is already using AWS

https://www.youtube.com/watch?v=KXelfBpJtDY https://aws.amazon.com/ground-station

Page 23: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Amazon SageMaker

Apache MXNet

Next steps

Page 24: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 25: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

TensorFlow on Amazon SageMaker: a first-class citizen

• Built-in containers for training and prediction.• Code available on Github: https://github.com/aws/sagemaker-tensorflow-containers• Build it, run it on your own machine, customize it, push it to Amazon ECR, etc.• Supported versions: 1.4.1, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.10.0, 1.11.0, 1.12.0

• Advanced features• Local mode: train on the notebook instance for faster experimentation• Script mode: use the same TensorFlow code as on your local machine (1.11.0 and up)• Distributed training: zero setup!• Pipe mode: stream large datasets directly from Amazon S3• TensorBoard: visualize the progress of your training jobs• Keras support (tf.keras.* and keras.*)

Page 26: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Apache MXNet on Amazon SageMaker: a first-class citizen

• Built-in containers for training and prediction.• Code available on Github: https://github.com/aws/sagemaker-mxnet-container• Build it, run it on your own machine, customize it, push it to Amazon ECR, etc.• Supported versions: 0.12.1, 1.0.0, 1.1.0, 1.2.1, 1.3.0

• Advanced features• Local mode: train on the notebook instance for faster experimentation• Script mode: use the same TensorFlow as on your local machine • Distributed training: zero setup!• Pipe mode: stream large datasets directly from Amazon S3• Keras support (tf.keras.* and keras.*)

Page 27: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 28: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 29: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 30: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Inference

(Prediction)

90%

Training

10%

Page 31: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Hardware optimization is extremely complex

Page 32: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Page 33: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Amazon SageMaker NeoTrain once, run anywhere with 2x the performance

K E Y F E A T U R E S

Open-source Neo-AI runtime and compiler under the Apache software license;

1/10th the size of original frameworksgithub.com/neo-ai

Page 34: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Are you making the most of your infrastructure?

Page 35: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Amazon Elastic InferenceReduce deep learning inference costs up to 75%

K E Y F E A T U R E S

Integrated with Amazon EC2 and

Amazon SageMaker

Support for TensorFlow and Apache MXNet

Single and mixed-precision

operations

Page 36: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.

Getting started

http://aws.amazon.com/free

https://ml.awshttps://aws.amazon.com/sagemaker

https://github.com/aws/sagemaker-python-sdkhttps://github.com/awslabs/amazon-sagemaker-examples

https://medium.com/@julsimonhttps://gitlab.com/juliensimon/dlnotebooks

Page 37: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

Thank you!

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Julien SimonGlobal Evangelist, AI and Machine Learning

@julsimon

Page 38: Deep Learning on AWS with TensorFlow and Apache MXNet · SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deep Learning on AWS with TensorFlow and

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.