using tensorflow with amazon sagemaker marketing... · automatic model tuning—early stopping | ip...

27
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. SUMMIT Using TensorFlow with Amazon SageMaker Yuval Fernbach Specialist Solutions Architect – ML, EMEA AIM3

Upload: others

Post on 29-Aug-2019

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Using TensorFlow with Amazon SageMaker

Yuval FernbachSpecialist Solutions Architect – ML, EMEA

A I M 3

Page 2: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Agenda

• The Amazon ML Stack

• What is Amazon SageMaker

• TensorFlow with Amazon SageMaker• SageMaker script mode

• Collecting training metrics

• Experiments tracking with SageMaker search

• Performance optimization• SageMaker pipe input

• Distributed training

Page 3: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Our Approach for Machine Learning

Customer-focused 90%+ of our ML roadmap is

defined by customers

Multi-frameworkSupport for the most popular frameworks

Pace of innovation200+ new ML launches and major

feature updates in the last year

Breadth and depthA wide range of AI and ML services in-

production

Security and analyticsDeep set of security and

encryption features, with robust analytics capabilities

Embedded R&D Customer-centric approach to advancing the state of the art

Page 4: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Put machine learning in the

hands of every developer

Our mission at AWS

Page 5: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Some of our machine learning customers…

Page 6: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT© 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 S

R E K O G N I T I O N

I M A G E

P 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 D

M E D I C A L

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

V 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 Y

Pre-bui l t a lgor ithms & notebooks

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

One-cl ick model t ra in ing & tuning

Opt imizat ion ( 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 C

I N F E R E N C E

Reinforcement learningAlgor ithms & models ( A W S M A R K E T P L A C E

F O R M A C H I N E L E A R N I N G )

Language Forecast ing Recommendat ions

Page 7: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 8: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Amazon SageMaker: Build, train, and deploy ML

1

2

3

1

2

3

Page 9: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

90+ New Enhancements to SageMaker this YearMXNet 1.3 container | CloudTrail integration for audit logs | TensorFlow 1.7 Containers | Automatic Model Tuning—Add/Delete tags | Jupyter Notebooks IP Filtering

Region expansion to SFO | Image Classification Multi-label Support | TensorFlow and MXNet Containers—Open Sourcing and Local Mode | PyTorch pre-built container

Region expansion to PDT | Batch customer VPC | PCI DSS Compliance | XGBoost Instance Weights | NTM—vocab, metrics, and subsampling

Anomaly Detection (Random Cut Forest) Algorithm | Deep AR algorithm | SageMaker region expansion to ICN | Hyperparameter tuning job cloning on the console

Autoscaling console | PyTorch 1.0 container | Customer VPC support for training and hosting | PrivateLink support for SageMaker inferencing APIs

Horovod support in TensorFlow Container | Variable sizes for notebook EBS volumes |nbexample support in SageMaker notebook instances | Tag-based access control

Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms Pipe Mode Support

TensorFlow 1.8 Container | Region expansion to FRA | Training job cloning in console | Algorithm Pipe mode enhancements | Pipe mode support for text, recordIO, and images

TensorFlow 1.5, MXNet 1.0, and CUDA 9 Support | DeepAR Algorithm Enhancements | Linear Learner Multi-class Classification | TensorFlow 1.10 Container

Region expansion to YUL | BlazingText Algorithm | Batch KMS | k-nearest neighbors | Object detection |Chainer pre-built container | Apache Airflow integration

Region expansion to BOM | GDPR compliance | BlazingText Enhancements | TensorFlow 1.9 Container | Notebook bootstrap script

Amazon SageMaker Hosting custom header attribute | Metrics Support in Training Jobs | Object2vec | TensorFlow container enhancements | CloudFormation support

PrivateLink support for SageMaker Control Plane | MXNet 1.2 Container | HIPAA compliance | Ground Truth | Python SDK Marketplace support

Git integration for SageMaker notebooks | Pipe mode support for TensorFlow | ml.p3.2xlarge notebook instances | Internet-free notebook instances

Semantic segmentation algorithm | SageMaker Reinforcement Learning support | Linear Learner Improvements | SageMaker Batch Transform

Region expansion to NRT | High Performance I/O streaming in PIPE Mode | Pause/resume for active learning algorithms | Pre-built scikit-learn container

Step Functions for SageMaker | KMS support for training and hosting | Incremental learning algorithm enhancements | TensorFlow 1.11 container | NTM feature release

Deep Learning Compiler | ONNX Support for Frameworks and Algorithms |Full instance type support | Pipe mode CSV support | Region expansion to LHR

Incremental training platform support | Login anomaly detection algorithm | Serial inference pipeline | Experiment Management | Region expansion to SYD

MXNet container enhancements | Automatic Model Tuning | Automatic Model Tuning—incremental tuning | Spark MLeap 1P container

TensorFlow 1.6 and MXNet 1.1 Containers | Region expansion to SIN | Mead Notebook PrivateLink Support | Linear Learner sparsity support

Page 10: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Pre-configured environments to quickly build deep learning applications

Page 11: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

AWS is framework agnostic

Choose from popular frameworks

Run them fully managed Or run them yourself

Page 12: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

The best place to run TensorFlow

Fastest time for TensorFlow

65% 90%

30m 14m

• 85% of TensorFlow workloads in the cloud runs on AWS (2018 Nucleus report)

• Available w/ Amazon SageMaker and the AWS Deep Learning AMIs

Page 13: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 14: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

What is TensorFlow?

TensorFlow™ enables developers to quickly and easily get started with deep learning in the cloud.

The framework has broad support in the industry and has become a popular choice for deep learning research and application development, particularly in areas such as computer vision, natural language understanding and speech translation.

Page 15: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 16: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Running TensorFlow on SageMaker

• SageMaker Python SDK – Open source APIs that make it easy to train and deploy models in Amazon SageMaker• Documentation - https://github.com/aws/sagemaker-python-sdk

Page 17: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Training with Script Mode

Page 18: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Training with Script Mode

SageMaker will call the entry_point

Page 19: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 20: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Training Metrics

The SageMaker Python SDK allows you to specify a name and a regular expression for metrics you want to track for training.

A regular expression (regex) matches what is in the training algorithm logs, like a search function.

Page 21: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 22: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 23: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

SageMaker Pipe Mode

Dataset is streamed directly to your training instances instead of being downloaded first.

This means that your training jobs :

• start sooner

• finish quicker

• need less disk space

Page 24: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 25: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT

Distributed Training

• Types of distributed training• parameter server

• Horovod

Page 26: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 27: Using TensorFlow with Amazon SageMaker Marketing... · Automatic Model Tuning—early stopping | IP Insights algorithm | Chainer 4.1 Container | Region expansion to SIN Built-in Algorithms

Thank you!

SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Yuval FernbachSpecialist Solutions Architect – ML, EMEA