$30 off During Our Annual Pro Sale. View Details »

Open-source on Amazon SageMaker

Open-source on Amazon SageMaker

Amazon SageMaker とオープンソースソフトウェアを連携させた効率の良いモデル開発

機械学習・深層学習のモデル開発に利用されるオープンソースソフトウェア (OSS) の多くを Amazon SageMaker はサポートしています。具体的には TensorFlow, PyTorch, MXNet に代表される深層学習フレームワークや、特定のタスクに特化した Hugging Face Transformers, Deep Graph Library (DGL)、AutoML のための AutoGluon などがあります。また、SageMaker JumpStart では TensorFlow Hub, PyTorch Hub モデルのワンクリックでの利用など AWS 上での環境構築やモデル開発が簡単に行えます。本セッションでは、OSS を用いたモデル開発が効率よく行えるような Amazon SageMaker の使い方についてご紹介します。

アマゾン ウェブ サービス ジャパン合同会社 スタートアップ ML ソリューションアーキテクト 針原 佳貴

Yoshitaka Haribara

February 24, 2022
Tweet

More Decks by Yoshitaka Haribara

Other Decks in Technology

Transcript

  1. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    2 4 F e b r u a r y 2 0 2 2

    View Slide

  2. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker と
    オープンソースソフトウェアを
    連携させた効率の良いモデル開発
    針原 佳貴
    アマゾン ウェブ サービス ジャパン合同会社
    スタートアップ ML ソリューションアーキテクト

    View Slide

  3. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    はじめに
    • AWS のオープンソースへの貢献
    • AWS が貢献する AI/ML オープンソース
    • PyTorch, Apache MXNet / Gluon, AutoGluon, Jupyter
    • ⾃然⾔語処理 (NLP): Hugging Face
    • グラフ (Graph Neural Network): Deep Graph Library (DGL)
    • Amazon SageMaker での AI/ML オープンソース活⽤法
    • SageMaker Python SDK, Deep Learning Container への統合
    • SageMaker Distributed Training (Data/Model) Parallel, Training Compiler
    • SageMaker JumpStart

    View Slide

  4. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS のオープンソースへの貢献

    View Slide

  5. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    オープンソースによる Builder ツールの改善

    View Slide

  6. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS
    Q1 18 Q2 18 Q3 18 Q4 18 Q1 19 Q2 19 Q3 19 Q4 19 Q1 20 Q2 20
    Amazon open source contributors
    Q1 18 Q2 18 Q3 18 Q4 18 Q1 19 Q2 19 Q3 19 Q4 19 Q1 20 Q2 20
    Repositories contributed to

    View Slide

  7. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    マネージドサービス で OSS の実運⽤をサポート
    Amazon Keyspaces for
    Apache Cassandra
    Amazon EKS
    (Kubernetes)
    FreeRTOS
    AWS RoboMaker
    (ROS)
    Amazon ElastiCache
    for Redis, Memcached
    AWS AppMesh
    (Envoy)
    TorchServe
    (Run PyTorch
    Models)
    AWS Lambda
    (Firecracker)
    Amazon OpenSearch
    Service

    View Slide

  8. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS が貢献する
    AI/ML の
    オープンソース
    AutoGluon
    State of the art の AutoML
    auto.gluon.ai/
    Apache MXNet
    mxnet.apache.org/
    Optimized DL Frameworks
    PyTorch, Tensorflow,
    Apache MXNet
    Hugging Face
    SageMaker Python SDK,
    DLC
    Kubernetes Support
    SageMaker Operators &
    Components
    Deep Graph Library (DGL)
    Graph Neural Networks
    www.dgl.ai/
    TorchServe
    PyTorch model server Deep Java Library (DJL)
    Java
    djl.ai/
    Dive into Deep Learning
    d2l.ai/

    View Slide

  9. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    TorchServe PyTorch
    PyTorch
    https://pytorch.org/serve/
    TorchElastic Controller for Kubernetes
    TorchElastic Kubernetes
    TorchElastic
    PyTorch
    PyTorch に対する AWS の貢献
    PyTorch

    View Slide

  10. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Meta、AWS を戦略的クラウドプロバイダーに選定
    • 5
    • AWS PyTorch

    AWS
    Meta
    AWS
    PyTorch
    Jason Kalich, VP of Production Engineering at Meta
    https://press.aboutamazon.com/news-releases/news-release-details/meta-selects-aws-key-long-term-strategic-cloud-provider
    https://aws.amazon.com/jp/about-aws/whats-new/2021/12/meta-selects-aws-key-long-term-strategic-cloud-provider/

    View Slide

  11. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker 上で
    OSS を活⽤する⽅法

    View Slide

  12. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS AI/ML
    AI SERVICES
    Code + DevOps
    Amazon CodeGuru
    Amazon DevOps Guru
    Business processes
    Amazon Personalize
    Amazon Forecast
    Amazon Fraud Detector
    Amazon Lookout for Metrics
    Search
    Amazon Kendra
    Industrial
    Amazon Monitron
    Amazon Lookout for Equipment
    Amazon Lookout for Vision
    Healthcare
    Amazon HealthLake
    Amazon Comprehend Medical
    Amazon Transcribe Medical
    SPECIALIZED
    Chatbots
    Amazon Lex
    Text & Documents
    Amazon Translate
    Amazon Comprehend
    Amazon Textract
    Speech
    Amazon Polly
    Amazon Transcribe
    Amazon Transcribe Call Analytics
    Vision
    Amazon Rekognition
    AWS Panorama
    CORE
    ML SERVICES Manage
    edge devices
    Learn
    ML
    No-code ML
    for business
    analysts
    Prepare
    data
    Store
    features
    Detect
    bias
    Build with
    notebooks
    Manage
    & monitor
    Train
    models
    Deploy in
    production
    Tune
    parameters
    Explain
    predictions
    CI/CD
    Label
    data
    SAGEMAKER
    CANVAS
    SAGEMAKER
    STUDIO LAB
    AMAZON SAGEMAKER STUDIO IDE
    ML FRAMEWORKS
    & INFRASTRUCTURE
    TensorFlow,
    PyTorch,
    Apache MXNet,
    Hugging Face
    Amazon EC2 CPUs GPUs AWS Trainium
    Elastic
    inference
    AWS Inferentia FPGA
    Habana
    Gaudi
    Deep Learning
    Containers (DLC)

    View Slide

  13. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AWS AI/ML
    AI SERVICES
    Code + DevOps
    Amazon CodeGuru
    Amazon DevOps Guru
    Business processes
    Amazon Personalize
    Amazon Forecast
    Amazon Fraud Detector
    Amazon Lookout for Metrics
    Search
    Amazon Kendra
    Industrial
    Amazon Monitron
    Amazon Lookout for Equipment
    Amazon Lookout for Vision
    Healthcare
    Amazon HealthLake
    Amazon Comprehend Medical
    Amazon Transcribe Medical
    SPECIALIZED
    Chatbots
    Amazon Lex
    Text & Documents
    Amazon Translate
    Amazon Comprehend
    Amazon Textract
    Speech
    Amazon Polly
    Amazon Transcribe
    Amazon Transcribe Call Analytics
    Vision
    Amazon Rekognition
    AWS Panorama
    CORE
    ML SERVICES Manage
    edge devices
    Learn
    ML
    No-code ML
    for business
    analysts
    Prepare
    data
    Store
    features
    Detect
    bias
    Build with
    notebooks
    Manage
    & monitor
    Train
    models
    Deploy in
    production
    Tune
    parameters
    Explain
    predictions
    CI/CD
    Label
    data
    SAGEMAKER
    CANVAS
    SAGEMAKER
    STUDIO LAB
    AMAZON SAGEMAKER STUDIO IDE
    ML FRAMEWORKS
    & INFRASTRUCTURE
    Amazon EC2 CPUs GPUs AWS Trainium
    Elastic
    inference
    AWS Inferentia FPGA
    Habana
    Gaudi
    TensorFlow,
    PyTorch,
    Apache MXNet,
    Hugging Face
    Deep Learning
    Containers (DLC)

    View Slide

  14. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SageMaker JumpStart
    事前構築済みモデルへの容易なアクセス
    • TensorFlow Hub, PyTorch Hub
    • テキスト: Hugging Face
    • 画像: GluonCV
    • テーブルデータ: LightGBM, CatBoost,
    XGBoost, Scikit-learn Linear Models
    • Amazon SageMaker JumpStart adds LightGBM
    and CatBoost Models for Tabular Data
    https://aws.amazon.com/about-aws/whats-
    new/2022/01/amazon-sagemaker-jumpstart-
    lightgbm-catboost-tabular/
    Documentation: SageMaker JumpStart
    https://docs.aws.amazon.com/sagemaker/latest
    /dg/studio-jumpstart.html

    View Slide

  15. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SageMaker Studio IDE

    View Slide

  16. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Jupyter
    computational narrative
    AWS Jupyter
    Jupyter
    Jupyter
    Jupyter
    • Jupyter Steering Council (Brian Granger, AWS)
    • JupyterLab, JupyterLab Git, Jupyter Server, Notebook,
    Kernel Gateway
    • NumFOCUS Advisory Board
    Jupyter
    • Amazon SageMaker Studio
    Jupyter
    • SSO 規

    View Slide

  17. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker Studio Notebook での
    モデル開発
    • TensorFlow, PyTorch, MXNet
    • Available Amazon SageMaker
    Kernels
    https://docs.aws.amazon.com/sage
    maker/latest/dg/notebooks-
    available-kernels.html

    View Slide

  18. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Gluon
    Swami Sivasubramanian, VP of Amazon AI
    Gluon GluonCV
    state-of-the-art
    https://cv.gluon.ai/
    GluonNLP (NLP)
    https://nlp.gluon.ai/
    SageMaker Studio で MXNet
    GluonCV/GluonNLP
    Jupyter Notebook

    View Slide

  19. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMakerで深層学習フレームワークを利⽤する
    Deep Learning Containers (DLC)
    PyTorch, TensorFlow, MXNet, Hugging Face フレームワークなど、
    トレーニングと推論、それぞれのために開発
    SageMaker SDK の Deep Learning Framework Estimator
    Docker について気にすることなく、
    スケーラブルで費⽤対効果の⾼い SageMaker トレーニングジョブの起動
    Example ギャラリー
    Amazon SageMaker で動く深層学習フレームワークの⾼品質なサンプルスクリプト
    サポート
    AWS によるメンテナンスとサポート

    View Slide

  20. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMakerで深層学習フレームワークを実⾏するメリット
    コスト効率 - SageMaker はスケール、パフォーマンス、効率性を最適化してコスト
    を削減。Managed Spot Training や Savings Plans でさらに節約
    MLOps - SageMaker で の メ タ デ ー タ の 永 続 化 と 検 索 の ⾃ 動 化 、 Amazon
    CloudWatch へのログ抽出、SageMaker Debugger と Profiler によるモニタリング、
    および実験管理
    スケーラブル – Amazon SageMaker が提供する効率的なデータ並列およびモデル
    並列で、 GPU クラスター上での分散学習が実⾏可能。API の⾮同期モードで、
    複数ジョブを同時に起動
    安全性 – 保管時および転送中のデータ暗号化、VPC 接続、きめ細かい IAM 権管理
    限などのメカニズムにより、⾼いセキュリティレベルを実現

    View Slide

  21. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker でのモデル開発フロー
    SageMaker
    Studio Notebook
    でスクリプト開発
    BUILD
    1
    Deep Learning
    Containers (DLC)
    でトレーニング
    TRAIN
    チューニングと
    実験管理
    2
    SageMaker
    Endpoint
    へデプロイ
    DEPLOY
    3
    自前環境デプロイ用
    には S3 からモデルを
    ダウンロード
    SageMaker Python
    SDK でトレーニング・
    デプロイを呼び出し
    SageMaker Python SDK または DLC
    でサポートされる OSS は簡単に使える

    View Slide

  22. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SageMaker Python SDK
    import sagemaker
    # 各フレームワークに対応した Estimator クラス
    from sagemaker.pytorch import PyTorch
    estimator = PyTorch("train.py",
    role=sagemaker.get_execution_role(),
    instance_count=1,
    instance_type="ml.p3.2xlarge",
    framework_version="1.8.0",
    py_version="py3")
    # モデルトレーニング
    estimator.fit(“s3://mybucket/data/train”)
    # デプロイ
    predictor = estimator.deploy(initial_instance_count=2, instance_type="ml.m5.xlarge")
    # 推論の実⾏
    predictor.predict(data)
    https://sagemaker.readthedocs.io/en/stable/v2.html

    View Slide

  23. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Hugging Face on
    Amazon SageMaker

    View Slide

  24. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Hugging Face
    NLP
    オープンソース
    Datasets, Tokenizers, and Transformers
    ⼈気
    56,000+ の GitHub Star (2022年1⽉時点)
    1 か⽉あたり 100+ 万回のダウンロード
    直感的
    PyTorch または TensorFlow に基づいた NLP 特化の Python フロントエンド
    State of the art
    Transformer ベースのモデルは最先端で、転移学習とスケーラビリティを実現
    包括的
    10,000+ のモデルアーキテクチャ、240+ ⾔語を備えた Model Hub
    Hugging Face ライブラリの特徴

    View Slide

  25. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    NLP をすべての⼈が簡単に利⽤できるようにする
    AWS との強⼒なパートナーシップ
    Hugging Face は、
    最先端の NLP テクノロジーを提供する
    最も⼈気のあるオープンソース企業
    Hugging Face
    NLP モデルのトレーニングで
    使⽤するための⾼性能なリソース
    を提供する SageMaker との統合
    AWS

    View Slide

  26. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker で
    Hugging Face を使った学習
    SageMaker
    Studio Notebook
    でスクリプト開発
    BUILD
    1
    Hugging Face DLC
    でトレーニング
    TRAIN
    チューニングと
    実験管理
    2
    SageMaker
    Endpoint
    へデプロイ
    DEPLOY
    3
    自前環境デプロイ用
    には S3 からモデルを
    ダウンロード
    SageMaker Python
    SDK でトレーニング・
    デプロイを呼び出し
    PIPE モード、FSx for Lustre
    または EFS でトレーニングデータ
    読み込みをスケーリング
    SageMaker
    分散学習ライブラリと
    トレーニングコンパイラ
    SageMaker Debugger
    でデバッグ・
    プロファイリング

    View Slide

  27. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Hugging Face + PyTorch
    S a g e M a k e r P y t h o n S D K で の 呼 び 出 し
    https://github.com/huggingface/notebooks/blob/master/sagemaker/01_getting_started_pytorch/sagemaker-notebook.ipynb

    View Slide

  28. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Hugging Face + TensorFlow
    S a g e M a k e r P y t h o n S D K で の 呼 び 出 し
    https://github.com/huggingface/notebooks/blob/master/sagemaker/02_getting_started_tensorflow/sagemaker-notebook.ipynb

    View Slide

  29. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    NLP は機械翻訳を⾼速かつ正確にし、多くのアプリケーションから翻
    訳が利⽤可能に
    ⾃然⾔語処理
    (NLP)
    NLP は多くの⼈に使いやすい
    機能を提供し、その利⽤は企
    業のビジネスに⼤きな影響を
    与える可能性があります。
    ⾔語翻訳
    ⾮構造化テキストからトピックやセンチメントを抽出し、分析やデータ
    ドリブンなビジネス上の意思決定に役⽴てる
    テキスト分析
    NLP は、⾃然⾔語による質問と⼈間中⼼のインターフェイスを使⽤し
    て、強⼒なクエリおよび検索機能を提供
    ⾃然なクエリと検索
    Amazon Alexa のような⾳声を使ったヒューマンフレンドリーなインタ
    ラクションを幅広いカテゴリーのデバイスに提供
    スマート⾳声アシスタント
    データソースからのデータ品質が向上し、複雑で⾯倒なデータクレン
    ジング操作を軽減
    スペルチェックと⽂法チェック

    View Slide

  30. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    NLP モデルのサイズは指数的に増加
    最先端の NLP モデルサイズのトレンド
    Source: https://arxiv.org/abs/2104.04473

    View Slide

  31. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    ハードウェアのトレンド
    インスタンスタイプ 発表時期 GPU GPU MEMORY
    P2.16xlarge September 2016 NVIDIA K80 12 GB
    P3.16xlarge October 2017 NVIDIA V100 16 GB
    P3dn.24xlarge December 2018 NVIDIA V100 32 GB
    P4d.24xlarge November 2020 NVIDIA A100 40 GB
    ハードウェアキャパシティも増加傾向だがモデルのパラメータ数変化には追いつかず
    Trn1 (AWS Trainium ) T2-5

    View Slide

  32. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker
    での分散学習
    https://aws.amazon.com/sagemaker/distributed-training/
    トレーニング時間
    の削減
    TensorFlow, PyTorch,
    HuggingFace を
    サポート
    ⾃動的・効率的な
    モデル分割
    最⼩限の
    コード変更
    効率的な
    パイプライン化
    (
    GPU )
    AWS ネットワーク・
    ハードウェアに
    最適化
    モデル並列 データ並列

    View Slide

  33. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker 分散学習ベンチマーク
    ModelParallel training with T5-3B
    DataParallel training
    Model Instances
    Performance with
    modelparallel
    Performance without
    modelparallel
    T5-3B 8 P4d.24xlarge 299 seq/s OOM
    T5-3B 8 P4d.24xlarge 263 seq/s OOM
    T5-3B 256 P4d.24xlarge 4.68 days OOM
    Model Instances
    Performance with
    dataparallel
    Speed up
    RoBERTa (1.3B) 30 P4d.24xlarge 1.85 iter/s 32.4%
    RoBERTa (1.3B) 16 P4d.24xlarge 2.00 iter/s 33.1%

    View Slide

  34. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SageMaker Training Compiler は
    多くの NLP モデルトレーニングを⾼速化
    bert-base-uncased
    bert-large-uncased
    roberta-base
    gpt2
    bert-base-cased
    xlm-roberta-base
    bert-base-chinese
    roberta-large
    distilbert-base-
    uncased
    distilbert-base-
    uncased-finetuned-
    sst-2-English
    cl-tohoku/bert-
    base-japanese-
    whole-word-
    masking
    bert-base-
    multilingual-cased
    distilgpt2
    albert-base-v2
    gpt2-large

    View Slide

  35. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SageMaker Training Compiler で最⼤50%の速度向上
    課⾦時間の
    削減
    BERT base distilBERT RoBERTa base GPT-2
    38% 26% 27% 54%
    トレーニングスループット*
    (samples/second)
    PyTorch
    PyTorch with
    SageMaker
    Training
    Compiler
    73
    96
    47
    81
    62
    84
    137
    170

    View Slide

  36. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    SageMaker Training Compiler は数分で設定可能

    View Slide

  37. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Deep Learning Container
    イメージを SageMaker で使う

    View Slide

  38. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Docker
    :
    TensorFlow, PyTorch, Apache MXNet, Hugging Face, AutoGluon,
    Habana
    AWS
    Ubuntu Amazon Linux 2 CUDA
    , Intel MKL, Anaconda, Python3
    オープンソースの機械学習を
    すべての開発者やデータサイエンティストの⼿に
    「AWS には、お客様にとって重要なそれぞれのフレームワークに専念
    する専任チームがあり、パフォーマンスを最適化し、AWS やその他の
    場所でパフォーマンスを向上させることができます。」
    Andy Jassy, CEO of Amazon
    AWS Deep Learning
    Containers
    (GitHub )
    https://github.com/aws/deep-learning-containers

    View Slide

  39. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    • 特徴量作成
    • モデルの学習
    • 最適なモデルの選択
    • ハイパーパラーメーター最適化
    • アーキテクチャ探索
    Ø ベースとなる機械学習モデルの
    プロトタイピングや精度の追求を素早く可能に
    https://auto.gluon.ai
    AutoGluon
    AutoML

    View Slide

  40. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AutoGluon の⼿軽さ - fit API
    from autogluon.tabular import TabularPredictor
    predictor = TabularPredictor(label="COLUMN_NAME").fit(train_data="TRAIN_DATA.csv")
    predictions = predictor.predict(TEST_DATA.csv)
    • 上は AutoGluon Tabular (テーブルデータ) の例、画像・テキストデータにも同様に記述可能
    • fit() が実⾏されると AutoGluon Tabular は以下の処理を⾃動的に実⾏
    1. データの前処理 (各カラムを数値・カテゴリ・テキストに分類)
    2. ラベルカラムから推論タスクを決定 (分類・回帰)
    3. データの分離 (e.g. disjoint training/validation sets, k-fold split)
    4. 各モデルを個々に学習 (Random Forest, k-NN, LightGBM, Neural Network, etc.)
    5. 最適化されたアンサンブルを作成

    View Slide

  41. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AutoGluon の SageMaker での利⽤
    • Deep Learning Containers (DLC)
    イメージ URI を指定
    • このサンプルでは AutoGluonTraining
    という名前のクラスでイメージ URI を取得

    View Slide

  42. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Deep Graph Library (DGL)
    • Graph Neural Network (GNN) のためのライブラリ
    • 応⽤例:
    創薬
    (Graph-level prediction)
    映画のレコメンデーション
    (Edge-level prediction)
    詐欺ユーザーの検知
    (Node-level prediction)

    View Slide

  43. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon SageMaker での DGL 利⽤
    • Studio で PyTorch/MXNet
    DGL
    Jupyter Notebook
    • Deep Learning Coniainer (DLC)
    PyTorch/MXNet
    • Train a Deep Graph Network
    https://docs.aws.amazon.com/sage
    maker/latest/dg/deep-graph-
    library.html

    View Slide

  44. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    まとめ
    • AWS はオープンソースソフトウェア・プロジェクトに貢献し、
    イノベーションを実運⽤レベルで活⽤できるようマネージドサービスを提供。
    • SageMaker Studio Notebook (SageMaker Python SDK) で開発、
    Deep Learning Containers を使ってトレーニング・推論することで、
    環境構築の⼿間なく⾼いパフォーマンスで深層学習を実⾏。
    • 主に紹介した OSS
    • PyTorch, Apache MXNet / Gluon, AutoGluon, Hugging Face, Deep Graph Library (DGL), Jupyter
    • 紹介した SageMaker の機能
    • SageMaker Distributed Training (Data/Model) Parallel, Training Compiler
    • SageMaker JumpStart

    View Slide

  45. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    ご清聴ありがとうございました
    Email: [email protected]
    Twitter: @_hariby

    View Slide

  46. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Additional resources
    • Amazon SageMaker Neo (based on OSS projects like Apache TVM that AWS actively contributes to)
    • Apache MXNet on AWS (in Amazon SageMaker)
    • Multi Model Server (model server for MXNet and ONNX)
    • Gluon (open sourced by AWS and Microsoft) – library for machine learning
    § AutoGluon (open sourced by AWS) – AutoML toolkit for Deep Learning
    § Gluon Time Series (GluonTS) (open sourced by AWS) – Gluon toolkit for probabilistic time series modeling, focusing on deep learning-based models. Announcing
    Gluon Time Series, an Open-Source Time Series Modeling Toolkit
    § Gluon Natural Language Processing toolkit (GluonNLP)
    § Gluon Computer Vision Toolkit (GluonCV)
    • PyTorch on AWS (in Amazon SageMaker)
    § TorchServe (open sourced by AWS and Facebook) – PyTorch model serving. Announcing TorchServe, An Open Source Model Server for PyTorch
    • Sockeye (open sourced by AWS) – sequence-to-sequence framework with a focus on Neural Machine Translation, based on Apache MXNet.
    • TensorFlow on AWS (in Amazon SageMaker)
    • Deep Graph Library
    • Deep Java Library
    • Amazon SageMaker Clarify
    • Amazon SageMaker Jumpstart
    • AWS Neuron SDK
    • Scikit-learn extensions used by SageMaker Autopilot
    • Amazon SageMaker SDK
    • Amazon SageMaker operator for Kubernetes
    • pecos - Prediction for Enormous and Correlated Spaces
    • datatuner - end-to-end, data-to-text generation system
    • Amazon Braket PennyLane Plugin – quantum-classical hybrid computations on Amazon Braket using PennyLane
    Current list of open source AI/ML services and projects

    View Slide

  47. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Jupyter への貢献については
    AWS Blog
    • How and why AWS contributes to
    Jupyter
    https://aws.amazon.com/blogs/ope
    nsource/how-and-why-aws-
    contributes-to-jupyter/
    AWS re:Invent 2019
    • Deep dive on Project Jupyter
    https://d1.awsstatic.com/events/rei
    nvent/2019/Deep_dive_on_Project_
    Jupyter_AIM413.pdf

    View Slide

  48. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    DGL について詳しくは
    AWS ブログ
    • Amazon SageMakerですぐに利⽤可
    能: Deep Graph Library
    https://aws.amazon.com/jp/blogs/n
    ews/amazon-sagemaker-deep-
    graph-library/
    AWS Machine Learning Summit
    • Deep Graph Library: Deep Graph
    learning at scale
    https://youtu.be/VmQkLro6UWo

    View Slide

  49. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Hugging Face
    について詳しくは
    Documentation
    • Use Hugging Face with Amazon
    SageMaker
    https://docs.aws.amazon.com/sage
    maker/latest/dg/hugging-face.html
    • Hugging Face on Amazon SageMaker
    https://huggingface.co/docs/sagem
    aker/main
    AWS Machine Learning Summit
    • Accelerate NLP training with Amazon
    SageMaker
    https://youtu.be/1LwjUbzcJok

    View Slide

  50. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Hugging Face examples
    E X A M P L E N O T E B O O K は 全 て 英 語 で す
    • SageMaker で PyTorch と Hugging Face を使ってテキスト分類モデルをトレーニングしたい — PyTorch Getting Started Demo.
    • SageMaker で TensorFlow と Hugging Face を使ってテキスト分類モデルをトレーニングしたい — TensorFlow Getting Started example.
    • Hugging Face と SageMaker を使ってデータ並列処理による分散トレーニングを実⾏したい – Distributed Training example.
    • Hugging Face と SageMaker を使ってモデル並列処理による分散トレーニングを実⾏したい – Model Parallelism example.
    • SageMaker でスポットインスタンスを使⽤して Hugging Face のモデルをトレーニングしたい – Spot Instances example.
    • SageMaker で Hugging Face を使ってテキスト分類モデルをトレーニングするときに、カスタムメトリクスを取りたい – Training
    with Custom Metrics example.
    • SageMaker で Hugging Face を使って、TensorFlow の分散学習がしたい – Distributed TensorFlow Training example.
    https://docs.aws.amazon.com/sagemaker/latest/dg/hugging-face.html#hugging-face-do

    View Slide

  51. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    AutoGluon について詳しくは
    ブログ
    • AutoGluonのコンテナをSageMaker上で動かして⾼度なAutoMLを実現
    https://aws.amazon.com/jp/blogs/news/autogluon-container-sagemaker/
    • 3 ⾏のコードが実現する機械学習の⾃動化。「AutoGluon」が⾒据える未来とは ?
    https://aws.amazon.com/jp/builders-flash/202108/autogluon-interview/
    • 99 % のデータサイエンティストの精度を超えた AutoML ライブラリ、AutoGluon-Tabular を使ってみる
    https://aws.amazon.com/jp/builders-flash/202201/autogluon-tabular-tutorials/
    • AutoGluon Tabular: Automatic machine learning for tabular data
    https://www.amazon.science/videos-webinars/autogluon-tabular-automatic-machine-learning-for-tabular-data
    利⽤例
    • [Amazon Science] Fostering a culture of innovation
    https://www.amazon.science/working-at-amazon/fostering-a-culture-of-innovation
    • [NVIDIA Developer Blog] Advancing the State of the Art in AutoML, Now 10x Faster with NVIDIA GPUs and RAPIDS
    https://developer.nvidia.com/blog/advancing-the-state-of-the-art-in-automl-now-10x-faster-with-nvidia-gpus-and-
    rapids/

    View Slide

  52. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    • 動画
    https://youtu.be/yGW8EeroQys
    • スライド
    https://d1.awsstatic.com/events/Su
    mmits/AMER2020/Sept29/OPN201
    _Why_Amazon_cares_about_openso
    urce_software.pdf
    Amazon/AWS の
    オープンソースに関する取り組み全般については

    View Slide

  53. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    オープンソースプロジェクトのための
    AWS プロモーションクレジット
    • オープンソースプロジェクトや
    ファウンデーションなら
    どれでも適⽤可能
    • OSI 公認の有効なライセンスが必要
    • 有効な AWS アカウントが必要
    • 1年間有効なクレジット
    • 詳細はブログ参照
    https://aws.amazon.com/blogs/opensource/aws-promotional-credits-open-source-projects/

    View Slide

  54. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
    Amazon Braket と PennyLane
    量⼦コンピューティングの
    マネージドサービス Amazon Braket は
    微分可能プログラミングライブラリ
    PennyLane をサポート。
    量⼦・古典ハイブリッドアルゴリズム
    (量⼦機械学習、量⼦化学計算、
    組合せ最適化など) の応⽤を簡単に記述。
    Use PennyLane with Amazon Braket
    https://docs.aws.amazon.com/braket/l
    atest/developerguide/hybrid.html

    View Slide