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

JAWS-UG AI ML #11 SageMaker Updates

JAWS-UG AI ML #11 SageMaker Updates

Amazon SageMaker アップデート

JAWS-UG AI/ML #11 での発表資料です
https://jawsug-ai.connpass.com/event/216573/

こちらの Twitter スレッドに URL などを記載しています
https://twitter.com/_hariby/status/1410190629817110538?s=20

Yoshitaka Haribara

June 30, 2021
Tweet

More Decks by Yoshitaka Haribara

Other Decks in Technology

Transcript

  1. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker
    アップデート
    JAWS-UG AI/ML #11
    Yoshitaka Haribara, Ph.D.
    Startup Solutions Architect, AWS

    View Slide

  2. Yoshitaka Haribara, Ph. D.
    Startup Solutions Architect
    Tokyo, Japan
    日本でスタートアップ担当の
    ソリューションアーキテクトとして
    機械学習基盤の設計・構築の相談を受けています
    趣味はドラム 🥁
    DAW ソフトウェア
    (e.g. GarageBand, Logic Pro, Pro Tools) にも興味あり
    好きな AWS サービスは
    Amazon SageMaker, Amazon Braket

    View Slide

  3. 8月号
    AWS テクノロジー講座 第4回
    機械学習の導入やサービス選定
    にあたっての考え方
    9月号
    AWS テクノロジー講座 第5回
    継続的にモデルを改善し続ける
    ための機械学習基盤
    10月号
    AWS テクノロジー講座 最終回
    機械学習のパフォーマンス向上
    のための技術
    Software Design に記事を書いたりしました
    「スタートアップのための AWS テクノロジー講座」 (2020年)

    View Slide

  4. JAWS-UG AI/ML 支部
    ㊗リブート 🎉

    View Slide

  5. 1. AWS AI/ML サービスおさらい
    2. AWS re:Invent 2020 以降で発表されたアップデート
    3. SageMaker Pipelines について
    Agenda

    View Slide

  6. VISION SPEECH TEXT SEARCH CHATBOTS PERSONALIZATION FORECASTING FRAUD CONTACT CENTERS
    Deep
    Learning
    AMIs &
    Containers
    GPUs &
    CPUs
    Elastic
    Inference
    Trainium Inferentia FPGA
    DeepGraphLibrary
    Amazon
    Rekognition
    Amazon
    Polly
    Amazon
    Transcribe
    +Medical
    Amazon
    Lex
    Amazon
    Personalize
    Amazon
    Forecast
    Amazon
    Comprehend
    +Medical
    Amazon
    Textract
    Amazon
    Kendra
    Amazon
    CodeGuru
    Amazon
    Fraud Detector
    Amazon
    Translate
    INDUSTRIAL AI CODE AND DEVOPS
    NEW
    Amazon
    DevOps Guru
    Voice ID
    For Amazon Connect
    Contact Lens
    NEW
    Amazon
    Monitron
    NEW
    AWS Panorama
    + Appliance
    NEW
    Amazon Lookout
    for Vision
    NEW
    Amazon Lookout
    for Equipment
    AWS の機械学習スタック
    NEW
    Amazon
    HealthLake
    HEALTH AI
    NEW
    Amazon Lookout
    for Metrics
    ANOMALY DETECTION
    Amazon
    Transcribe
    Medical
    Amazon
    Comprehend
    Medical
    Amazon
    SageMaker
    Label
    data
    NEW
    Aggregate &
    prepare data
    NEW
    Store & share
    features
    Auto ML Spark/R
    NEW
    Detect
    bias
    Visualize in
    notebooks
    Pick
    algorithm
    Train
    models
    Tune
    parameters
    NEW
    Debug &
    profile
    Deploy in
    production
    Manage
    & monitor
    NEW
    CI/CD
    Human
    review
    NEW: Model management for edge devices
    NEW: SageMaker JumpStart
    SAGEMAKER STUDIO IDE
    AI サービス: 機械学習の深い知識なしに利⽤可能
    ML サービス: 機械学習のプロセス全体を効率化するマネージドサービス
    ML フレームワークとインフラストラクチャ: 機械学習の環境を⾃在に構築して利⽤

    View Slide

  7. Amazon SageMaker overview
    PREPARE
    SageMaker Ground Truth
    Label training data for machine learning
    SageMaker Data Wrangler NEW
    Aggregate and prepare data for
    machine learning
    SageMaker Processing
    Built-in Python, BYO R/Spark
    SageMaker Feature Store NEW
    Store, update, retrieve, and share features
    SageMaker Clarify NEW
    Detect bias and understand
    model predic:ons
    BUILD
    SageMaker Studio Notebooks
    Jupyter notebooks with elastic compute and
    sharing
    Built-in and Bring
    your-own Algorithms
    Dozens of optimized algorithms or bring your
    own
    Local Mode
    Test and prototype on your local machine
    SageMaker Autopilot
    Automatically create machine learning models
    with full visibility
    SageMaker JumpStart NEW
    Pre-built solutions for common use cases
    TRAIN & TUNE
    Managed Training
    Distributed infrastructure management
    SageMaker Experiments
    Capture, organize, and compare
    every step
    Automatic
    Model Tuning
    Hyperparameter op:miza:on
    Distributed Training NEW
    Training for large datasets
    and models
    SageMaker Debugger NEW
    Debug and profile training runs
    Managed Spot Training
    Reduce training cost by 90%
    DEPLOY & MANAGE
    Managed Deployment
    Fully managed, ultra low latency,
    high throughput
    Kubernetes & Kubeflow
    Integration
    Simplify Kubernetes-based
    machine learning
    Multi-Model Endpoints
    Reduce cost by hosting multiple models
    per instance
    SageMaker Model Monitor
    Maintain accuracy of deployed models
    SageMaker Edge Manager NEW
    Manage and monitor models on
    edge devices
    SageMaker Pipelines NEW
    Workflow orchestration and automation
    Amazon SageMaker
    SageMaker Studio
    Integrated development environment (IDE) for ML

    View Slide

  8. 全部は紹介しきれないので
    AWS Summit Online 動画を
    https://www.youtube.com/watch?v=x28_DF5polM

    View Slide

  9. 更に詳しくは AWS re:Invent アップデートまとめブログ
    https://aws.amazon.com/jp/blogs/news/reinvent-recap-ai-ml-20/

    View Slide

  10. AWS to offer NVIDIA A100 Tensor Core
    GPU-based Amazon EC2 instances
    https://aws.amazon.com/blogs/machine-
    learning/aws-to-offer-nvidia-a100-tensor-
    core-gpu-based-amazon-ec2-instances/

    View Slide

  11. Amazon EC2 P4d インスタンス
    NVIDIA A100 Tensor Core GPU を搭載した P4d インスタンス
    • p4d.24xlarge (A100 x 8枚搭載) の 1サイズのみの提供 (表参照)
    • GPU間は 600 GB/s の NVSwitch/NVLink で接続
    • インスタンスあたり 400 Gbps の EFA 対応の⾼速なネットワークインターフェース
    • 1 TBのNVMe SSD を8枚搭載しており、RAID0 構成時、最⼤ 16 GB/s のスループット
    • Multi-Instance GPU (MIG) にも対応
    https://aws.amazon.com/jp/ec2/instance-types/p4/ * p3dn.24xlarge: 31.212 USD/h

    View Slide

  12. P4d のパフォーマンス
    様々な深層学習モデルのトレーニングにおいて、P3dn よりも2倍以上⾼速
    Throughput Improvement
    DNN
    P3dn FP32
    (imgs/sec)
    P3dn FP16
    (imgs/sec)
    P4d TF32
    (imgs/sec)
    P4d FP16
    (imgs/sec)
    P4d over p3dn
    TF32/FP32
    P4d over P3dn
    FP16
    Resnet50 3057 7413 6841 15621 2.2x 2.1x
    Resnet152 1145 2644 2823 5700 2.5x 2.2x
    Inception3 2010 4969 4808 10433 2.4x 2.1x
    Inception4 847 1778 2025 3811 2.4x 2.1x
    VGG16 1202 2092 4532 7240 3.8x 3.5x
    Alexnet 32198 50708 82192 133068 2.6x 2.6x
    SSD300 1554 2918 3467 6016 2.2x 2.1x
    https://aws.amazon.com/jp/blogs/compute/amazon-ec2-p4d-instances-deep-dive/
    https://github.com/aws-samples/deep-learning-models

    View Slide

  13. Habana Gaudi-based Amazon EC2
    深層学習モデルのトレーニング⽤に特別に設計された、
    Habana Labs の Gaudi アクセラレータを搭載した EC2 インス
    タンス
    • 8カードの Gaudi アクセラレーターでの深層学習トレーニン
    グにより、現在の GPU ベースの EC 2インスタンスより最
    ⼤40%優れたコストパフォーマンス
    • TensorFlow, PyTorch などをサポート。⾃然⾔語処理、物体
    検出・分類、リコメンドやパーソナライズなど、深層学習
    のトレーニングワークロードに最適
    • Amazon EC2 に加え、Amazon EKS/ECS, Amazon
    SageMaker が対応予定
    Coming in
    2021!
    https://habana.ai/wp-
    content/uploads/pdf/2020/Habana%20Gaudi%20customer%20enableme
    nt%20on%20AWS%20December%202020.pdf

    View Slide

  14. AWS Trainium
    AWS により設計された⾼性能な機械学習トレーニングチップ
    • クラウドで ML モデルをトレーニングするための最⾼のコスト
    パフォーマンスを提供
    • AWS Inferentia 同様 Neuron SDK を利⽤し、TensorFlow,
    MXNet, PyTorch といったフレームワークをサポート
    • Trainium チップは、画像分類、セマンティック検索、翻訳、⾳
    声認識、⾃然⾔語処理、レコメンデーションエンジンなど、ア
    プリケーションのディープラーニングトレーニングワークロー
    ド向けに特別に最適化
    • Amazon EC2 インスタンスに加え、AWS Deep Learning AMI,
    Amazon SageMaker, Amazon ECS, EKS, AWS Batch などのマ
    ネージドサービスを介して利⽤可能
    Coming in
    2021!

    View Slide

  15. © 2021, Amazon Web Services, Inc. or its Affiliates.
    SageMaker Python SDK (v2)
    https://sagemaker.readthedocs.io/en/stable/v2.html
    import sagemaker
    from sagemaker.pytorch import PyTorch # 各フレームワークに対応した Estimator クラス
    estimator = PyTorch("train.py", # トレーニングスクリプトなどを指定して初期化
    role=sagemaker.get_execution_role(),
    instance_count=1,
    instance_type="ml.p3.2xlarge",
    framework_version="1.6.0",
    py_version="py3")
    estimator.fit("s3://mybucket/data/train") # fit でトレーニング
    predictor = estimator.deploy(initial_instance_count=2, # 2以上にすると Multi-AZ
    instance_type="ml.m5.xlarge") # deploy でエンドポイント作成
    少し命名規則が
    変わっています

    View Slide

  16. SageMaker Pipelines

    View Slide

  17. 17
    © 2020 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    機械学習ワークフローの作成・管理は大変
    モデルトレーニング
    データ準備 モデルデプロイ
    機械学習における CI/CD

    View Slide

  18. 19
    © 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    Amazon SageMaker Pipelines
    機械学習の CI/CD をおこなうマネージドサービス
    ワークフローの
    各ステップを
    中心的に管理
    事前に用意された
    テンプレート
    ワークフローの
    再実行と共有
    ワークフローを
    視覚化

    View Slide

  19. 20
    © 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    Amazon
    SageMaker
    Pipelines
    利用のメリット
    数行書くだけで、自動化された機械学習ワークフローを構築
    数ヶ月かかるコーディング時間を数時間に削減
    機械学習の開発を加速
    モデル成果物を自動でトラッキングし手動管理の手間を削減
    モデル成果物を自動的にトラッキング
    ビルトインのテンプレートで CI/CD パイプラインを設定し
    機械学習モデルをスケーラブルにデプロイ
    本番環境における数千ものモデルにスケール

    View Slide

  20. 21
    © 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    Amazon SageMaker Pipelines 概要
    Amazon SageMaker
    Pipelines
    フルマネージドな
    機械学習ワークフローを構築
    Model registry
    モデルバージョン、
    メトリクス、承認、
    モデルデプロイのカタログ化
    Real-time
    inference
    Batch scoring
    Input data
    Model drift
    Prepare or
    transform
    Explain
    Train
    Validate
    CI/CD とモデル系列追跡で ML Ops の自動化

    View Slide

  21. 22
    © 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    How Amazon SageMaker Pipelines works
    パイプライン実行の開始:
    • 手動
    • データアップロード時の
    CloudWatch イベント
    • コード check-in
    (git push)
    Acceptable
    accuracy
    Non-acceptable
    accuracy
    Get input
    data
    Process
    data
    Train
    model
    Validation
    Deploy
    model
    Alert
    and stop

    View Slide

  22. 23
    © 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    パイプライン実行の詳細とリアルタイムのメトリクス
    • 完了したステップの確認と
    実行中のステップの
    モニタリング
    • 出力メトリクスとログを確認
    • 各ステップのパラメータを
    モニター、変更、管理

    View Slide

  23. 24
    © 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved |
    モデルのプロダクションデプロイを承認

    View Slide

  24. Stage:
    Deploy Produc2on
    CloudFormation
    DeployProduction
    https://github.com/aws/amazon-sagemaker-examples/blob/master/sagemaker-pipelines/tabular/customizing_build_train_deploy_project/sagemaker-pipelines-customized-project.ipynb

    View Slide

  25. 他にもある AWS のワークフロー管理ツール
    • サーバーレスオーケストレーション
    サービス
    • 分散アプリケーション・マイクロサー
    ビスの全体を「ステートマシン」と呼
    ばれる仕組みでオーケストレート
    • 定義したステートマシンは AWS コン
    ソールから「ワークフロー」という形
    式で可視化
    • ステートマシンの各ステップの実⾏履
    歴をログから追跡できる
    • Apache Airflow によるワークフローを構
    築可能なマネージドサービス
    • ETLジョブやデータパイプラインを実⾏
    するワークフローをマネージド型で実⾏
    可能。開発者がビジネス上の課題解決に
    注⼒できるようにする
    • Airflowのメトリクスを CloudWatch メト
    リクスとして扱い、ログを CloudWatch
    Logs に転送可能
    Amazon SageMaker Pipelines
    Amazon Managed Workflows for
    Apache Airflow (MWAA)
    AWS Step Functions
    w/Data Science SDK (Python)
    • 機械学習の CI/CD を実現する
    Amazon SageMaker の機能
    • 機械学習ワークフローのデータ
    ロードや学習処理などの⼀連の処
    理ステップを任意のタイミングや
    所定の時間に実⾏できる
    • 各ステップの処理結果は
    SageMaker Experiments で記録さ
    れ、モデルの出来映えや学習パラ
    メータなどを視覚化できる

    View Slide

  26. デモ動画 by Julien Simon
    • SageMaker Data Wrangler
    − https://www.youtube.com/watch?v=tbGGOic21PU
    • SageMaker Feature Store
    − https://www.youtube.com/watch?v=-ydEYWhYlYw
    • SageMaker Pipelines
    − https://www.youtube.com/watch?v=Hvz2GGU3Z8g
    − https://www.youtube.com/watch?v=2CF-LBZjTn0

    View Slide

  27. その他コンテンツ
    • AWS ブログ (SageMaker カテゴリ)
    − イベントレポートやユースケースの紹介など色々あります
    § https://aws.amazon.com/jp/blogs/news/category/artificial-
    intelligence/sagemaker/
    • AWS Startup ブログ
    − 他のスタートアップは AWS 使ってどんな感じで機械学習やってるの?
    と聞かれるのでSageMaker と Personalize の事例まとめブログを書きました
    § https://aws.amazon.com/jp/blogs/startup/tech-case-study-jp-startup-ai-ml/
    • SageMaker Immersion Day
    − ハンズオンコンテンツ
    § https://sagemaker-immersionday.workshop.aws/ja/

    View Slide

  28. Thank you
    © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    @_hariby

    View Slide