Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build, train, and deploy Machine Learning Models at scale

Build, train, and deploy Machine Learning Models at scale

AWS DevDays DACH 2019

Antje Barth

October 23, 2019
Tweet

More Decks by Antje Barth

Other Decks in Technology

Transcript

  1. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Build, train, and deploy Machine Learning models at scale A M L 3 D A C H 2 0 1 9 2 0 1 9 Antje Barth Technical Evangelist AI and Machine Learning Amazon Web Services @anbarth
  2. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Our mission at AWS Put machine learning in the hands of every developer
  3. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FRAMEWORKS INTERFACES INFRASTRUCTURE AI Services The AWS ML stack VISION SPEECH LANGUAGE CHATBOTS FORECASTING RECOMMENDATIONS ML Services ML Frameworks + Infrastructure A M A Z O N P O L L Y A M A Z O N T R A N S C R I B E A M A Z O N T R A N S L A T E A M A Z O N C O M P R E H E N D & A M A Z O N C O M P R E H E N D M E D I C A L A M A Z O N L E X A M A Z O N F O R E C A S T A M A Z O N R E K O G N I T I O N I M A G E A M A Z O N R E K O G N I T I O N V I D E O A M A Z O N T E X T R A C T A M A Z O N P E R S O N A L I Z E F P G A s E C 2 P 3 & P 3 D N E C 2 G 4 E C 2 C 5 A W S I N F E R E N T I A A W S I o T G R E E N G R A S S A M A Z O N E L A S T I C I N F E R E N C E A W S D L C O N T A I N E R S & A M I s A M A Z O N E L A S T I C K U B E R N E T E S S E R V I C E A M A Z O N E L A S T I C C O N T A I N E R S E R V I C E Amazon SageMaker Ground Truth Notebooks Algorithms + Marketplace Reinforcement Learning Training Optimization Deployment Hosting h t t p s : / / m l . a w s
  4. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FRAMEWORKS INTERFACES INFRASTRUCTURE AI Services VISION SPEECH LANGUAGE CHATBOTS FORECASTING RECOMMENDATIONS ML Services ML Frameworks + Infrastructure A M A Z O N P O L L Y A M A Z O N T R A N S C R I B E A M A Z O N T R A N S L A T E A M A Z O N C O M P R E H E N D & A M A Z O N C O M P R E H E N D M E D I C A L A M A Z O N L E X A M A Z O N F O R E C A S T A M A Z O N R E K O G N I T I O N I M A G E A M A Z O N R E K O G N I T I O N V I D E O A M A Z O N T E X T R A C T A M A Z O N P E R S O N A L I Z E F P G A s E C 2 P 3 & P 3 D N E C 2 G 4 E C 2 C 5 A W S I N F E R E N T I A A W S I o T G R E E N G R A S S A M A Z O N E L A S T I C I N F E R E N C E A W S D L C O N T A I N E R S & A M I s A M A Z O N E L A S T I C K U B E R N E T E S S E R V I C E A M A Z O N E L A S T I C C O N T A I N E R S E R V I C E Amazon SageMaker Ground Truth Notebooks Algorithms + Marketplace Reinforcement Learning Training Optimization Deployment Hosting The AWS ML stack h t t p s : / / m l . a w s
  5. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS is framework agnostic Choose from popular frameworks Run them fully managed Or run them yourself
  6. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Machine Images pre-configured with deep learning frameworks and GPU/CPU drivers AWS Deep Learning AMIs AWS Deep Learning Containers Docker images pre-installed with deep learning frameworks https://aws.amazon.com/ machine- learning/containers http://aws.amazon.com/ machine-learning/amis AWS helps you build self-managed Machine Learning environments with DYI services
  7. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FRAMEWORKS INTERFACES INFRASTRUCTURE AI Services VISION SPEECH LANGUAGE CHATBOTS FORECASTING RECOMMENDATIONS ML Services ML Frameworks + Infrastructure A M A Z O N P O L L Y A M A Z O N T R A N S C R I B E A M A Z O N T R A N S L A T E A M A Z O N C O M P R E H E N D & A M A Z O N C O M P R E H E N D M E D I C A L A M A Z O N L E X A M A Z O N F O R E C A S T A M A Z O N R E K O G N I T I O N I M A G E A M A Z O N R E K O G N I T I O N V I D E O A M A Z O N T E X T R A C T A M A Z O N P E R S O N A L I Z E F P G A s E C 2 P 3 & P 3 D N E C 2 G 4 E C 2 C 5 A W S I N F E R E N T I A A W S I o T G R E E N G R A S S A M A Z O N E L A S T I C I N F E R E N C E A W S D L C O N T A I N E R S & A M I s A M A Z O N E L A S T I C K U B E R N E T E S S E R V I C E A M A Z O N E L A S T I C C O N T A I N E R S E R V I C E Amazon SageMaker Ground Truth Notebooks Algorithms + Marketplace Reinforcement Learning Training Optimization Deployment Hosting The AWS ML stack h t t p s : / / m l . a w s
  8. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale 1 2 3
  9. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 1 2 3 Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  10. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  11. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  12. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  13. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  14. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  15. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker: Build, Train, and Deploy ML Models at Scale
  16. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Build your dataset Business Problem ML problem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YES NO Data augmentation Feature augmentation Re-training
  17. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Annotating data at scale is time-consuming and expensive
  18. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker Ground Truth Build scalable and cost-effective labeling workflows K E Y F E A T U R E S Automatic labeling via machine learning Ready-made and custom workflows for image bounding box, segmentation, and text Integrated with Deep Learning algorithms in Amazon SageMaker Private and public human workforce
  19. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Prepare your dataset for Machine Learning Business Problem ML problem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YES NO Data augmentation Feature augmentation Re-training
  20. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Build, train and deploy models using SageMaker Business Problem ML problem framing Data collection Data integration Data preparation and cleaning Data visualization and analysis Feature engineering Model training and parameter tuning Model evaluation Monitoring and debugging Model deployment Predictions Are business goals met? YES NO Data augmentation Feature augmentation Re-training
  21. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Notebook instances • Fully managed EC2 instances, from T2 to P3 • G4 and R5 now available for inference – NEW! • Pre-installed with Jupyter and Conda environments • Python 2.7 & 3.6 • Open-source libraries (TensorFlow, Apache MXNet, etc.) • Beta support for R – NEW! • Amazon Elastic Inference for cost-effective GPU acceleration • Lifecycle configurations • VPC, encryption, etc. • Get to work in minutes, zero setup
  22. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. The Amazon SageMaker API • Python SDK orchestrating all Amazon SageMaker activity • High-level objects for algorithm selection, training, deploying, automatic model tuning, etc. https://github.com/aws/sagemaker-python-sdk • Spark SDK (Python & Scala) https://github.com/aws/sagemaker-spark/tree/master/sagemaker-spark-sdk • AWS SDK • Service-level APIs for scripting and automation • CLI: ‘aws sagemaker’ • Language SDKs: boto3, etc.
  23. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Training data Model Hosting Helper code Inference code Ground Truth Client application Inference code Training code Inference request Inference response Inference endpoint Amazon S3 Amazon EFS Amazon FSx for Lustre Model artifacts Amazon S3 NEW! Training code Helper code Model Training (on demand or spot) NEW!
  24. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Training code Factorization Machines Linear Learner Principal Component Analysis K-Means Clustering XGBoost And more Built-in Algorithms (17) No ML coding required No infrastructure work required Distributed training Bring Your Own Container Full control, run anything! R, C++, etc. No infrastructure work required Built-in Frameworks Bring your own code: Script mode Open-source containers No infrastructure work required Distributed training NEW! Model options
  25. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Built-in algorithms orange: supervised, blue: unsupervised Linear Learner: regression, classification Image Classification: Deep Learning (ResNet) Factorization Machines: regression, classification, recommendation Object Detection (SSD): Deep Learning (VGG or ResNet) K-Nearest Neighbors: non-parametric regression and classification Neural Topic Model: topic modeling XGBoost: regression, classification, ranking https://github.com/dmlc/xgboost Latent Dirichlet Allocation: topic modeling (mostly) K-Means: clustering Blazing Text: GPU-based Word2Vec, and text classification Principal Component Analysis: dimensionality reduction Sequence to Sequence: machine translation, speech to text and more Random Cut Forest: anomaly detection DeepAR: time-series forecasting (RNN) Object2Vec: general-purpose embedding IP Insights: usage patterns for IP addresses Semantic Segmentation: Deep Learning
  26. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Built-in frameworks: just add your code • Built-in containers for training and prediction • Open-source, e.g., https://github.com/aws/sagemaker-tensorflow-containers • Build them, run them on your own machine, customize them, etc. • Local mode: train and predict on your notebook instance, or on your local machine • Script mode: migrate existing code to SageMaker with minimal changes NEW!
  27. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Training ResNet-50 with the ImageNet dataset using our optimized build of TensorFlow 1.11 on a c5.18xlarge instance type is designed to be 11x faster than training on the stock binaries TensorFlow on AWS C5 instances (Intel Skylake) 65% 90% P3 instances (NVIDIA V100)
  28. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. https://gitlab.com/juliensimon/dlnotebooks/blob/master/keras/03-fashion-mnist- sagemaker/Fashion%20MNIST-SageMaker.ipynb Demo: Image classification with Keras/Tensorflow • train locally without Amazon SageMaker • train locally with Amazon SageMaker (’local mode’) • train on infrastructure managed by Amazon SageMaker
  29. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS Marketplace for Machine Learning
  30. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker Fully managed hosting with auto- scaling One-click deployment Pre-built notebooks for common problems Built-in, high- performance algorithms One-click training Hyperparameter optimization Build Train Deploy FREE TIER
  31. © 2019, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Getting started https://aws.amazon.com/free https://ml.aws https://aws.amazon.com/sagemaker https://github.com/aws/sagemaker-python-sdk https://github.com/aws/sagemaker-spark https://github.com/awslabs/amazon-sagemaker-examples
  32. Thank you! © 2019, Amazon Web Services, Inc. or its

    affiliates. All rights reserved. Antje Barth Technical Evangelist AI and Machine Learning Amazon Web Services @anbarth