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

機械学習の技術的負債を Amazon SageMaker Studio で解消

機械学習の技術的負債を Amazon SageMaker Studio で解消

AWS Summit 2023 にて「機械学習の技術的負債を Amazon SageMaker Studio で解消」のセッションでお話しした資料です。
動画も公開されていますので、是非ご覧ください。https://www.youtube.com/watch?v=kmuL0p5QrRg

▪️概要
機械学習プロジェクトでは、コーディング作業以外にも対応すべき作業が数多く存在します。例えば、データの前処理や特徴量抽出から、高スペックな開発環境の運用やデプロイ後の性能監視等々が挙げられます。これらは開発者に技術的負債となって伸し掛かり、プロジェクトの進捗や難易度に負の影響を齎すことが考えられます。今回ご紹介する Amazon SageMaker Studioは、このような技術的負債となる作業を省力化する機能が多々備わっております。本セッションでは、ユースケースを交えながらAmazon SageMaker Studioの機能を紹介します。

※2023/04/21 時点での最新情報となるため、ご注意ください。

Ryota Sawa

April 21, 2023
Tweet

More Decks by Ryota Sawa

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. 機械学習の技術的負債を Amazon SageMaker Studio で解消 澤 亮太 A W S - 3 0 アマゾン ウェブ サービス ジャパン合同会社 技術統括本部 ⻄⽇本ソリューション部 ソリューションアーキテクト
  2. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 本セッションについて 対象者 ・機械学習プロジェクトに関わる⽅ データアナリスト、データエンジニア、データサイエンティスト、 機械学習エンジニア、機械学習モデルの運⽤監視に関わる⽅など 持ち帰っていただきたいこと ・機械学習プロジェクトには特有の技術的負債があり、 いかに少ない労⼒で対策を⾏えるかが重要であること ・Amazon SageMaker が機械学習の様々なフェーズをサポートすること ・Amazon SageMaker Studio は単なる統合開発環境ではなく、 技術的負債を解消するツールとして活⽤できること 2
  3. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 澤 亮太 (Ryota Sawa) 技術統括本部 ⻄⽇本ソリューション部 ソリューションアーキテクト --- 前職では… 画像を中⼼とした機械学習開発, AI/ML⼈材育成, etc… ⾃⼰紹介 3
  4. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Agenda ・機械学習における技術的負債とは ・なぜ技術的負債の解消に Amazon SageMaker Studio が有効か ・機械学習プロジェクトのよくある悩み事から⾒る Amazon SageMaker Studio のユースケース 4
  5. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 機械学習における技術的負債とは
  6. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 世界中の企業で機械学習活⽤が進む The 2022 McKinsey Global Survey The state of AI in 2022—and a half decade in review December 6, 2022 | Survey 6 2017 2022 50%を超える企業が 機械学習を活⽤ 2017年と⽐較して 2.5倍に増加 20% 50%
  7. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 機械学習開発に求める要件は多岐にわたる ハードウェア コスト オーケストレーション スケーリング データ ⾃動化 セキュリティ 7
  8. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 機械学習プロジェクトのワークフロー 8 ビジネスゴールの特定 機械学習の課題設定 データ収集 データ前処理 特徴量エンジニアリング 学習 チューニング デプロイ 監視 ML Lensより抜粋(AWS Well-Architected Machine Learning Lens) https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/well-architected-machine-learning.html
  9. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ソフトウェア開発における技術的負債とは 9 開発スピードを優先したあまり、適切な設計や実装を犠牲にしてしまい、 後になってから様々な影響を及ぼすこと 障害リスクの増⼤、プロジェクト遅延、コスト増加、品質低下 絵 絵 可読性の低いコード 不⼗分なテストケース ドキュメントの⽋如 ・・・
  10. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 機械学習はコード以外に多くの周辺システムが必要 “Only a small fraction of real-world ML systems is composed of the ML code” source: Hidden Technical Debt in Machine Learning Systems [D. Sculley, & al.] – 2015 https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems.pdf 10 Configuration (構成) Data Collection (データ収集) Machine Resource Management (機械学習開発の リソース管理) Serving Infrastructure (推論環境) ML Code Analysis Tool (解析ツール) Process Management Tools (プロセス管理ツール) Feature Extraction (特徴量エンジニアリング) Monitoring (監視) Data Verification (データ検証)
  11. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 機械学習プロジェクトには、ソフトウェア開発にはない技術的負債が存在 機械学習特有の技術的負債とは 低品質のデータ 記録されていない 実験 データ/モデル変更の 影響範囲が不明 HW調達や環境準備に 時間を要する 監視や再学習などの 運⽤事項の考慮不⾜ モデル精度低下 要員追加の リードタイム増 再現実験の リードタイム増 システム障害 リスク増 モデル精度劣化 HW/環境 データ 実験 デプロイ モニタリング 11
  12. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 12 モニタリング 実験 データ デプロイ 機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code
  13. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 13 モニタリング 実験 データ デプロイ 機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code Amazon SageMaker Studio で解決できます
  14. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. なぜ技術的負債の解消に Amazon SageMaker Studio が有効か
  15. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker の機能⼀覧 データ準備からモデル構築、トレーニング、デプロイまで、あらゆるユースケースに対応 準備 Geospatial Visualize geospatial data Ground Truth Create high quality datasets for ML Data Wrangler Aggregate and prepare data for ML Processing Built-in Python, BYO R/Spark Feature Store Store, catalog, search, and reuse features Clarify Detect bias and understand model predictions ビルド Studio Notebooks & Notebook Instances Fully managed Jupyter notebooks with elastic compute Studio Lab Free ML development environment Built-in Algorithms Integrated tabular, NLP, and vision algorithms JumpStart UI based discovery, training, and deployment of models, solutions, and examples Autopilot Automatically create ML models with full visibility Bring Your Own Bring your own container and algorithms Local Mode Test and prototype on your local machine トレーニング Fully Managed Training Broad hardware options, easy to setup and scale Distributed Training Libraries High performance training for large datasets and models Training Compiler Faster deep learning model training Automatic Model Tuning Hyperparameter optimization Managed Spot Training Reduce training cost by up to 90% Debugger and Profiler Debug and profile training runs Experiments Track, visualize, and share model artifacts across teams Customization Support Integrate with popular open source frameworks and libraries デプロイ・運⽤ Fully Managed Deployment Ultra low latency, high throughput inference Real-Time Inference For steady traffic patterns Serverless Inference For intermittent traffic patterns Asynchronous Inference For large payloads or long processing times Batch Transform For offline inference on batches of large datasets Multi-Model Endpoints Reduce cost by hosting multiple models per instance Multi-Container Endpoints Reduce cost by hosting multiple containers per instance Shadow Testing Validate model performance in production Inference Recommender Automatically select compute instance and configuration Model Monitor Maintain accuracy of deployed models Kubernetes Operators & Components Manage and monitor models on edge devices Edge Manager Manage and monitor models on edge devices Studio | RStudio Integrated development environment (IDE) for ML Canvas Generate accurate machine learning predictions—no code required MLOps: Pipelines | Projects | Model Registry Workflow automation, CI/CD for ML, central model catalog Governance Model Cards | Dashboard | Permissions 15
  16. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 【再掲】機械学習はコード以外に多くの周辺システムが必要 “Only a small fraction of real-world ML systems is composed of the ML code” source: Hidden Technical Debt in Machine Learning Systems [D. Sculley, & al.] – 2015 https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems.pdf 16 Configuration (構成) Data Collection (データ収集) Machine Resource Management (機械学習開発の リソース管理) Serving Infrastructure (推論環境) ML Code Analysis Tool (解析ツール) Process Management Tools (プロセス管理ツール) Feature Extraction (特徴量エンジニアリング) Monitoring (監視) Data Verification (データ検証)
  17. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 17 Configuration Data Collection Data Verification Machine Resource Management Serving Infrastructure ML Code Analysis Tool Process Management Tools Feature Extraction Monitoring Ground Truth S3 Clarify Data Wrangler Feature Store Processing Studio Autopilot JumpStart Debugger Model Monitor Pipelines MWAA Greengrass QuickSight Experiments Auto Scaling Training Job SageMakerの機能 他のAWSサービス Glue Amazon SageMaker は機械学習システム全体で機能を提供 Endpoint
  18. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker Studio 18
  19. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. よくある悩み事から⾒る Amazon SageMaker Studio の ユースケース
  20. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう 20
  21. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう 機械学習プロジェクトへ参画することになった︕ 21 A
  22. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう 数値データを⽤いて、ある判定を⾏うモデルを開発することに 22 A
  23. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう まずはデータの分析や前処理を検討してモデル開発に使えるように 分析や前処理はどうやって進めていこうか… 23
  24. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう 有識者に聞くとプログラムを書いて⾊々と⾏っているらしい… ちょっとハードル⾼いなぁ… 24 A B
  25. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 25 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code GUIによる 前処理実装
  26. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 26 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code GUIによる 前処理実装 Amazon SageMaker Data Wrangler
  27. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker Data Wrangler データインサイト • ⽤意された可視化機能で分析が容易に • データ品質の問題や データのバイアス検出及び軽減ができる 特徴量エンジニアリング • 300を超える組み込みのデータ変換処理で 素早くデータを加⼯できる エクスポートして連携 • Notebook や Python コードへ 作成したワークフローをエクスポートできる 27 データをインポートするだけで、様々な機能が活⽤できる
  28. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう データは揃ったので次はモデル作りをすることに 28 HW ライブラリや フレームワーク モデル ⾊々なモデル試すにも準備が⼤変だなぁ… A
  29. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 29 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code
  30. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 30 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code GUIによる 前処理実装 モデル学習の ⾃動化 Amazon SageMaker Autopilot
  31. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker Autopilot 数クリックでAutoMLを実現 • 最適な予測タイプを⾃動的に推測 • 数百のモデルをトレーニングおよび最適化し て、データに最適なモデルを選択 モデル性能、精度を⼀覧化 • 正確性、精度、再現率、AUC などの メトリクスでランク付けしてリストを表⽰ ワンクリックでデプロイ • 利⽤したいモデルを選択するだけで 本番環境へデプロイできる 31 機械学習に必要な知識がなくても、最適なモデルを⾃動⽣成できる
  32. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 32 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code
  33. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 33 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ Amazon SageMaker JumpStart
  34. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker JumpStart 350を超えるモデルが利⽤可能 • 様々な⼈気のあるモデルハブにより 事前トレーニング済みのモデルを利⽤できる 簡単にデプロイできる • 推論⽤のコードがノートブック形式で 簡単に⾃動作成できる ファインチューニング可能 • ⾃作のデータセットでトレーニングできる ビルド済みソリューション • 機械学習の⼀般的なユースケース向けに ビルドされたソリューションも使える 34 様々なモデルやソリューションが、アルゴリズムの構築なしに数クリックで利⽤できる
  35. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 2017 StackGAN, Zhang et al. 2022 Stable Diffusion, Rombach et al. “a picture of a very clean living room” 注⽬を集める⼤規模モデル 35
  36. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. アルゴリズムの⾶躍的な進化 3.3億 ( GPT-2 ) 5400億 ( PaLM ) 2019 2022 ⼤規模モデルのパラメータ数は1600倍以上に増加 ※ 当時の最新モデルで⽐較 36
  37. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker JumpStart が提供する モデルやソリューション etc… 37
  38. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. とあるデータサイエンティストの話をみてみよう もっとカスタマイズしてモデルを作成したい 38 公開されたモデルを動かしたり ⾃作モデルを作りたい パラメータを変えて並列学習したい A
  39. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 39 やっぱり⼤変な環境構築から逃れられないのか… とあるデータサイエンティストの話をみてみよう もっとカスタマイズしてモデルを作成したい 1つ前の話に出てきた環境構築に必要な作業 A
  40. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 40 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code
  41. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 モデル精度の 追跡 41 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code 並列実験できる リソース Amazon SageMaker Studio Notebooks
  42. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 43 モニタリング 実験 データ デプロイ 【再掲】機械学習の技術的負債を⽣み出さないための機能例 HW/ 環境 ML Code
  43. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. GUIによる 前処理実装 モデル学習の ⾃動化 既存モデルの 利⽤ モデル承認 フロー簡素化 CI/CDの 実現 バイアスの 検出 特徴量共有 実験の記録 並列実験できる リソース モデル精度の 追跡 44 【再掲】機械学習の技術的負債を⽣み出さないための機能例 SageMaker Data Wrangler SageMaker Autopilot SageMaker JumpStart SageMaker Studio Notebooks SageMaker Model Monitor SageMaker Pipelines SageMaker Model Registry SageMaker Expriments SageMaker Clarify SageMaker Feature Store SageMaker Studio Notebooks モニタリング 実験 データ デプロイ HW/ 環境 ML Code
  44. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 45 Configuration Data Collection Data Verification Machine Resource Management Serving Infrastructure ML Code Analysis Tool Process Management Tools Feature Extraction Monitoring Ground Truth S3 Clarify Data Wrangler Feature Store Processing Studio Autopilot JumpStart Debugger Model Monitor Pipelines MWAA Greengrass QuickSight Experiments Auto Scaling Training Job SageMakerの機能 他のAWSサービス Glue Amazon SageMaker や AWS サービスを⽤いることで 技術的負債を解消できる Endpoint
  45. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SageMaker Immersion Day ⼀般公開されているワークショップコンテンツ https://catalog.us-east-1.prod.workshops.aws/workshops/63069e26-921c-4ce1-9cc7-dd882ff62575/ja-JP
  46. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon SageMaker Studio Lab データサイエンスの学習に適した環境がメールアドレスのみ、無料で開始できます。
  47. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. まとめ • 機械学習では技術的負債となる作業が数多くある • 各作業をいかに省⼒化できるかが⼤切 • Amazon SageMaker Studio は技術的負債を解消する機能がある • 前処理をGUIで⾏える Amazon SageMaker Data Wrangler • 多種多様なモデルをすぐに利⽤できる Amazon SageMaker JumpStart • 開発・学習環境を必要に応じて簡単に⽤意し、使い分けができる • モデルの学習を並列で実⾏も容易にできる などなど • Amazon SageMaker Studio はライセンス不要かつ無料で使える • 使った機能や⽤意した実⾏環境に対してのみ課⾦される 48 Amazon SageMaker Studio の機能を活⽤して 機械学習プロジェクトの技術的負債を解消しましょう︕
  48. © 2023, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Ryota Sawa(澤 亮太) アマゾン ウェブ サービス ジャパン合同会社 Solutions Architect(ソリューションアーキテクト)