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

AWS における LLM・GenAI 大規模学習への取り組み / Large scale GenAI・LLM training on AWS

AWS における LLM・GenAI 大規模学習への取り組み / Large scale GenAI・LLM training on AWS

Keita Watanabe

July 31, 2023
Tweet

More Decks by Keita Watanabe

Other Decks in Technology

Transcript

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

    rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Keita Watanabe Senior Solutions Architect, AIML Frameworks 1 AWS における LLM / GenAI ⼤規模学習への取り組み @NVIDIA 生成AI Day 2023 Summer
  2. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 渡辺啓太 (Keita Watanabe) Senior Solutions Architect, AI/ML Frameworks 略歴 • 現職では Solutions Architect としてGenAI/LLM の分散学習やモデルのデプロイメ ントなどを⽀援 • ⽇本最⼤級の E コマース サイトを⼿掛ける企業にて ML Researcherとして 商品画像検索サービスの研究開発に従事 • ⾃動運転を⼿掛けるスタートアップ企業にてML Researcher として⾃動運転⾞両の 意思決定システムの研究開発に従事 好きなAWS Service • AWS ParallelCluster • Amazon EKS • Amazon EC2
  3. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ・・・(略)・・・最後に紹介する投資分野は、今後数⼗年にわたってAmazonの中核であり、 多額の投資を⾏っている⼤規模⾔語モデル(LLM: Large Language Model)と Generative AI(⽣成系AI)です。機械学習は数⼗年前から有望な技術でしたが企 業で広く使⽤され始めたのはここ5〜10年です。この変化は、低価格、⼤量コンピューティ ング容量アクセス等、複数の要因で進展しました。Amazonは、25年間機械学習を幅 広く使⽤してきました。パーソナライズされたeコマースのレコメンデーション、フルフィルメント センターのピックパス、Prime Airのドローン配達、AlexaはじめAWS機械学習サービス (AWSはクラウドプロバイダーの中で最も幅広い機械学習サービスと顧客基盤を備えて います)、とあらゆることに機械学習を採⽤しています。最近Generative AI(⽣成系 AI)と呼ばれる新しい機械学習が登場し、機械学習の運⽤を⼤幅に加速させると期待 されています。Generative AI(⽣成系AI)は、膨⼤なデータセットにわたる超⼤規模 ⾔語モデル・・・(略)・・・ Amazonは、独⾃のLLMに取り組んできました。ほぼ全ての顧 客体験が変⾰および改善される・(略)・今後も多額の投資を続けていきます。 ・・・ (略)・・・あらゆる規模の企業がGenerative AI(⽣成系AI)を活⽤できるよう、このテ クノロジーを⺠主化しています。AWS は Trainium と Inferentia で最もコストパフォー マンスの⾼い機械学習チップを提供しており、どの企業でも LLM を本番環境で・(略)・企 業がさまざまな LLM から選択して、 ・・・(略)・・・セキュリティ、プライバシーを守り、お客様 が使い慣れている機能を備えたアプリケーションを構築できるようにします。 ・(略)・LLM と Generative AI(⽣成系AI) は⼤きな変⾰をもたらします。 ・・・(略)・・・この⼿紙で は、LLM とGenerative AI(⽣成系AI) が、お客様、株主、Amazonにとって⼤きな 仕事になることだけお伝えします。 2023年4月13日 “2022 CEO Andy Jassy ‘s Letter to Shareholders”
  4. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon の DNA に組み込まれた 機械学習によるイノベーション 毎分4,000個 Amazon.comでの取引 毎⽇160万個 のパッケージ発送 毎週10億件を超える Alexaでのインタラクション 2016年12⽉7⽇〜 Prime Airドローン配達開始
  5. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 画像・動画 ⾳声 テキスト 検索 チャットボット パーソナライゼーション 需要予測 不正検知 コンタクト・センター Deep Learning AMIs & Containers GPUs & CPUs Elastic Inference Trainium Inferentia FPGA AIサービス 機械学習(ML)サービス フレームワーク & インフラ 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 産業⽤ AI コード & DevOps Amazon DevOps Guru Voice ID For Amazon Connect Contact Lens Amazon Monitron AWS Panorama + Appliance Amazon Lookout for Vision Amazon Lookout for Equipment Amazon HealthLake 医療 AI Amazon Lookout for Metrics 異常検知 Amazon Transcribe Medical Amazon Comprehend Medical Amazon SageMaker ラベリ ング データ準備 特徴量 ストア Auto ML Spark/R バイアス 検出 ノート ブック アルゴリズム 選択 モデル 学習 パラメータ 最適化 デバッグ プロファイル 本番 デプロイ 管理 モニター CI/CD ⽬検 確認 Amazon SageMaker Studio (統合開発環境) TensorFlow PyTorch AWSのミッション︓全てのお客様に機械学習をお届けする 5 SageMaker JumpStart
  6. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 咲く Generative AI(⽣成系AI)とは? • 会話、ストーリー、画像、動画、⾳楽など、新しいコンテンツやアイデアを創造 • ⼀般に基盤モデル(FM:ファウンデーションモデル) と呼ばれる 膨⼤なデータに基づいて事前にトレーニングされた⼤規模モデルを搭載 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  7. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner GenAI ワークロードとそれぞれの課題
  8. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner GenAI ワークロードとそれぞれの課題
  9. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Bedrock 基盤モデル を使⽤して ⽣成系 AI アプリケーションを構築・スケーリングする 最も簡単な⽅法 NEW Limited Preview
  10. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 複数の基盤モデルから⽤途に最適なものを選択 Amazonが提供 最先端スタートアップ企業が提供 AI21 Labs、 Anthropic、 Stability AI Titan Text Titan Embeddings Claude Jurassic-2 Stable Diffusion Limited Preview
  11. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. メリット • Amazon の20年以上の経験に もとづいて開発 • 基盤モデル Amazon Titan Text により、 要約やテキスト⽣成等、⾔語タスクを⾃動化 • 基盤モデル Amazon Titan Embeddings に より、検索やリコメンドの精度を向上 • 不適切・有害なコンテンツを軽減することで、 ⽣成系AIの責任ある利⽤を⽀援 Amazon が責任をもって開発した⾼性能 基盤モデル Amazon Titan Titan Text ⾃然⾔語処理 NLP タスク Titan Embeddings 検索やリコメンドの ようなタスク Limited Preview
  12. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 最先端AIスタートアップ企業の基盤モデル Jurassic-2 Claude Stable Diffusion スペイン語、フランス語、ドイツ語、 ポルトガル語、イタリア語、オランダ語での テキスト⽣成⽤の多⾔語 LLM 会話およびテキスト処理タスク⽤の LLM ユニークでリアル、⾼品質な画像、 アート、ロゴ、デザインの⽣成 Limited Preview
  13. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⾃社のデータを使⽤して基盤モデルをカスタマイズ 利⽤可能なラベル付きの データが少なくて済む 特定のタスクの精度を最⼤化 Fine tune ⽬的 データのニーズ Limited Preview
  14. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Try out models via AWS Console Fine tune model Sagemaker Jumpstart モデルプロバイダー 提供のFM を選択 1 モデルをFine tune・ Deploy 2 利⽤可能なラベル付きの データが少なくて済む (⾼コスト効率) 特定のタスクの精度を ドメイン特化の訓練データを⽤ いて最⼤化 Fine tune
  15. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. https://aws.amazon.com/jp/blogs/machine-learning/llama-2-foundation-models- from-meta-are-now-available-in-amazon-sagemaker-jumpstart/
  16. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner GenAI ワークロードとそれぞれの課題
  17. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner Bedrock や Jump Start を⽤いて最新の FM をFine tune Try out models via AWS Console Fine tune model モデルプロバイダー 提供のFM を選択 1 モデルをFine tune・ Deploy 2
  18. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner GenAI ワークロードとそれぞれの課題
  19. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. YEAR 2012 2016 2018 2019 2020 2021 … … YOLO, GNMT 210M BERT-L 340M GPT-2 1.5B GPT-3 175B 2022 Alexnet 62M SWITCH-C 1.6T 基盤モデルの性能を⽀える 機械学習モデルの⼤規模化 モデルのサイズは年 10 倍のペースで増加している (パラメータ数)
  20. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模モデルの学習には⼤規模な計算資源が必要 Q. GPT-3 (175 B) に⼀ヶ⽉で300 B tokens 学習させたいとき、必要となる NVIDIA A100(80GB) は何枚か︖ ※ Sequence Length は2048, Batch size は1536 とする
  21. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模モデルの学習には⼤規模な計算資源が必要 Q. GPT-3 (175 B) に⼀ヶ⽉で300 B tokens 学習させたいとき、必要となる NVIDIA A100(80GB) は何枚か︖ ※ Sequence Length は2048, Batch size は1536 とする A. 1024 枚⽤いて34 ⽇間のトレーニングが必要[1] [1] Narayanan, Deepak, et al. "Efficient large-scale language model training on gpu clusters using megatron-lm." Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis. 2021.
  22. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模モデルの学習には⼤規模な計算資源が必要 [1] Narayanan, Deepak, et al. "Efficient large-scale language model training on gpu clusters using megatron-lm." Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis. 2021. ⾼速なアクセラレータを搭載したインスタンスを多数⽤いて トレーニングをスケールさせる必要がある Q. GPT-3 (175 B) に⼀ヶ⽉で300 B tokens 学習させたいとき、必要となる NVIDIA A100(80GB) は何枚か︖ ※ Sequence Length は2048, Batch size は1536 とする A. 1024 枚⽤いて34 ⽇間のトレーニングが必要[1]
  23. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • ⼤容量デバイス メモリ • ⾼速アクセラレータ • 広帯域 インターコネクト • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ
  24. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • ⼤容量デバイス メモリ • ⾼速アクセラレータ • 広帯域 インターコネクト • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ
  25. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. P4d DL1 P3 P4de P5 ⼤規模モデル学習に適した幅広い選択肢 Habana Gaudi アクセラレータ AWS Trainium アクセラレータ H100/A100/V100 GPU AI/ML アクセラレータ Trn1 Trn1n
  26. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. P4d DL1 P3 P4de P5 ⼤規模モデル学習に適した幅広い選択肢 Habana Gaudi アクセラレータ AWS Trainium アクセラレータ H100/A100/V100 GPU AI/ML アクセラレータ Trn1 Trn1n
  27. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon EC2 P4d/P4de インスタンス • 8枚の NVIDIA A100 Tensor コア GPU アクセラレータ搭載 • 各40/80GB、合計320/640 GB の⾼帯域幅 (HBM2)デバイスメモリ • 8TB のローカル NVMe SSD • 600GB/s のアクセラレータ間通信 P4d Instance Size GPU アクセラレータ メモリ vCPU メモリ アクセラレータ P2P BW オンデマンド 価格* (USD/時間) P4d.24xlarge 8 320 GB 96 1152 GiB 600 GB/s 32.77 P4de.24xlarge 8 640 GB 96 1152 GiB 600 GB/s 40.96 * N. Virginia https://aws.amazon.com/ec2/instance-types/p4/
  28. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. CHALLENGE SOLUTION OUTCOME AI21 Labs では、Amazon EC2 と PyTorch を使⽤し て、1,780 億のパラメータの基礎となるモデルを構築 しました。 AI21 Labs は、1,780 億個のパ ラメーターを持つ⾃⼰回帰型 ⾔語モデルである Jurassic-1 Jumbo をトレーニングしなが ら、強⼒なコンピューティン グ機能とネットワーク機能を 実現し、効率を最⼤化したい と考えていました。 同社は Amazon EC2 P4d インスタンスを使⽤しました。これに より、モデルトレーニングを数百の GPU に分散させることで、 ⾃然⾔語処理をサービスとして提供するために必要なパフォーマ ンスとメモリを獲得できました。 ü 1,780億のパラメータと256,000項⽬の語彙を含む⾔語モデル を開発しました ü 効率的かつコスト効率よく数百個の GPU に拡張可能 ü ⼤規模なモデル開発に関する知識の確⽴
  29. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon EC2 P5 インスタンス P5 • 最⼤8枚の NVIDIA H100 Tensor コア GPU • 各80GB、合計640 GB のデバイスメモリ • 前世代のGPU インスタンスと⽐較して 最⼤40% 低コスト • P4d インスタンスと⽐較して最⼤6倍、 P4de インタンスと⽐較して最⼤4倍⾼速 https://press.aboutamazon.com/2023/3/aws-and-nvidia-collaborate-on-next-generation- infrastructure-for-training-large-machine-learning-models-and-building-generative-ai-applications
  30. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • ⼤容量デバイス メモリ • ⾼速アクセラレータ • 広帯域 インターコネクト • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ
  31. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • 広帯域 インターコネクト • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ
  32. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • 広帯域 インターコネクト • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ
  33. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. L1 L2 L3 L4 L1 L4 トレーニング データ ML モデル Worker #0 Worker #1 Worker #2 L2 L1 L4 L3 L3 L1 L4 L2 L1 L2 L3 L4 L1 L4 L2 L1 L4 L3 L3 L1 L4 L2 なぜインターコネクトが重要か︖ Tensor 並列型分散学習の例
  34. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Elastic Fabric Adapter (EFA) Userspace Kernel Elastic Network Adapter only With Elastic Fabric Adapter PCIe Libfabric API によるOSカーネルをバイパスした通信 Out of order での転送︓ Head of blocking 問題を回避 マルチパスルーティングによる安定した低レイテンシーの実現
  35. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. アクセラレータ別 EFA 対応状況まとめ Instance アクセラレー タ アクセラレータ メモリ EFA version ネット ワーク帯域 P4d.24xlarge GPU 320 GB V1 400 Gbps P4de.24xlarge* GPU 320 GB V1 400 Gbps P5* GPU 640 GB V2 3200 Gbps * Preview
  36. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. アクセラレータ別 EFA 対応状況まとめ Instance アクセラレー タ アクセラレータ メモリ EFA version ネット ワーク帯域 P4d.24xlarge GPU 320 GB V1 400 Gbps P4de.24xlarge* GPU 320 GB V1 400 Gbps P5* GPU 640 GB V2 3200 Gbps * Preview
  37. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. PyTorch FSDP を⽤いた分散学習のパフォーマンス検証 GPT-3 175B parameters model EFA v1 https://medium.com/pytorch/training-a-1-trillion-parameter-model- with-pytorch-fully-sharded-data-parallel-on-aws-3ac13aa96cff 記事公開⽇: 2022/05/16 2.5x 25.6x faster 512 GPUs = 64 instances
  38. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. アクセラレータ別 EFA 対応状況まとめ Instance アクセラレー タ アクセラレータ メモリ EFA version ネット ワーク帯域 P4d.24xlarge GPU 320 GB V1 400 Gbps P4de.24xlarge* GPU 320 GB V1 400 Gbps P5* GPU 640 GB V2 3200 Gbps * Preview
  39. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 第2世代EFA 2D-Ring トポロジーをサポート デ バ イ ス 間 接 続 E F A V 2
  40. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 第2世代 EFA を⽤いた⾼速な集団通信 (Trn1) Ring AllReduce time 2D-Ring AllReduce time 512 -75% Trainium チップの数 時間
  41. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 0 20 40 60 80 100 120 140 1 16 インスタンス数 Trn1 第2世代 EFA によるスケーリングの例 GPT-3 https://awsdocs-neuron.readthedocs-hosted.com/en/latest/general/benchmarks/trn1/trn1- performance.html#trn1-performance スケーリング効率 92.74 % - Megatron-LM を⽤いたTrn1 上での分散学習例 - 1インスタンス - Global minibatch 64 - 16 インスタンス - Global minibatch 1024 ⼀秒間に処理する シーケンス数 https://awsdocs- neuron.readthedocs- hosted.com/en/latest/frameworks/t orch/torch- neuronx/tutorials/training/megatron _lm_gpt.html#megatron-lm- pretraining-tutorial
  42. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. アクセラレータ別 EFA 対応状況まとめ Instance アクセラレー タ アクセラレータ メモリ EFA version ネット ワーク帯域 P4d.24xlarge GPU 320 GB V1 400 Gbps P4de.24xlarge* GPU 320 GB V1 400 Gbps P5* GPU 640 GB V2 3200 Gbps * Preview ⼤規模モデルの学習に特にオススメ
  43. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • 広帯域 インターコネクト • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ
  44. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ Availability Zone VPC Region Elastic Fabric Adapter
  45. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ Availability Zone VPC Region Elastic Fabric Adapter
  46. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 複数ノードを⽤いた分散学習ではデータセットに 共有ストレージ経由でアクセスする EC2 Compute 共有ストレージサーバー ⼤規模データセット …
  47. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 複数ノードを⽤いた分散学習ではデータセットに 共有ストレージ経由でアクセスする EC2 Compute 共有ストレージサーバー ⼤規模データセット ストレージがボトルネックになると 計算リソースの性能をフルに活⽤できなくなる …
  48. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon FSx for Lustre EC2 Compute 共有ストレージサーバー ⼤規模データセット … ⾼速な分散ファイルシステムであるLustre をフルマネージドで提供 容量に応じて⾼いパフォーマンスを提供 …
  49. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 機械学習向けデータを扱う際によくある希望 多様かつ⼤量のデータセットをAmazon S3 に格納してコストを抑えつつ 処理を⾏うときだけ必要なデータセットに ⾼速なファイルストレージ経由でアクセスしたい
  50. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 機械学習向けデータを扱う際によくある希望 多様かつ⼤量のデータセットをAmazon S3 に格納してコストを抑えつつ 処理を⾏うときだけ必要なデータセットに ⾼速なファイルストレージ経由でアクセスしたい FSx for Lustre のS3 連携機能を活⽤
  51. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 分散学習におけるストレージの階層構造 Object us-east-1a Region Instance Store • Checkpoints, temporary data FSx for Lustre • Shared data sets, checkpoints, outputs Amazon S3 • Data backbone, datasets, checkpoints, outputs
  52. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • PB スケールのデータ バックボーン • ⾼速な共有ストレージ • 計算資源のオーケストレータ • ジョブスケジューラ Availability Zone VPC Region Elastic Fabric Adapter
  53. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • 計算資源のオーケストレータ • ジョブスケジューラ Availability Zone VPC Region Elastic Fabric Adapter Amazon FSx for Lustre Amazon EC2 Instance Store Amazon Simple Storage Service (Amazon S3)
  54. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ⼤規模学習を⽀える技術要素 Network Storage Architecture & Orchestration Compute • 計算資源のオーケストレータ • ジョブスケジューラ Availability Zone VPC Region Elastic Fabric Adapter Amazon FSx for Lustre Amazon EC2 Instance Store Amazon Simple Storage Service (Amazon S3)
  55. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 例: Stability AI におけるStable Diffusion の学習 AWS re:Invent 2022 - How Stable Diffusion was built: Tips & tricks to train large AI models (CMP314) より
  56. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Stable Diffusion クエリ例︓ “A photo of an astronaut riding a horse on mars” (⽕星で⾺に乗る宇宙⾶⾏⼠の写真) Stable Diffusion: テキストから 画像を⽣成するモデル トレーニングには4000 枚のA100 を搭載 したEC2 UltraCluster が⽤いられた
  57. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Stable Diffusion クエリ例︓ “A photo of an astronaut riding a horse on mars” (⽕星で⾺に乗る宇宙⾶⾏⼠の写真) Stable Diffusion: テキストから 画像を⽣成するモデル トレーニングには4000 枚のA100 を搭載 したEC2 UltraCluster が⽤いられた
  58. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon EC2 UltraClusters 最⼤ 4,000 A100 GPUs 最⼤ 20,000 H100 GPUs ペタビットスケールの ノンブロッキングネットワーキ ングインフラストラクチャ FSx for Lustre による ⾼スループットの 低レイテンシーストレージ ⾼性能コンピューティング、ネットワーキング、およびストレージを兼ね備えた 世界で最も強⼒なスーパーコンピューターの 1 つ
  59. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Private subnet Public subnet AWS ParallelCluster us-east-1b us-east-1 GPU/Trainium/Gaudi Compute Fleet Amazon FSx for Lustre /scratch Users AWS Cloud AWS ParallelCluster オープンソースのクラスター管理ツール • pip 経由でインストール可能な CLI or GUI を⽤いてHPC システム が構築可能 • “Battle-tested” なスケジューラで あるSlurmを使⽤ • Cluster placement group により、 インスタンスを物理的に集約可能 • CloudFormation を⽤いてクラスタ 作成に必要なAWS リソースを⾃動 で作成
  60. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Private subnet Public subnet us-east-1b us-east-1 p4d.24xlarge Compute Fleet Amazon FSx for Lustre /fsx Users AWS Cloud AWS ParallelCluster Head-node • 1 × c5.9xlarge 36 vCPUs (18 physical) • 72 GB of memory Compute Node • 100+ × p4de.24xlarge + C6, M6, R6 • 96 vCPUs (48 physical) • 1152 GB of memory • 8 × NVIDIA A100 80GB GPUs • Network: 400Gbs ENA & EFA • Storage: 8 × 1TB NVMe + EBS Shared file-systems • Amazon FSx for Lustre of 108TB on /fsx Cluster Stack • Slurm 22.05.5 • Cuda 11.6 構成例
  61. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. CHALLENGE SOLUTION OUTCOME Stability AIは、Amazon EC2とPyTorchで、強⼒ なマルチモーダル⽣成系AIモデルを容易に開発 マルチモーダルモデル、特に ⾃然⾔語処理と画像を扱うモ デル Stable Diffusionは、何⼗億⼈ もの⼈々が数秒で素晴らしい アートを制作できるようにす るテキストから画像へ変換す るモデルです。 このモデルは、様々なアプ ローチを検討する⼀連のモデ ルの第1弾として、先⽉、 4,000台のA100 UltraCluster でトレーニングされました。 コンピューティング:Amazon EC2 P4d インスタンス スケール:1 回のトレーニングジョブで 4,000 個の GPU オーケストレーション:EKS PyTorchライブラリ: torch.nn.DataParallel ü コンピューティング:Amazon EC2 G5 インスタンス ü オーケストレーション:Kubernetes ü ストレージ:Amazon Simple Storage Service (S3) ü PyTorchライブラリ: TorchServe
  62. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. エマド・モスタック Stability AI 最⾼経営責任者 ⼤規模な PyTorch ベースの 機械学習 モデルを Amazon EC2 P4d インスタンスでトレーニングし、Amazon FSx を Lustre と AWS Batch に活⽤することで、クラウドスケールを活⽤して GAN コンピュータービジョンとトランスフォーマーモデルの分 散トレーニングを⾏うことができました。クラウドサービスを 使⽤してトレーニングを拡張できるようになったことで、これ らの⼤規模モデルのトレーニングに数か⽉かかっていた時間を 数⽇に短縮し、オープンソースコミュニティにリリースできる ようになりました。AWS は信頼できるパートナーであり、技術 的な問題を解決するために私たちと⾜並みを揃えて協⼒し、 シームレスなデプロイ体験を提供してくれました。GTP-Neox や その他の最先端の 機械学習 モデルを AWS でトレーニングする 予定です。 Stability AIは、Amazon EC2とPyTorchで、強⼒なマルチ モーダル⽣成系AIモデルを容易に開発
  63. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner GenAI ワークロードとそれぞれの課題
  64. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider GenAI ワークロードとそれぞれの課題 Storage Network Availability Zone VPC Region Elastic Fabric Adapter Architecture & Orchestration AWS ParallelCluster Amazon FSx for Lustre Amazon EC2 Instance Store Amazon Simple Storage Service (Amazon S3) Compute
  65. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 公開FMの ファインチューニング Operation cost を最⼩化したい Model Tuner Bedrock や Jump Start を⽤いて最新の FM をFine tune Try out models via AWS Console Fine tune model モデルプロバイダー 提供のFM を選択 1 モデルをFine tune・ Deploy 2
  66. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. FM の開発 ⼤規模な計算リソース を効率的にスケールしたい Model Provider GenAI ワークロードとそれぞれの課題 Storage Network Availability Zone VPC Region Elastic Fabric Adapter Architecture & Orchestration AWS ParallelCluster Amazon FSx for Lustre Amazon EC2 Instance Store Amazon Simple Storage Service (Amazon S3) Compute
  67. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Thank you! 渡辺 啓太 アマゾンウェブサービスジャパン合同会社 コンピュート事業本部 シニアソリューションアーキテクト、AI/ML Frameworks